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