newtree/tools/zpak

23 lines
448 B
Text
Raw Permalink Normal View History

#!/bin/bash
if [ $# -eq 0 ]; then
2001-01-09 23:51:29 +00:00
echo "usage: $0 <pakfile> ..."
exit 1
fi
for pakfile in $*; do
2000-09-29 16:19:15 +00:00
if [ ! -f ${pakfile} ]; then echo ${pakfile} not found; continue; fi
[ "${pakfile#/}" = "${pakfile}" ] && pakfile=`pwd`/${pakfile}
tmp=/var/tmp/zpak.$$
mkdir ${tmp}
cd ${tmp}
pak vxf ${pakfile} | sed -e 's/$/.gz/' > pakfile.lst
mv ${pakfile} ${pakfile}.bak
gzip -rv9 *
pak vcf ${pakfile} `zcat pakfile.lst.gz`
cd -
rm -rf ${tmp}
done