From 8516513b2812b9e982db0a7690d81db36e0f020f Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 20 Jul 2010 22:36:25 +0200 Subject: [PATCH] Implement the -a option in the right place - in livecd.sh, not in BuildLiveCD. --- BuildLiveCD | 28 ++-------------------------- debian/changelog | 7 +++++++ livecd.sh | 20 +++++++++++++++++++- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/BuildLiveCD b/BuildLiveCD index 76e71b53..701af485 100755 --- a/BuildLiveCD +++ b/BuildLiveCD @@ -37,7 +37,7 @@ while getopts :s:d:f:pa: name; do case $name in d) NEWSUITE="$OPTARG";; f) IMAGEFORMAT="-f$OPTARG";; p) PROPOSED="-p";; - a) APT_SOURCE="$OPTARG";; + a) APT_SOURCE="-A $OPTARG";; esac; done; shift $((OPTIND-1)) @@ -104,23 +104,6 @@ set -e for STE in $SUITES; do if [ -d ~/build-${STE}-live/chroot-${STE} ]; then - if [ -n "$APT_SOURCE" ]; then - sudo sed -i -e"\$a\ -deb $APT_SOURCE $STE main" ~/build-${STE}-live/chroot-${STE}/etc/apt/sources.list - # allow unsigned sources, unfortunately - echo 'APT::Get::AllowUnauthenticated "yes";' | sudo tee ~/build-${STE}-live/chroot-${STE}/etc/apt/apt.conf.d/extra-source-allows-unauthenticated-sources > /dev/null - # and add the preferences rules :( - APT_PIN=$(echo $APT_SOURCE | sed -e's,http://,,; s,/.*,,') - cat | sudo tee ~/build-${STE}-live/chroot-${STE}/etc/apt/preferences.d/local-source-preferred-even-downgrade > /dev/null < ${LOG} 2>&1; then + if $LINUX32 sudo chroot ${DIR%/./*} sh -c "cd /${DIR#*/./} && /usr/sbin/livecd.sh ${SUBARCHARG} ${APT_SOURCE} ${PROPOSED} -d${STE} ${IMAGEFORMAT} ${ARCHARG} ${IMAGEARG} $arg" > ${LOG} 2>&1; then rm -f ${PUBDIR}current ln -sf ${NOW} ${PUBDIR}current @@ -182,10 +165,3 @@ for STE in $SUITES; do fi done done -for STE in $SUITES; do - if [ -d ~/build-${STE}-live/chroot-${STE} ] && [ -n "$APT_SOURCE" ]; then - sudo sed -i -e"/$APT_SOURCE $STE/d" ~/build-${STE}-live/chroot-${STE}/etc/apt/sources.list - sudo rm -f ~/build-${STE}-live/chroot-${STE}/etc/apt/apt.conf.d/extra-source-allows-unauthenticated-sources - sudo rm -f ~/build-${STE}-live/chroot-${STE}/etc/apt/preferences.d/local-source-preferred-even-downgrade - fi -done diff --git a/debian/changelog b/debian/changelog index fe19d868..e12b81e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (1.135) UNRELEASED; urgency=low + + * Implement the -a option in the right place - in livecd.sh, not in + BuildLiveCD. + + -- Steve Langasek Tue, 20 Jul 2010 22:31:09 +0200 + livecd-rootfs (1.134) maverick; urgency=low * Add -a option to BuildLiveCD to allow pulling from an additional apt diff --git a/livecd.sh b/livecd.sh index 433bf49c..13423e83 100755 --- a/livecd.sh +++ b/livecd.sh @@ -155,7 +155,7 @@ IMAGEFORMAT="squashfs" # name is "ppa", don't omit it PPA="" -while getopts :d:e:i:I:m:S:s:a:f:p name; do case $name in +while getopts :d:e:i:I:m:S:s:a:A:f:p name; do case $name in d) STE=$OPTARG;; e) EXCLUDE="$EXCLUDE $OPTARG";; i) LIST="$LIST $OPTARG";; @@ -164,6 +164,7 @@ while getopts :d:e:i:I:m:S:s:a:f:p name; do case $name in S) USZ="$OPTARG";; s) SUBARCH="$OPTARG";; a) ARCH="$OPTARG";; + A) APT_SOURCE="$OPTARG";; f) IMAGEFORMAT="$OPTARG";; p) PROPOSED="yes";; \?) echo bad usage >&2; exit 2;; @@ -441,6 +442,23 @@ Pin-Priority: 900 Package: * Pin: release o=LP-PPA-$origin Pin-Priority: 550 +@@EOF + fi + if [ -n "$APT_SOURCE" ]; then + echo deb $APT_SOURCE $STE $COMP >> ${ROOT}etc/apt/sources.list + # allow unsigned sources, unfortunately + mkdir -p ${ROOT}etc/apt/apt.conf.d + echo 'APT::Get::AllowUnauthenticated "yes";' > ${ROOT}etc/apt/apt.conf.d/extra-source-allows-unauthenticated-sources + # and add the preferences rules :( + APT_PIN=$(echo $APT_SOURCE | sed -e's,http://,,; s,/.*,,') + cat >> ${ROOT}etc/apt/preferences << @@EOF +Package: * +Pin: release a=$STE +Pin-Priority: 500 + +Package: * +Pin: origin $APT_PIN +Pin-Priority: 1001 @@EOF fi