diff --git a/build.sh b/build.sh index 5b745e8..2492a47 100755 --- a/build.sh +++ b/build.sh @@ -16,7 +16,8 @@ EOF fi if [ -f ${i}-packages-nr ]; then log "Begin ${SUB_STAGE_DIR}/${i}-packages-nr" - PACKAGES=`cat $i-packages-nr | tr '\n' ' '` + PACKAGES="$(sed -e ':a;N;$ !b a' -e 's/[[:space:]]*\(#[^\n]*\)*[[:space:]]/ /g' < ${i}-packages-nr)" + if [ -n "$PACKAGES" ]; then on_chroot sh -e - << EOF apt-get install --no-install-recommends -y $PACKAGES @@ -26,7 +27,7 @@ EOF fi if [ -f ${i}-packages ]; then log "Begin ${SUB_STAGE_DIR}/${i}-packages" - PACKAGES=`cat $i-packages | tr '\n' ' '` + PACKAGES="$(sed -e ':a;N;$ !b a' -e 's/[[:space:]]*\(#[^\n]*\)*[[:space:]]/ /g' < ${i}-packages)" if [ -n "$PACKAGES" ]; then on_chroot sh -e - << EOF apt-get install -y $PACKAGES