diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-03-02 21:06:00 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-03-02 21:06:00 +0100 |
commit | 91baeb0561c44cbdcf774220d1b40291c4be8045 (patch) | |
tree | 47955b98198a43df9e139bca77a6dcf07b2fc496 /bin/pkglist2preseed | |
parent | 32b956ecd785a95d51bc47df6a549b77e707f4e5 (diff) |
Restructure to generate preseed files from skeleton + packagelists.
Diffstat (limited to 'bin/pkglist2preseed')
-rwxr-xr-x | bin/pkglist2preseed | 12 |
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 |