make_image: ensure correct quoting of variables when calling genisoimage

By first assembling the command in a variable and then using eval to execute it
we avoid both duplication and errors passing quoted options in $MKISOFS_OPTS.
This commit is contained in:
Frans Pop 2008-12-05 09:08:13 +00:00
parent eb58e46871
commit b094f77592
2 changed files with 20 additions and 40 deletions

6
debian/changelog vendored
View File

@ -58,7 +58,11 @@ debian-cd (3.1.0) UNRELEASED; urgency=low
now just lists the files *within* the mirror; it's up to callers to
prepend ${MIRROR} as needed.
-- Frans Pop <fjp@debian.org> Thu, 13 Nov 2008 22:17:21 +0100
[ Frans Pop ]
* make_image: ensure correct quoting of variables when calling genisoimage.
Closes: #507300.
-- Frans Pop <fjp@debian.org> Fri, 05 Dec 2008 10:04:03 +0100
debian-cd (3.0.5) unstable; urgency=low

View File

@ -85,63 +85,39 @@ do
# here... :-(
if [ $JIGDO_WANTED = 0 ] && [ $ISO_WANTED = 1 ] ; then
echo $MKISOFS $MKISOFS_OPTS -V "$volid" -o $OUT/$OUTFILE.iso $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V "$volid" -o $OUT/$OUTFILE.iso $opts $dirs CD$n > CD$n/.disk/mkisofs
$MKISOFS $MKISOFS_OPTS -V "$volid" -o $OUT/$OUTFILE.iso $opts $dirs CD$n
CMD="$MKISOFS $MKISOFS_OPTS -V '$volid' \
-o $OUT/$OUTFILE.iso $opts $dirs CD$n"
echo $CMD
echo $CMD > CD$n/.disk/mkisofs
eval "$CMD"
elif [ $JIGDO_WANTED = 1 ] && [ $ISO_WANTED = 1 ] ; then
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
CMD="$MKISOFS $MKISOFS_OPTS -V '$volid' \
-o $OUT/$OUTFILE.iso \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
-jigdo-map Debian=$MIRROR/ \
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
-o $OUT/$OUTFILE.iso \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
-jigdo-map Debian=$MIRROR/ \
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n > CD$n/.disk/mkisofs
$MKISOFS $MKISOFS_OPTS -V "$volid" \
-o $OUT/$OUTFILE.iso \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
-jigdo-map Debian=$MIRROR/ \
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n
$JIGDO_OPTS $opts $dirs CD$n"
echo $CMD
echo $CMD > CD$n/.disk/mkisofs
eval "$CMD"
elif [ $JIGDO_WANTED = 1 ] && [ $ISO_WANTED = 0 ] ; then
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
CMD="$MKISOFS $MKISOFS_OPTS -V '$volid' \
-o /dev/null \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
-jigdo-map Debian=$MIRROR/ \
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n
echo $MKISOFS $MKISOFS_OPTS -V "$volid" \
-o /dev/null \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
-jigdo-map Debian=$MIRROR/ \
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n > CD$n/.disk/mkisofs
$MKISOFS $MKISOFS_OPTS -V "$volid" \
-o /dev/null \
-jigdo-jigdo $OUT/$OUTFILE.jigdo \
-jigdo-template $OUT/$OUTFILE.template \
-jigdo-map Debian=$MIRROR/ \
-jigdo-exclude boot$n \
-md5-list $DIR/md5-check \
$JIGDO_OPTS $opts $dirs CD$n
$JIGDO_OPTS $opts $dirs CD$n"
echo $CMD
echo $CMD > CD$n/.disk/mkisofs
eval "$CMD"
else
echo "Neither jigdo nor iso wanted for CD$n"