release.sh: restore -jJAILDIR option
[minix.git] / distrib / sets / makeflist
blob691f90ddf95a64a0dc39a0627439acd9a7b4ecc6
1 #!/bin/sh
3 # $NetBSD: makeflist,v 1.76 2009/12/05 15:56:25 cegger Exp $
5 # Print out the files in some or all lists.
6 # Usage: makeflist [-bxlo] [-a arch] [-m machine] [-s setsdir] [setname ...]
9 rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/"
10 . "${rundir}/sets.subr"
11 lists=
13 usage()
15 cat 1>&2 <<USAGE
16 Usage: ${0##*/} [-L base,x,ext] [-bxyo] [-a arch] [-m machine] [-s setsdir] [setname [...]]
17 -L base,x,ext print specified lists
18 -b print netbsd + x11 lists
19 -x print make x11 lists
20 -y print make extsrc lists
21 -l just list the selected set names, not the contents
22 -o only match obsolete files
23 -a arch set arch (e.g, m68k, mipseb, mipsel, powerpc) [${MACHINE_ARCH}]
24 -m machine set machine (e.g, amiga, i386, macppc) [${MACHINE}]
25 -s setsdir directory to find sets [${setsdir}]
26 [setname [...]] sets to build [${lists}]
27 USAGE
28 exit 1
31 # handle args
32 while getopts L:bxXloa:m:s: ch; do
33 case ${ch} in
35 save_IFS="${IFS}"
36 IFS=,
37 for _list in ${OPTARG}; do
38 case $_list in
39 base) lists="${lists} ${nlists}" ;;
40 x) lists="${lists} ${xlists}" ;;
41 ext) lists="${lists} ${extlists}" ;;
42 esac
43 done
44 IFS="${save_IFS}"
46 # backward compat
48 lists="${nlists} ${xlists}"
51 lists="${xlists}"
54 lists="${extlists}"
57 listonly=1
60 obsolete=1
63 MACHINE_ARCH="${OPTARG}"
64 MACHINE_CPU="$(arch_to_cpu "${OPTARG}")"
67 MACHINE="${OPTARG}"
70 setsdir="${OPTARG}"
73 usage
75 esac
76 done
77 shift $((${OPTIND} - 1))
78 if [ -n "$1" ]; then
79 lists="$*"
82 if [ -n "${listonly}" ]; then
83 echo ${lists} | tr ' ' '\n'
84 exit 0
87 list_set_files ${lists:-${nlists}} | ${AWK} '{print $1}' | ${SORT} -u