No empty .Rs/.Re
[netbsd-mini2440.git] / distrib / sets / makeobsolete
blob4fd65303201e8c0282a0361511e152aa15442754
1 #!/bin/sh
3 # $NetBSD: makeobsolete,v 1.30 2009/11/30 16:13:23 uebayasi Exp $
5 # Print out the obsolete files for a set
6 # Usage: makeobsolete [-b] [-x] [-a arch] [-m machine] [-s setsdir] \
7 # [-t target] [setname ...]
10 rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/"
11 . "${rundir}/sets.subr"
12 lists=
13 target=./dist
14 obsolete=1
16 usage()
18 cat 1>&2 <<USAGE
19 Usage: ${0##*/} [-a arch] [-m machine] [-s setsdir] [setname ...]
20 -L base,x,ext make specified lists
21 -b make netbsd + x11 lists
22 -x only make x11 lists
23 -y only make extsrc lists
24 -a arch set arch (e.g, m68k, mips, powerpc) [${MACHINE_ARCH}]
25 -m machine set machine (e.g, amiga, i386, macppc) [${MACHINE}]
26 -s setsdir directory to find sets [${setd}]
27 -t target target directory [${target}]
28 [setname ...] sets to build
29 USAGE
30 exit 1
33 while getopts L:bxya:m:s:t: ch; do
34 case ${ch} in
36 save_IFS="${IFS}"
37 IFS=,
38 for _list in ${OPTARG}; do
39 case $_list in
40 base) lists="${lists} ${nlists}" ;;
41 x) lists="${lists} ${xlists}" ;;
42 ext) lists="${lists} ${extlists}" ;;
43 esac
44 done
45 IFS="${save_IFS}"
47 # backward compat
49 lists="${nlists} ${xlists}"
52 lists="${xlists}"
55 lists="${extlists}"
58 MACHINE_ARCH="${OPTARG}"
59 MACHINE_CPU="$(arch_to_cpu "${OPTARG}")"
62 MACHINE="${OPTARG}"
65 setsdir="${OPTARG}"
68 target="${OPTARG}"
71 usage
73 esac
74 done
75 shift $((${OPTIND} - 1))
76 if [ -n "$1" ]; then
77 lists="$*"
80 if [ ! -d "${target}" ]; then
81 echo "target directory [${target}] doesn't exist"
82 exit 1
85 for setname in ${lists:-${nlists}}; do
86 file="${target}/${setname}"
87 list_set_files "${setname}" | ${AWK} '{print $1}' | \
88 ${SORT} -ru > "${file}"
89 done