From ef25e56c75368839bef0cd1356016d5bd29e3e99 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 28 Mar 2014 02:42:15 +0100 Subject: Introduce new profile serialization: runtime scripted install/update. --- bin/pkglist2preseed | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bin') 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"},;'\ -- cgit v1.2.3