summaryrefslogtreecommitdiff
path: root/bin/pkglist2preseed
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pkglist2preseed')
-rwxr-xr-xbin/pkglist2preseed12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/pkglist2preseed b/bin/pkglist2preseed
new file mode 100755
index 0000000..1691f4e
--- /dev/null
+++ b/bin/pkglist2preseed
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -eu
+
+skelfile="$1"; shift
+
+pkgdesc=$(perl -nE '/^[#]{2} (.*)/ and say "# $1"; /^[#]{1} (.*)/ and say "# * $1"' "$@") #'
+pkglist=$(perl -ne 'chomp; /^[^#]+/ and print "$_ "' "$@")
+
+export pkgdesc pkglist
+
+perl -pe 's,__PKGDESC__,$ENV{"pkgdesc"},;s,__PKGLIST__,$ENV{"pkglist"},' < $skelfile