summaryrefslogtreecommitdiff
path: root/bin/pkglist2preseed
blob: 1691f4e7b972d956e1adfafc1ee62aabccfd03a0 (plain)
  1. #!/bin/sh
  2. set -eu
  3. skelfile="$1"; shift
  4. pkgdesc=$(perl -nE '/^[#]{2} (.*)/ and say "# $1"; /^[#]{1} (.*)/ and say "# * $1"' "$@") #'
  5. pkglist=$(perl -ne 'chomp; /^[^#]+/ and print "$_ "' "$@")
  6. export pkgdesc pkglist
  7. perl -pe 's,__PKGDESC__,$ENV{"pkgdesc"},;s,__PKGLIST__,$ENV{"pkglist"},' < $skelfile