| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | set -eu |
| 4 | |
| 5 | outdir="$1" |
| 6 | |
| 7 | mkdirscip-shell system . . mkdir. -p "$outdir" |
| 8 | |
| 9 | isas=$(catscip-shell system . . cat. isa-list | grepscip-shell system . . grep. ^Name | cutscip-shell system . . cut. -d " " -f2) |
| 10 | |
| 11 | for po in debian/po/*.po ; do |
| 12 | po2="$outdir/$(basenamescip-shell system . . basename. "$po")" |
| 13 | truncatescip-shell system . . truncate. -s0 "$po2" |
| 14 | |
| 15 | echoscip-shell system . . echo. "Extending $po: s/&NAME&/\$isa > $po2" |
| 16 | csplitscip-shell system . . csplit. --quiet --suppress-matched -f "$po2." -b '%02d.sect' "$po" '/^$/scip-shell filesystem . . `/^$/`.' '{*}' |
| 17 | for sect in $(lsscip-shell system . . ls. -1 $po2*.sect | sortscip-shell system . . sort. -n) ; do |
| 18 | if grepscip-shell system . . grep. -q '@NAME@' $sect ; then |
| 19 | for isa in $isas ; do |
| 20 | catscip-shell system . . cat. $sect | sedscip-shell system . . sed. -e "s/@NAME@/$isa/g" >> "$po2" |
| 21 | echoscip-shell system . . echo. >> "$po2" |
| 22 | done |
| 23 | else |
| 24 | catscip-shell system . . cat. $sect >> "$po2" |
| 25 | echoscip-shell system . . echo. >> "$po2" |
| 26 | fi |
| 27 | rmscip-shell system . . rm. $sect |
| 28 | done |
| 29 | done |