reworked BuildLiveCD command line parsing to be more sane

ubuntu/precise
Michael Casadevall 15 years ago
parent f5c8c36a6c
commit 2fa3e89b62

@ -27,33 +27,19 @@ fi
ARCH=$(dpkg --print-architecture) ARCH=$(dpkg --print-architecture)
SUBARCH="" SUBARCH=""
SUBARCHARG="" SUBARCHARG=""
DEFAULTSUITE="karmic" NEWSUITE="maverick"
NEWSUITE=""
SUITES="" SUITES=""
PROPOSED="" PROPOSED=""
IMAGEFORMAT="" IMAGEFORMAT="squashfs"
if [ "$1" = '-s' ]; then
shift while getopts :s:d:f:p name; do case $name in
SUBARCH="$1" s) SUBARCH="$OPTARG";;
SUBARCHARG="-s$SUBARCH" d) NEWSUITE="$OPTARG";;
shift f) IMAGEFORMAT="$OPTARG";;
fi p) PROPOSED="-p";;
if [ "$1" = '-p' ]; then esac; done;
PROPOSED='-p' shift $((OPTIND-1))
shift
fi
if [ "$1" = '-d' ]; then
shift
NEWSUITE="$1"
shift
else
NEWSUITE="$DEFAULTSUITE"
fi
if [ "$1" = '-f' ]; then
shift
IMAGEFORMAT=$1
shift
fi
for s in $NEWSUITE; do for s in $NEWSUITE; do
if [ -d build-${s}-live/chroot-${s} ]; then SUITES="$SUITES $s"; fi if [ -d build-${s}-live/chroot-${s} ]; then SUITES="$SUITES $s"; fi
done done
@ -134,7 +120,7 @@ for STE in $SUITES; do
rm -f ${PUBDIR}latest rm -f ${PUBDIR}latest
ln -sf ${PUBDIR}${NOW} ${PUBDIR}latest ln -sf ${PUBDIR}${NOW} ${PUBDIR}latest
mkdir -p ${PUBDIR}${NOW} mkdir -p ${PUBDIR}${NOW}
if $LINUX32 sudo chroot ${DIR%/./*} sh -c "cd /${DIR#*/./} && /usr/sbin/livecd.sh ${SUBARCHARG} ${PROPOSED} -d${STE} ${ARCHARG} ${IMAGEFORMAT} $arg" > ${LOG} 2>&1; then if $LINUX32 sudo chroot ${DIR%/./*} sh -c "cd /${DIR#*/./} && /usr/sbin/livecd.sh ${SUBARCHARG} ${PROPOSED} -d${STE} -f${IMAGEFORMAT} ${ARCHARG} ${IMAGEARG} $arg" > ${LOG} 2>&1; then
rm -f ${PUBDIR}current rm -f ${PUBDIR}current
ln -sf ${NOW} ${PUBDIR}current ln -sf ${NOW} ${PUBDIR}current

1
debian/changelog vendored

@ -4,6 +4,7 @@ livecd-rootfs (1.116) UNRELEASED; urgency=low
* added support for building ext2 and ext3 images in addition to squashfs * added support for building ext2 and ext3 images in addition to squashfs
* fixed spacing in the livefs build code * fixed spacing in the livefs build code
* extended BuildLiveCD to handle the -f switch * extended BuildLiveCD to handle the -f switch
* reworked BuildLiveCD command line parsing to be more sane
-- Michael Casadevall <mcasadevall@ubuntu.com> Mon, 17 May 2010 13:59:28 -0400 -- Michael Casadevall <mcasadevall@ubuntu.com> Mon, 17 May 2010 13:59:28 -0400

Loading…
Cancel
Save