mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 04:01:17 +00:00
23 lines
438 B
Text
23 lines
438 B
Text
|
#!/bin/bash
|
||
|
|
||
|
if [ $# -eq 0 ]; then
|
||
|
echo 'usage: $0 <pakfile> ...'
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
for pakfile in $*; do
|
||
|
[ -f ${pakfile} ] || echo ${pakfile} not found && continue
|
||
|
[ "${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
|