From a75ccbd6dd458ac5234ba59437550da27aaa44b4 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Wed, 30 Aug 2017 23:15:45 -0400 Subject: selfstrap: minor refactor --- multistrap/selfstrap | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/multistrap/selfstrap b/multistrap/selfstrap index c693a4e..165a921 100755 --- a/multistrap/selfstrap +++ b/multistrap/selfstrap @@ -239,7 +239,19 @@ apt_extract() { apt_get -d -yqq install "$@" actions=$(mktemp) || die 'mktemp failed' - apt_get -s -yqq install "$@" | tee "$actions" | while read line; do + apt_get -s -yqq install "$@" | tee "$actions" | dpkg_extract_from_apt + + if [ "$EXTRACT_DPKG_INFO" ]; then + install_etc_passwd + dpkg_inst_from_apt < "$actions" + fi + + rm "$actions" +} + +dpkg_extract_from_apt() +{ + while read line; do parse_apt_noact_line "$line" || die "unexpected output from apt-get: $line" @@ -265,11 +277,6 @@ apt_extract() *) die "impossible" ;; esac done - if [ "$EXTRACT_DPKG_INFO" ]; then - install_etc_passwd - dpkg_inst_from_apt < "$actions" - fi - rm "$actions" } install_etc_passwd() -- cgit v1.2.3