X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F33-aptsetup;h=e4922a9da613598afc469d10646af6ba75e82142;hp=002e000b71feda23e08494fe12edc10e90b308b5;hb=f3b335ea5c94d5cf24ec6b9184106b298849f311;hpb=9d16d7a6c9686f80a18e70bc8b5e67193dc0ffba diff --git a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup index 002e000..e4922a9 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +++ b/etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup @@ -1,35 +1,26 @@ #!/bin/bash -# Filename: /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/33-aptsetup # Purpose: configure Debian package management of live-system # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ +set -u set -e -if [ -L "$target"/etc/apt/sources.list ] ; then - echo "Note: $target/etc/apt/sources.list seems to be the old sources.list setup." - echo "|-> Not modifying anything. If you want to switch to the new setup just" - echo "\`-> remove symlink $target/etc/apt/sources.list" - exit 0 -fi - -# remove leftover from /etc/grml/fai/config/hooks/instsoft.GRMLBASE: -rm -f $target/etc/apt/sources.list.d/grml-live.list +GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list" +DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list" # 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 +if [ -r "${GRML_SOURCES_LIST}.unused" ] ; then + mv "${GRML_SOURCES_LIST}.unused" "${GRML_SOURCES_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 +if [ -r "${DEBIAN_SOURCES_LIST}.unused" ] ; then + mv "${DEBIAN_SOURCES_LIST}.unused" "${DEBIAN_SOURCES_LIST}" fi -GRML_SOURCES_LIST="$target/etc/apt/sources.list.d/grml.list" -DEBIAN_SOURCES_LIST="$target/etc/apt/sources.list.d/debian.list" - [ -d $target/etc/apt/sources.list.d ] || mkdir $target/etc/apt/sources.list.d # remove any existing sources.list and inform user about the new @@ -105,4 +96,4 @@ EOF fi ## END OF FILE ################################################################# -# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3 +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2