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

Vagrant Cascadian debian-np-devel@lists.alioth.debian.org
Thu, 25 Nov 2004 19:27:29 -0700


Author: vagrant-guest
Date: Thu Nov 25 19:27:23 2004
New Revision: 251

Added:
   people/vagrant/simple-cdd/simple-cdd-profiles   (contents, props changed)
   people/vagrant/simple-cdd/simple-cdd.templates
Modified:
   people/vagrant/simple-cdd/TODO
   people/vagrant/simple-cdd/build-simple-cdd
Log:
theoretical scripts to select profiles.


Modified: people/vagrant/simple-cdd/TODO
==============================================================================
--- people/vagrant/simple-cdd/TODO	(original)
+++ people/vagrant/simple-cdd/TODO	Thu Nov 25 19:27:23 2004
@@ -1,3 +1,5 @@
+figure out how to get tasksel to not install anything extra during base-config
+
 use preseed include mechanisms rather than simply appending to default
 preseeding file.
 

Modified: people/vagrant/simple-cdd/build-simple-cdd
==============================================================================
--- people/vagrant/simple-cdd/build-simple-cdd	(original)
+++ people/vagrant/simple-cdd/build-simple-cdd	Thu Nov 25 19:27:23 2004
@@ -120,12 +120,19 @@
 extras_dir="$simple_cdd_dir/extras/simple-cdd"
 mkdir -p $extras_dir
 
-all_extras="$package_files $preseed_files"
+all_extras="$package_files $preseed_files simple-cdd-profiles"
 # copy files to extras directory
-for f in $all_extras ; do
-  cp -f $f $extras_dir/
+for file in $all_extras ; do
+  cp -f $file $extras_dir/
 done
 
+# populate the choices file.
+for a in $profiles ; do
+  choices="$profiles,$choices"
+done
+
+cat $simple_cdd_dir/simple-cdd.templates | sed s/CHOICES/$choices/g | sed -e 's/,/, /g' > $extras_dir/simple-cdd.templates
+
 # FIXME provide a selection mechanism for profile package and debconf
 # selections, rather than just installing them all
 

Added: people/vagrant/simple-cdd/simple-cdd-profiles
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/simple-cdd-profiles	Thu Nov 25 19:27:23 2004
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+debconf-loadtemplates simple-cdd /usr/local/simple-cdd/simple-cdd.templates
+
+# load debconf
+. /usr/share/debconf/confmodule
+
+db_input high simple-cdd/profiles
+db_go
+
+db_get simple-cdd/profiles || /bin/true
+profiles=$(echo $RET | sed -e 's/,/ /g')
+db_stop
+
+cd /usr/local/simple-cdd
+for p in $profiles ; do
+  if [ -r "$p.preseed" ]; then
+    debconf-set-selections /usr/local/simple-cdd/$p.preseed
+  fi
+  if [ -r "$p.packages" ]; then
+    apt-get -yu install "$(egrep -v ^# $p.packages)"
+  fi
+done

Added: people/vagrant/simple-cdd/simple-cdd.templates
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/simple-cdd.templates	Thu Nov 25 19:27:23 2004
@@ -0,0 +1,7 @@
+Template: simple-cdd/profiles
+Type: multiselect
+Default: default
+Choices: CHOICES
+Description: Select profiles
+ profiles are a simple description of common system types.
+ select all that apply.