1999-06-06 00:17:38 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2006-01-03 21:31:09 +03:00
|
|
|
# $NetBSD: makeobsolete,v 1.27 2006/01/03 18:31:09 apb Exp $
|
1999-06-06 00:17:38 +04:00
|
|
|
#
|
|
|
|
# Print out the obsolete files for a set
|
|
|
|
# Usage: makeobsolete [-b] [-x] [-a arch] [-m machine] [-s setsdir] \
|
|
|
|
# [-t target] [setname ...]
|
|
|
|
#
|
|
|
|
|
2006-01-03 21:31:09 +03:00
|
|
|
rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/"
|
|
|
|
. "${rundir}/sets.subr"
|
|
|
|
lists="${nlists}"
|
1999-06-06 00:17:38 +04:00
|
|
|
target=./dist
|
2003-12-29 06:13:25 +03:00
|
|
|
obsolete=1
|
1999-06-06 00:17:38 +04:00
|
|
|
|
2003-12-29 06:13:25 +03:00
|
|
|
usage()
|
|
|
|
{
|
|
|
|
cat 1>&2 <<USAGE
|
|
|
|
Usage: ${0##*/} [-a arch] [-m machine] [-s setsdir] [setname ...]
|
1999-06-06 00:17:38 +04:00
|
|
|
-b make netbsd + x11 lists
|
|
|
|
-x only make x11 lists
|
2006-01-03 21:31:09 +03:00
|
|
|
-a arch set arch (e.g, m68k, mips, powerpc) [${MACHINE_ARCH}]
|
|
|
|
-m machine set machine (e.g, amiga, i386, macppc) [${MACHINE}]
|
|
|
|
-s setsdir directory to find sets [${setd}]
|
|
|
|
-t target target directory [${target}]
|
1999-06-06 00:17:38 +04:00
|
|
|
[setname ...] sets to build
|
|
|
|
USAGE
|
2003-12-29 06:13:25 +03:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
while getopts bxa:m:s:t: ch; do
|
|
|
|
case ${ch} in
|
|
|
|
b)
|
2006-01-03 21:31:09 +03:00
|
|
|
lists="${xlists} ${nlists}"
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
x)
|
2006-01-03 21:31:09 +03:00
|
|
|
lists="${xlists}"
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
a)
|
2006-01-03 21:31:09 +03:00
|
|
|
MACHINE_ARCH="${OPTARG}"
|
|
|
|
MACHINE_CPU="$(arch_to_cpu "${OPTARG}")"
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
m)
|
2006-01-03 21:31:09 +03:00
|
|
|
MACHINE="${OPTARG}"
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
s)
|
2006-01-03 21:31:09 +03:00
|
|
|
setsdir="${OPTARG}"
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
t)
|
2006-01-03 21:31:09 +03:00
|
|
|
target="${OPTARG}"
|
1999-06-06 00:17:38 +04:00
|
|
|
;;
|
|
|
|
*)
|
2003-12-29 06:13:25 +03:00
|
|
|
usage
|
1999-06-06 00:17:38 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2003-12-29 06:13:25 +03:00
|
|
|
shift $((${OPTIND} - 1))
|
1999-06-06 00:17:38 +04:00
|
|
|
if [ -n "$1" ]; then
|
|
|
|
lists="$*"
|
|
|
|
fi
|
|
|
|
|
2006-01-03 21:31:09 +03:00
|
|
|
if [ ! -d "${target}" ] ; then
|
|
|
|
echo "target directory [${target}] doesn't exist"
|
1999-06-06 00:17:38 +04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-01-03 21:31:09 +03:00
|
|
|
for setname in ${lists}; do
|
|
|
|
file="${target}/${setname}"
|
|
|
|
list_set_files "${setname}" | ${AWK} '{print $1}' | \
|
|
|
|
${SORT} -ru > ${file}
|
2002-11-17 05:59:56 +03:00
|
|
|
done
|