1996-05-20 23:10:28 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2001-11-24 06:08:27 +03:00
|
|
|
# $NetBSD: maketars,v 1.16 2001/11/24 03:08:27 thorpej Exp $
|
1996-05-20 23:10:28 +04:00
|
|
|
#
|
|
|
|
# Make release tar files for some or all lists. Usage:
|
1998-06-15 18:45:05 +04:00
|
|
|
# maketars [-b] [-x] [-a arch] [-m machine] [-s setsdir] [-d destdir] \
|
|
|
|
# [-t tardir] [setname ...]
|
1996-05-20 23:10:28 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
# set defaults
|
1999-02-13 10:59:45 +03:00
|
|
|
: ${MAKE=make}
|
2001-11-24 06:08:27 +03:00
|
|
|
machine=`${MAKE} print_machine`
|
|
|
|
machine_arch=`${MAKE} print_machine_arch`
|
1996-05-20 23:10:28 +04:00
|
|
|
setd=`pwd`
|
1998-06-15 18:45:05 +04:00
|
|
|
nlists="base comp etc games man misc text"
|
2000-10-02 02:49:05 +04:00
|
|
|
xlists="xbase xcomp xcontrib xfont xserver xmisc"
|
1998-06-15 18:45:05 +04:00
|
|
|
lists=$nlists
|
1996-05-20 23:10:28 +04:00
|
|
|
tars=$RELEASEDIR
|
|
|
|
dest=$DESTDIR
|
|
|
|
|
|
|
|
# handle args
|
1998-06-15 18:45:05 +04:00
|
|
|
while : ; do
|
1996-05-20 23:10:28 +04:00
|
|
|
case $1 in
|
1998-06-15 18:45:05 +04:00
|
|
|
-b*)
|
|
|
|
lists="$xlists $nlists"
|
|
|
|
;;
|
|
|
|
-x*)
|
|
|
|
lists=$xlists
|
|
|
|
;;
|
|
|
|
-a*)
|
2001-11-24 06:08:27 +03:00
|
|
|
machine_arch=$2; shift
|
1998-06-15 18:45:05 +04:00
|
|
|
;;
|
|
|
|
-m*)
|
|
|
|
machine=$2; shift
|
|
|
|
;;
|
|
|
|
-s*)
|
|
|
|
setd=$2; shift
|
|
|
|
;;
|
|
|
|
-d*)
|
|
|
|
dest=$2; shift
|
|
|
|
;;
|
|
|
|
-t*)
|
|
|
|
tars=$2; shift
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
cat 1>&2 <<USAGE
|
|
|
|
Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir]
|
|
|
|
[-d dest] [-t tars] [setname ...]
|
|
|
|
-b make netbsd + x11 lists
|
|
|
|
-x only make x11 lists
|
2001-11-24 06:08:27 +03:00
|
|
|
-a arch set arch (e.g, m68k, mipseb, mipsel, powerpc) [$machine_arch]
|
|
|
|
-m machine set machine (e.g, amiga, i386, macppc) [$machine]
|
|
|
|
-s setsdir directory to find sets [$setd]
|
1998-06-15 18:45:05 +04:00
|
|
|
-d dest \$DESTDIR [$dest]
|
|
|
|
-t tars \$RELEASEDIR [$tars]
|
|
|
|
[setname ...] sets to build [$lists]
|
|
|
|
USAGE
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
1996-05-20 23:10:28 +04:00
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
1998-06-27 12:27:36 +04:00
|
|
|
if [ -n "$*" ]; then
|
|
|
|
lists="$*"
|
1998-06-15 18:45:05 +04:00
|
|
|
fi
|
1996-05-20 23:10:28 +04:00
|
|
|
|
1998-06-15 18:45:05 +04:00
|
|
|
if [ -z "$tars" ]; then
|
|
|
|
echo \$RELEASEDIR must be set
|
1994-08-29 19:21:02 +04:00
|
|
|
exit 1
|
1998-06-15 18:45:05 +04:00
|
|
|
fi
|
1994-08-29 19:21:02 +04:00
|
|
|
|
1998-06-15 18:45:05 +04:00
|
|
|
if [ -z "$dest" ]; then
|
|
|
|
echo \$DESTDIR must be set
|
1994-08-29 19:21:02 +04:00
|
|
|
exit 1
|
1998-06-15 18:45:05 +04:00
|
|
|
fi
|
1996-05-20 23:10:28 +04:00
|
|
|
|
2001-01-22 10:03:44 +03:00
|
|
|
trap 'rm -f ${dest}/tmp/flist' 0
|
|
|
|
set -e
|
1998-06-15 18:45:05 +04:00
|
|
|
for setname in $lists; do
|
1998-12-03 21:17:45 +03:00
|
|
|
out=$setname.tgz
|
1996-05-20 23:10:28 +04:00
|
|
|
echo "making $out"
|
2001-11-24 06:08:27 +03:00
|
|
|
sh $setd/makeflist -a $machine_arch -m $machine -s $setd $setname > ${dest}/tmp/flist
|
2001-01-22 10:03:44 +03:00
|
|
|
(cd $dest ; pax -w -d -z < ${dest}/tmp/flist) > ${tars}/$out
|
1996-05-20 23:10:28 +04:00
|
|
|
done
|