NetBSD/distrib/sets/maketars

54 lines
988 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: maketars,v 1.8 1997/11/27 11:05:25 jonathan Exp $
#
# Make release tar files for some or all lists. Usage:
# maketars [-arch arch] [-setd setsdir] [-dest destdir] \
# [-tars tardir] [-x11] [setname ...]
#
# set defaults
arch=${MACHINE:-`uname -m`}
setd=`pwd`
lists="base comp etc games man misc text"
xlists="xbase xcomp xcontrib xfont xserver"
tars=$RELEASEDIR
dest=$DESTDIR
# handle args
while :
do
case $1 in
-arch) arch=$2; shift;;
-setd) setd=$2; shift;;
-dest) dest=$2; shift;;
-tars) tars=$2; shift;;
-both) lists="$xlists $lists";;
-x11) lists=$xlists;;
-*) echo "bad option"; exit 1;;
*) break;;
esac
shift
done
[ "$@" ] && lists="$@"
[ "$tars" ] || {
echo RELEASEDIR must be set
exit 1
}
[ "$dest" ] || {
echo DESTDIR must be set
exit 1
}
set -x
for setname in $lists
do
out=$setname.tar.gz
echo "making $out"
sh $setd/makeflist -arch $arch -setd $setd $setname |
(cd $dest ; pax -w -d) |
gzip -9 > ${tars}/$setname.tgz
done