Support setting Debian mirror components
authorMichael Prokop <mika@grml.org>
Fri, 8 May 2009 11:51:16 +0000 (13:51 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 8 May 2009 11:51:16 +0000 (13:51 +0200)
chroot-script
config

index 2b3e1ef..ac11325 100755 (executable)
@@ -47,12 +47,14 @@ stage() {
 # define chroot mirror {{{
 chrootmirror() {
   [ -n "$KEEP_SRC_LIST" ] && return
+  [ -z "$COMPONENTS" ]    && COMPONENTS='main contrib non-free'
+
   if [ -n "$ISO" ] ; then
-     echo "deb $ISO $RELEASE main contrib" > /etc/apt/sources.list
-     [ -n "$MIRROR" ] && echo "deb $MIRROR $RELEASE main contrib non-free" >> /etc/apt/sources.list
+     echo "deb $ISO $RELEASE $COMPONENTS" > /etc/apt/sources.list
+     [ -n "$MIRROR" ] && echo "deb $MIRROR $RELEASE $COMPONENTS" >> /etc/apt/sources.list || /bin/true
   else
     if [ -n "$MIRROR" ] ; then
-       echo "deb $MIRROR $RELEASE main contrib non-free" > /etc/apt/sources.list
+       echo "deb $MIRROR $RELEASE $COMPONENTS" > /etc/apt/sources.list
     fi
   fi
 }
diff --git a/config b/config
index bd8dcca..66f8fc9 100644 (file)
--- a/config
+++ b/config
@@ -74,6 +74,10 @@ MIRROR='ftp://ftp.de.debian.org/debian'
 #                   squeeze (testing), sid (unstable)
 RELEASE='lenny'
 
+# define components that should be used within sources.list
+# default:
+# COMPONENTS='main contrib non-free'
+
 # architecture
 # if unset the default of the running system (see 'dpkg --print-architecture') will be taken
 # notice: installing an amd64 system requires a 64bit kernel