1999-06-06 00:17:38 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2000-10-05 04:11:43 +04:00
|
|
|
# $NetBSD: makeobsolete,v 1.5 2000/10/05 00:11:44 tv 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 ...]
|
|
|
|
#
|
|
|
|
|
|
|
|
# set defaults
|
|
|
|
: ${MAKE=make}
|
|
|
|
machine=${MACHINE:-`printf 'xxx:\n\techo ${MACHINE}' | $MAKE -s -f-`}
|
|
|
|
arch=${MACHINE_ARCH:-`printf 'xxx:\n\techo ${MACHINE_ARCH}' | $MAKE -s -f-`}
|
|
|
|
setd=`pwd`
|
|
|
|
nlists="base comp etc games man misc secr text"
|
2000-10-02 02:49:05 +04:00
|
|
|
xlists="xbase xcomp xcontrib xfont xserver xmisc"
|
1999-06-06 00:17:38 +04:00
|
|
|
lists=$nlists
|
|
|
|
target=./dist
|
|
|
|
|
|
|
|
# handle args
|
|
|
|
while : ; do
|
|
|
|
case $1 in
|
|
|
|
-b*)
|
|
|
|
lists="$xlists $nlists"
|
|
|
|
;;
|
|
|
|
-x*)
|
|
|
|
lists=$xlists;;
|
|
|
|
-a*)
|
|
|
|
arch=$2; shift
|
|
|
|
;;
|
|
|
|
-m*)
|
|
|
|
machine=$2; shift
|
|
|
|
;;
|
|
|
|
-s*)
|
|
|
|
setd=$2; shift
|
|
|
|
;;
|
|
|
|
-t*)
|
|
|
|
target=$2;shift
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
cat 1>&2 <<USAGE
|
|
|
|
Usage: $0 [-a arch] [-m machine] [-s setsdir] [setname ...]
|
|
|
|
-b make netbsd + x11 lists
|
|
|
|
-x only make x11 lists
|
|
|
|
-a arch set arch (e.g, m68k, mips, powerpc) [$arch]
|
|
|
|
-m machine set machine (e.g, amiga, i386, macppc) [$machine]
|
|
|
|
-s setsdir directory to find sets [$setd]
|
|
|
|
-t target target directory [$target]
|
|
|
|
[setname ...] sets to build
|
|
|
|
USAGE
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
lists="$*"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Convert mipse[lb] to mips after processing command line arguments.
|
|
|
|
arch=`echo $arch | sed s,^mipse.,mips,`
|
|
|
|
|
|
|
|
if [ ! -d $target ] ; then
|
|
|
|
echo "target directory [$target] doesn't exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for setname in $lists; do
|
|
|
|
file=$target/${setname}_obsolete
|
|
|
|
(
|
|
|
|
if [ -f $setd/lists/$setname/obsolete.mi ]; then
|
2000-01-23 23:31:17 +03:00
|
|
|
awk -- '{print $1}' $setd/lists/$setname/obsolete.mi
|
1999-06-06 00:17:38 +04:00
|
|
|
fi
|
|
|
|
if [ "$machine" != "$cpu" -a \
|
|
|
|
-f $setd/lists/$setname/obsolete.${arch} ]; then
|
2000-01-23 23:31:17 +03:00
|
|
|
awk -- '{print $1}' $setd/lists/$setname/obsolete.${arch}
|
1999-06-06 00:17:38 +04:00
|
|
|
fi
|
|
|
|
if [ -f $setd/lists/$setname/obsolete.${machine} ]; then
|
2000-01-23 23:31:17 +03:00
|
|
|
awk -- '{print $1}' $setd/lists/$setname/obsolete.${machine}
|
1999-06-06 00:17:38 +04:00
|
|
|
fi) | egrep -v '^#' | sort -u > $file
|
|
|
|
if [ ! -s $file ] ; then
|
|
|
|
rm $file
|
|
|
|
fi
|
|
|
|
|
|
|
|
done | egrep -v '^#' | sort -u
|