Home | History | Annotate | Line # | Download | only in sets
makeflist revision 1.70
      1 #!/bin/sh
      2 #
      3 # $NetBSD: makeflist,v 1.70 2004/01/08 01:15:25 lukem Exp $
      4 #
      5 # Print out the files in some or all lists.
      6 # Usage: makeflist [-bxlo] [-a arch] [-m machine] [-s setsdir] [setname ...]
      7 #
      8 
      9 . ./sets.subr
     10 lists=$nlists
     11 
     12 usage()
     13 {
     14 	cat 1>&2 <<USAGE
     15 Usage: ${0##*/} [-bxlo] [-a arch] [-m machine] [-s setsdir] [setname [...]]
     16 	-b		print netbsd + x11 lists
     17 	-x		print make x11 lists
     18 	-l		just list the selected set names, not the contents
     19 	-o		only match obsolete files
     20 	-a arch		set arch (e.g, m68k, mipseb, mipsel, powerpc) [$MACHINE_ARCH]
     21 	-m machine	set machine (e.g, amiga, i386, macppc) [$MACHINE]
     22 	-s setsdir	directory to find sets [$setsdir]
     23 	[setname [...]]	sets to build [$lists]
     24 USAGE
     25 	exit 1
     26 }
     27 
     28 # handle args
     29 while getopts bxloa:m:s: ch; do
     30 	case ${ch} in
     31 	b)
     32 		lists="$nlists $xlists"
     33 		;;
     34 	x)
     35 		lists="$xlists"
     36 		;;
     37 	l)
     38 		listonly=1
     39 		;;
     40 	o)
     41 		obsolete=1
     42 		;;
     43 	a)
     44 		MACHINE_ARCH=${OPTARG}
     45 		MACHINE_CPU=$(arch_to_cpu ${OPTARG})
     46 		;;
     47 	m)
     48 		MACHINE=${OPTARG}
     49 		;;
     50 	s)
     51 		setsdir=${OPTARG}
     52 		;;
     53 	*)
     54 		usage
     55 		;;
     56 	esac
     57 done
     58 shift $((${OPTIND} - 1))
     59 if [ -n "$1" ]; then
     60 	lists="$@"
     61 fi
     62 
     63 if [ -n "$listonly" ]; then
     64 	echo ${lists} | tr ' ' '\n'
     65 	exit 0
     66 fi
     67 
     68 list_set_files $lists | awk '{print $1}' | sort -u
     69