Implement -D option to set configuration directory; fai.conf: don't set variables...
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 33-aptsetup
index 9e4df63..e4922a9 100755 (executable)
@@ -1,24 +1,26 @@
-#!/bin/sh
-# Filename:      /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup
+#!/bin/bash
+# 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 <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
 ################################################################################
 
+set -u
 set -e
 
-# 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:
-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
-
 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 "${GRML_SOURCES_LIST}.unused" ] ; then
+   mv "${GRML_SOURCES_LIST}.unused" "${GRML_SOURCES_LIST}"
+fi
+if [ -r "${DEBIAN_SOURCES_LIST}.unused" ] ; then
+   mv "${DEBIAN_SOURCES_LIST}.unused" "${DEBIAN_SOURCES_LIST}"
+fi
+
 [ -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
@@ -47,16 +49,28 @@ fi
 
 # configure official Debian repositories:
 cat > "$DEBIAN_SOURCES_LIST" << EOF
-# official debian repository:
+# official debian repository (mirror selected via geo-ip):
   deb     http://cdn.debian.net/debian/ $SUITE main contrib non-free
-  deb-src http://cdn.debian.net/debian/ $SUITE main contrib non-free
+#  deb-src http://cdn.debian.net/debian/ $SUITE main contrib non-free
+
+# official debian repository:
+#  deb     http://ftp.debian.org/debian/ sid main contrib non-free
+#  deb-src http://ftp.debian.org/debian/ sid main contrib non-free
+
+# official debian DE repository:
+#  deb     http://ftp.de.debian.org/debian/ sid main contrib non-free
+#  deb-src http://ftp.de.debian.org/debian/ sid main contrib non-free
+
+# official debian AT repository:
+#  deb     http://ftp.at.debian.org/debian/ sid main contrib non-free
+#  deb-src http://ftp.at.debian.org/debian/ sid main contrib non-free
 EOF
 
 # configure grml-stable repository:
 cat > "$GRML_SOURCES_LIST" << EOF
 # stable grml repository:
   deb     http://deb.grml.org/ grml-stable  main
-  deb-src http://deb.grml.org/ grml-stable  main
+#  deb-src http://deb.grml.org/ grml-stable  main
 EOF
 
 ENABLE_GRML_TESTING=false
@@ -71,7 +85,7 @@ if $ENABLE_GRML_TESTING ; then
   cat >> "$GRML_SOURCES_LIST" << EOF
 # testing/developer grml repository:
   deb     http://deb.grml.org/ grml-testing main
-  deb-src http://deb.grml.org/ grml-testing main
+#  deb-src http://deb.grml.org/ grml-testing main
 EOF
 else # no devel/daily build:
   cat >> "$GRML_SOURCES_LIST" << EOF
@@ -82,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