[Debian-NP-Commits] r267 - people/vagrant/simple-cdd

Vagrant Cascadian debian-np-devel@lists.alioth.debian.org
Fri, 26 Nov 2004 13:21:09 -0700


Author: vagrant-guest
Date: Fri Nov 26 13:20:52 2004
New Revision: 267

Added:
   people/vagrant/simple-cdd/simple-cdd-packages   (contents, props changed)
   people/vagrant/simple-cdd/simple-cdd-preseed   (contents, props changed)
Modified:
   people/vagrant/simple-cdd/CONF.sh
   people/vagrant/simple-cdd/build-simple-cdd
Log:
make debpartial-mirror optional, add package installer and preseed scripts


Modified: people/vagrant/simple-cdd/CONF.sh
==============================================================================
--- people/vagrant/simple-cdd/CONF.sh	(original)
+++ people/vagrant/simple-cdd/CONF.sh	Fri Nov 26 13:20:52 2004
@@ -57,6 +57,9 @@
 
 ## debpartial-mirror values ##
 
+# call debpartial-mirror at each build- defaults to true.
+#do_mirror="false"
+
 # use a proxy 
 #export http_proxy=http://localhost:3128
 

Modified: people/vagrant/simple-cdd/build-simple-cdd
==============================================================================
--- people/vagrant/simple-cdd/build-simple-cdd	(original)
+++ people/vagrant/simple-cdd/build-simple-cdd	Fri Nov 26 13:20:52 2004
@@ -59,39 +59,39 @@
   echo "" >> $BASE_INCLUDE
 fi
 
-# TODO make debpartial-mirror optional
+if [ -z "$do_mirror" ] || [ "$do_mirror" = "true" ] ; then
+  debpartial_conf=debpartial-mirror.conf
+  cp -f $debpartial_conf $debpartial_conf.bak
 
-debpartial_conf=debpartial-mirror.conf
-cp -f $debpartial_conf $debpartial_conf.bak
+  # generate debpartial-mirror.conf
 
-# generate debpartial-mirror.conf
+  # TODO check if variables used in conf file generation are set.
 
-# TODO check if variables used in conf file generation are set.
+  echo [mirror] > $debpartial_conf
+  echo server=$debpartial_debian_mirror >> $debpartial_conf
 
-echo [mirror] > $debpartial_conf
-echo server=$debpartial_debian_mirror >> $debpartial_conf
+  echo local_directory=$MIRROR >> $debpartial_conf
 
-echo local_directory=$MIRROR >> $debpartial_conf
+  echo files=$debpartial_files >> $debpartial_conf
 
-echo files=$debpartial_files >> $debpartial_conf
+  echo get_suggests=false >> $debpartial_conf
 
-echo get_suggests=false >> $debpartial_conf
+  echo get_recomends=false >> $debpartial_conf
 
-echo get_recomends=false >> $debpartial_conf
+  echo get_provides=false >> $debpartial_conf
 
-echo get_provides=false >> $debpartial_conf
+  echo archs=$ARCH >> $debpartial_conf
 
-echo archs=$ARCH >> $debpartial_conf
+  echo [$CODENAME] >> $debpartial_conf
 
-echo [$CODENAME] >> $debpartial_conf
+  # use '' to prevent shell expansion
+  echo filter='main:*:standard main:*:required main:*:important main/debian-installer:*:*' >> $debpartial_conf
 
-# use '' to prevent shell expansion
-echo filter='main:*:standard main:*:required main:*:important main/debian-installer:*:*' >> $debpartial_conf
+  echo include-task=$TASK >> $debpartial_conf
 
-echo include-task=$TASK >> $debpartial_conf
-
-# generate the mirror
-debpartial-mirror -c debpartial-mirror.conf
+  # generate the mirror
+  debpartial-mirror -c debpartial-mirror.conf
+fi
 
 if [ ! -d "$MIRROR" ]; then
   echo "ERROR: mirror dir not a dir: $MIRROR"

Added: people/vagrant/simple-cdd/simple-cdd-packages
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/simple-cdd-packages	Fri Nov 26 13:20:52 2004
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# base-config script to install packages included by profiles
+
+echo "installing simple-cdd packages..."
+
+profiles="$(debconf-show simple-cdd | grep simple-cdd/profiles | cut -d : -f 2 | sed -e 's/,/ /g')"
+
+echo "profiles: $profiles"
+
+cd /usr/local/simple-cdd/
+
+for p in $profiles ; do
+  if [ -r "$p.packages" ]; then
+    echo "Installing packages for profile: $p"
+    packages="$(egrep -v ^# $p.packages)"
+    apt-get -yu install $packages
+    if [ "0" != "$?" ]; then
+      echo "Problems encountered installing packages for profile $p,"
+      echo "installing packages one at a time..."
+      for a in $packages ; do
+        apt-get -yu install $a
+      done
+    fi
+  fi
+done

Added: people/vagrant/simple-cdd/simple-cdd-preseed
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/simple-cdd-preseed	Fri Nov 26 13:20:52 2004
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# base-config script to install packages included by profiles
+
+echo "loading simple-cdd preseeding files"
+
+profiles="$(debconf-show simple-cdd | grep simple-cdd/profiles | cut -d : -f 2 | sed -e 's/,/ /g')"
+
+echo "profiles: $profiles"
+
+cd /usr/local/simple-cdd
+
+for p in $profiles ; do
+  if [ -r "$p.preseed" ]; then
+    echo "Debconf preseeding for: $p"
+    debconf-set-selections $p.preseed
+  fi
+done