summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-03-28 02:42:15 +0100
committerJonas Smedegaard <dr@jones.dk>2014-03-28 10:03:11 +0100
commitef25e56c75368839bef0cd1356016d5bd29e3e99 (patch)
tree000227ff65d68f2f7cddc535c5411c22dd83e0ff
parentb653172c650ca8fe15e9c49601c6aec9314491c8 (diff)
Introduce new profile serialization: runtime scripted install/update.
-rw-r--r--Makefile5
-rwxr-xr-xbin/pkglist2preseed14
-rw-r--r--skel/script.sh.in13
3 files changed, 30 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 70e6768..984a4af 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,8 @@ lcgroupfiles = $(foreach lcgroup,$(lcgroups),\
mainfiles = $(patsubst %,content/%/preseed.cfg,$(maintopics))
mainlcgroupfiles = $(patsubst %,content/desktop/%/preseed.cfg,$(lcgroups))
profiles-di = $(basefiles) $(topicfiles) $(lcgroupfiles) $(mainfiles) $(mainlcgroupfiles)
-profiles = $(profiles-di)
+profiles-script = $(patsubst %/preseed.cfg,%/script.sh,$(profiles-di))
+profiles = $(profiles-di) $(profiles-script)
mdfiles = content/MD5SUMS
shafiles = $(patsubst %,content/SHA%SUMS,1 256 512)
checksumfiles = $(mdfiles) $(shafiles)
@@ -38,6 +39,8 @@ $(mainfiles): content/%/preseed.cfg : skel/preseed.cfg.in profiles/% $(desktopto
$(mainlcgroupfiles): content/desktop/%/preseed.cfg : skel/preseed.cfg.in profiles/desktop $(desktoptopiclists) $(desktoptopiclcgrouplists) profiles/desktop-z $(desktoptweaks)
bin/pkglist2preseed $(filter skel/%,$^) $@ "$(filter profiles/%,$^)" "$(filter tweaks/%,$^)"
+$(profiles-script): %script.sh : %preseed.cfg
+
$(mdfiles): content/MD%SUMS: $(profiles)
cd content && md$*sum $(profiles:content/%=%) > MD$*SUMS~
rm -f $@.sign
diff --git a/bin/pkglist2preseed b/bin/pkglist2preseed
index b9d5304..61300a3 100755
--- a/bin/pkglist2preseed
+++ b/bin/pkglist2preseed
@@ -7,6 +7,10 @@ outfile="$2"
pkgfiles="$3"
tweakfiles="$4"
+outdir=$(dirname $outfile)
+altinfile=$(dirname $infile)/script.sh.in
+altoutfile=$outdir/script.sh
+
pkgdesc=$(perl -nE '/^[#]{2} (.*)/ and say "# $1"; /^[#]{1} (.*)/ and say "# * $1"' $pkgfiles) #'
pkglist=$(perl -ne 'chomp; /^[^#]+/ and print "$_ "' $pkgfiles)
@@ -15,7 +19,15 @@ tweaklist=$(perl -ne 'chomp; /^(?!#)\s*(.+)/ and print "$1;"' $tweakfiles)
export pkgdesc pkglist tweakdesc tweaklist
-mkdir -p $(dirname $outfile)
+mkdir -p $outdir
+perl -p \
+ -e 's,__PKGDESC__,$ENV{"pkgdesc"},;'\
+ -e 's,__PKGLIST__,$ENV{"pkglist"},;'\
+ -e 's,__TWEAKDESC__,$ENV{"tweakdesc"},;'\
+ -e 's,__TWEAKLIST__,$ENV{"tweaklist"},;'\
+ < $altinfile \
+ > $altoutfile~
+mv -f $altoutfile~ $altoutfile
perl -p \
-e 's,__PKGDESC__,$ENV{"pkgdesc"},;'\
-e 's,__PKGLIST__,$ENV{"pkglist"},;'\
diff --git a/skel/script.sh.in b/skel/script.sh.in
new file mode 100644
index 0000000..cd2f83e
--- /dev/null
+++ b/skel/script.sh.in
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+# This is an install/update script for DebianParl
+# DebianParl Homepage: https://wiki.debian.org/DebianParl
+# Source of this code: git://git.debian.org/parl/blends
+
+__PKGDESC__
+aptitude install task-xfce-desktop task-laptop task-ssh-server __PKGLIST__
+
+__TWEAKDESC__
+__TWEAKLIST__