diff options
| author | Michael Forney <mforney@mforney.org> | 2016-12-18 16:28:38 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-12-19 00:05:57 -0800 |
| commit | 2420bcc6b191d1db5d324a4b4dd597da25843338 (patch) | |
| tree | 895d2fc168ff855a1dac3b77ecdd91f1cf84cc88 /pkg/man-pages-posix | |
| parent | 393306274e1042368f586516cff41c0e222493cb (diff) | |
Compress man pages
Diffstat (limited to 'pkg/man-pages-posix')
| -rw-r--r-- | pkg/man-pages-posix/gen.rc | 2 | ||||
| -rw-r--r-- | pkg/man-pages-posix/manpages.rc | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/pkg/man-pages-posix/gen.rc b/pkg/man-pages-posix/gen.rc index 55892923..fe97395a 100644 --- a/pkg/man-pages-posix/gen.rc +++ b/pkg/man-pages-posix/gen.rc @@ -1,4 +1,4 @@ -rule manpages 'rc ./$dir/manpages.rc $builddir/$repo.git $out $srcdir' ; with\ +rule manpages 'rc ./$dir/manpages.rc $builddir/$repo.git $out $srcdir $outdir' ; with\ deps gcc\ depfile '$out.d' build '$outdir'/manpages.index manpages '|' '$dir'/manpages.rc config.rc '||' '$outdir'/fetch.stamp diff --git a/pkg/man-pages-posix/manpages.rc b/pkg/man-pages-posix/manpages.rc index dbdf782f..efcb823e 100644 --- a/pkg/man-pages-posix/manpages.rc +++ b/pkg/man-pages-posix/manpages.rc @@ -6,10 +6,11 @@ flag e + ifs=' ' +~ $#* 4 repo=$1 out=$2 dir=$3 -shift 2 +outdir=$4 fn checkstatus {} @@ -19,8 +20,13 @@ checkstatus cd $dir pages=man?p/* pages=() -for(f in man?p/*) if(fs extra/man-pages-posix $f) - pages=($pages $f) +for(d in man?p) { + mkdir -p $wd/$outdir/$d + for(f in $d/*) if(fs man-pages-posix share/man/$f.gz) { + gzip -c -9 -n $f > $wd/$outdir/$f.gz + pages=($pages $f) + } +} cd $wd if(~ $#pages 0) { @@ -29,11 +35,12 @@ if(~ $#pages 0) { exit } -hashes=`{git -C $repo hash-object -w --no-filters -- $wd/$dir/$pages} +hashes=`{git -C $repo hash-object -w --no-filters -- $wd/$outdir/$pages.gz} checkstatus +rm $outdir/$pages.gz ~ $#pages $#hashes -printf '100644 %s\n' $hashes' share/man/'$pages >$out.tmp +printf '100644 %s\n' $hashes' share/man/'$pages.gz >$out.tmp mv $out.tmp $out echo $out: $dir/$pages >$out.d.tmp |
