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