1999-06-06 00:17:38 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-07-23 19:11:26 +04:00
|
|
|
# $NetBSD: makeobsolete,v 1.24 2004/07/23 15:11:26 erh 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 ...]
|
|
|
|
#
|
|
|
|
|
2004-07-23 19:11:26 +04:00
|
|
|
. ${0%/*}/sets.subr
|
2003-12-29 06:13:25 +03:00
|
|
|
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
|
2004-01-03 05:38:58 +03:00
|
|
|
-a arch set arch (e.g, m68k, mips, powerpc) [$MACHINE_ARCH]
|
|
|
|
-m machine set machine (e.g, amiga, i386, macppc) [$MACHINE]
|
1999-06-06 00:17:38 +04:00
|
|
|
-s setsdir directory to find sets [$setd]
|
|
|
|
-t target target directory [$target]
|
|
|
|
[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)
|
|
|
|
lists="$xlists $nlists"
|
|
|
|
;;
|
|
|
|
x)
|
|
|
|
lists="$xlists"
|
|
|
|
;;
|
|
|
|
a)
|
2004-01-03 05:38:58 +03:00
|
|
|
MACHINE_ARCH=${OPTARG}
|
|
|
|
MACHINE_CPU=$(arch_to_cpu ${OPTARG})
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
m)
|
2004-01-03 05:38:58 +03:00
|
|
|
MACHINE=${OPTARG}
|
2003-12-29 06:13:25 +03:00
|
|
|
;;
|
|
|
|
s)
|
|
|
|
setsdir=${OPTARG}
|
|
|
|
;;
|
|
|
|
t)
|
|
|
|
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
|
|
|
|
|
|
|
|
if [ ! -d $target ] ; then
|
2002-11-17 06:04:53 +03:00
|
|
|
echo "target directory [$target] doesn't exist"
|
1999-06-06 00:17:38 +04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for setname in $lists; do
|
2003-02-20 14:40:28 +03:00
|
|
|
file=$target/${setname}
|
2003-12-29 06:13:25 +03:00
|
|
|
list_set_files $setname | awk '{print $1}' | sort -ru > $file
|
1999-06-06 00:17:38 +04:00
|
|
|
if [ ! -s $file ] ; then
|
|
|
|
rm $file
|
|
|
|
fi
|
2002-11-17 05:59:56 +03:00
|
|
|
done
|