Home | History | Annotate | Line # | Download | only in sets
maketars revision 1.13.10.3
      1        1.2      gwr #!/bin/sh
      2        1.2      gwr #
      3  1.13.10.3       he # $NetBSD: maketars,v 1.13.10.3 2002/02/26 20:07:40 he Exp $
      4        1.2      gwr #
      5        1.2      gwr # Make release tar files for some or all lists.  Usage:
      6        1.9    lukem # maketars [-b] [-x] [-a arch] [-m machine] [-s setsdir] [-d destdir] \
      7        1.9    lukem #	[-t tardir] [setname ...]
      8        1.2      gwr #
      9        1.2      gwr 
     10        1.2      gwr # set defaults
     11       1.13    itohy : ${MAKE=make}
     12       1.13    itohy machine=${MACHINE:-`printf 'xxx:\n\techo ${MACHINE}' | $MAKE -s -f-`}
     13       1.13    itohy arch=${MACHINE_ARCH:-`printf 'xxx:\n\techo ${MACHINE_ARCH}' | $MAKE -s -f-`}
     14        1.2      gwr setd=`pwd`
     15        1.9    lukem nlists="base comp etc games man misc text"
     16  1.13.10.1       tv xlists="xbase xcomp xcontrib xfont xserver xmisc"
     17        1.9    lukem lists=$nlists
     18        1.2      gwr tars=$RELEASEDIR
     19        1.2      gwr dest=$DESTDIR
     20        1.2      gwr 
     21        1.2      gwr # handle args
     22        1.9    lukem while : ; do
     23        1.2      gwr 	case $1 in
     24        1.9    lukem 	-b*)
     25        1.9    lukem 		lists="$xlists $nlists"
     26        1.9    lukem 		;;
     27        1.9    lukem 	-x*)	
     28        1.9    lukem 		lists=$xlists
     29        1.9    lukem 		;;
     30        1.9    lukem 	-a*)
     31        1.9    lukem 		arch=$2; shift
     32        1.9    lukem 		;;
     33        1.9    lukem 	-m*)
     34        1.9    lukem 		machine=$2; shift
     35        1.9    lukem 		;;
     36        1.9    lukem 	-s*)
     37        1.9    lukem 		setd=$2; shift
     38        1.9    lukem 		;;
     39        1.9    lukem 	-d*)
     40        1.9    lukem 		dest=$2; shift
     41        1.9    lukem 		;;
     42        1.9    lukem 	-t*)	
     43        1.9    lukem 		tars=$2; shift
     44        1.9    lukem 		;;
     45        1.9    lukem 	-*)
     46        1.9    lukem 		cat 1>&2 <<USAGE
     47        1.9    lukem Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] 
     48        1.9    lukem 		[-d dest] [-t tars] [setname ...]
     49        1.9    lukem 	-b		make netbsd + x11 lists
     50        1.9    lukem 	-x		only make x11 lists
     51        1.9    lukem 	-a arch		set arch (e.g, m68k, mips, powerpc)	[$arch]
     52        1.9    lukem 	-m machine	set machine (e.g, amiga, i386, macppc)	[$machine]
     53        1.9    lukem 	-s setsdir	directory to find sets	[$setd]
     54        1.9    lukem 	-d dest		\$DESTDIR	[$dest]
     55        1.9    lukem 	-t tars		\$RELEASEDIR	[$tars]
     56        1.9    lukem 	[setname ...]	sets to build 	[$lists]
     57        1.9    lukem USAGE
     58        1.9    lukem 		exit 1
     59        1.9    lukem 		;;
     60        1.9    lukem 	*)
     61        1.9    lukem 		break
     62        1.9    lukem 		;;
     63        1.2      gwr 	esac
     64        1.2      gwr 	shift
     65        1.2      gwr done
     66       1.10     ross if [ -n "$*" ]; then
     67       1.10     ross 	lists="$*"
     68        1.9    lukem fi
     69        1.1      cgd 
     70        1.9    lukem if [ -z "$tars" ]; then
     71        1.9    lukem 	echo \$RELEASEDIR must be set
     72        1.1      cgd 	exit 1
     73        1.9    lukem fi
     74        1.1      cgd 
     75        1.9    lukem if [ -z "$dest" ]; then
     76        1.9    lukem 	echo \$DESTDIR must be set
     77        1.1      cgd 	exit 1
     78        1.9    lukem fi
     79        1.1      cgd 
     80  1.13.10.3       he 
     81  1.13.10.3       he es=0
     82        1.9    lukem for setname in $lists; do
     83       1.12  frueauf 	out=$setname.tgz
     84        1.2      gwr 	echo "making $out"
     85  1.13.10.2       he 	sh $setd/makeflist -a $arch -m $machine -s $setd $setname > ${dest}/tmp/flist
     86  1.13.10.2       he 	(cd $dest ; pax -w -d -z < ${dest}/tmp/flist) > ${tars}/$out
     87  1.13.10.3       he 	es=`expr $es + $?`
     88        1.2      gwr done
     89  1.13.10.3       he rm -f ${dest}/tmp/flist
     90  1.13.10.3       he exit $es