From 71d1b1de4a148424e952884095813fba6098b458 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 2 Feb 2010 02:12:40 +0100 Subject: [PATCH] Make sure to use sources.list of grml-live, even on updates through -u option. [Closes: issue803] --- etc/grml/fai/config/hooks/instsoft.GRMLBASE | 12 +++++++++++- etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/etc/grml/fai/config/hooks/instsoft.GRMLBASE b/etc/grml/fai/config/hooks/instsoft.GRMLBASE index 55886f9..f1a947b 100755 --- a/etc/grml/fai/config/hooks/instsoft.GRMLBASE +++ b/etc/grml/fai/config/hooks/instsoft.GRMLBASE @@ -52,15 +52,25 @@ EOF fi # FAI softupdate executes upgrade only with the sources.list being - # present in the chroot :-/ - so let's do it on our own: + # present in the chroot - so let's do it on our own: if [ -r /etc/grml/fai/apt/sources.list ] ; then if [ -L $target/etc/apt/sources.list ] ; then rm $target/etc/apt/sources.list fi + + # install grml-live's (on the fly adjusted) sources.list config cp /etc/grml/fai/apt/sources.list $target/etc/apt/sources.list.d/grml-live.list + + # when re-running grml-live with the -u option we do not want to use the + # sources.list config of the live system but grml-live's config instead, + # therefore temporarly move known files and restore them again later on + # through /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup: if [ -r $target/etc/apt/sources.list.d/grml.list ] ; then mv $target/etc/apt/sources.list.d/grml.list $target/etc/apt/sources.list.d/grml.unused fi + if [ -r $target/etc/apt/sources.list.d/debian.list ] ; then + mv $target/etc/apt/sources.list.d/debian.list $target/etc/apt/sources.list.d/debian.unused + fi fi # run it on our own, as updatebase is used at the wrong stage for our needs, diff --git a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup index 0750201..64bd111 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +++ b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup @@ -18,10 +18,14 @@ fi # remove leftover from /etc/grml/fai/config/hooks/instsoft.GRMLBASE: rm -f $target/etc/apt/sources.list.d/grml-live.list -# restore original grml sources.list file: +# restore original grml sources.list file (temporarly moved via +# /etc/grml/fai/config/hooks/instsoft.GRMLBASE): if [ -r $target/etc/apt/sources.list.d/grml.unused ] ; then mv $target/etc/apt/sources.list.d/grml.unused $target/etc/apt/sources.list.d/grml.list fi +if [ -r $target/etc/apt/sources.list.d/debian.unused ] ; then + mv $target/etc/apt/sources.list.d/debian.unused $target/etc/apt/sources.list.d/debian.list +fi GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list" DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list" -- 2.1.4