From dea333c4de7999911c17d7776ab41438400eb4eb Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Sun, 2 Jul 2017 03:33:13 +0000 Subject: [PATCH] Add function "run_packages" --- build.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 52a849a..d7701c8 100755 --- a/build.sh +++ b/build.sh @@ -38,23 +38,30 @@ EOF fi } +run_packages() { + if [ -f "$1" ]; then + log_begin "$1" + + PACKAGES="$(sed -f "$SCRIPT_DIR/remove-comments.sed" < "$1")" + + if [ -n "$PACKAGES" ]; then + on_chroot < /dev/null for i in {00..99}; do run_debconf "$SUB_STAGE_DIR/$i-debconf" run_packages_nr "$SUB_STAGE_DIR/$i-packages-nr" + run_packages "$SUB_STAGE_DIR/$i-packages" - if [ -f ${i}-packages ]; then - log "Begin ${SUB_STAGE_DIR}/${i}-packages" - PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < ${i}-packages)" - if [ -n "$PACKAGES" ]; then - on_chroot << EOF -apt-get install -y $PACKAGES -EOF - fi - log "End ${SUB_STAGE_DIR}/${i}-packages" - fi if [ -d ${i}-patches ]; then log "Begin ${SUB_STAGE_DIR}/${i}-patches" pushd ${STAGE_WORK_DIR} > /dev/null