blob: 0e78b562bd05a5a0444161b6fa17d1acd5768894 (
plain)
- #!/bin/sh
- set -eu
- infile="$1"; shift
- outfile="$1"; shift
- # remaining arguments are packagelist files
- pkgdesc=$(perl -nE '/^[#]{2} (.*)/ and say "# $1"; /^[#]{1} (.*)/ and say "# * $1"' "$@") #'
- pkglist=$(perl -ne 'chomp; /^[^#]+/ and print "$_ "' "$@")
- export pkgdesc pkglist
- mkdir -p $(dirname $outfile)
- perl -pe 's,__PKGDESC__,$ENV{"pkgdesc"},;s,__PKGLIST__,$ENV{"pkglist"},' < $infile > $outfile~
- mv -f $outfile~ $outfile
|