build.sh: Support comments in package files
This patch allows the use of hash comments inside patch files. It's a little ugly, but it strips comments and collapses all whitespace down to single space characters between package names. It handles comments anywhere in a line, as well. Was unsure if \ continuation of the long sed line or the inclusion of a couple of lines of comments explaining what the sed expressions are doing would be appreciated, so didn't include them in this patch.
This commit is contained in:
parent
9cf2f2efe6
commit
5783929943
5
build.sh
5
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user