makeobsolete revision 1.22
1#!/bin/sh 2# 3# $NetBSD: makeobsolete,v 1.22 2003/12/29 03:13:25 lukem Exp $ 4# 5# Print out the obsolete files for a set 6# Usage: makeobsolete [-b] [-x] [-a arch] [-m machine] [-s setsdir] \ 7# [-t target] [setname ...] 8# 9 10. $(dirname $0)/sets.subr 11lists=$nlists 12target=./dist 13obsolete=1 14 15usage() 16{ 17 cat 1>&2 <<USAGE 18Usage: ${0##*/} [-a arch] [-m machine] [-s setsdir] [setname ...] 19 -b make netbsd + x11 lists 20 -x only make x11 lists 21 -a arch set arch (e.g, m68k, mips, powerpc) [$machine_arch] 22 -m machine set machine (e.g, amiga, i386, macppc) [$machine] 23 -s setsdir directory to find sets [$setd] 24 -t target target directory [$target] 25 [setname ...] sets to build 26USAGE 27 exit 1 28} 29 30while getopts bxa:m:s:t: ch; do 31 case ${ch} in 32 b) 33 lists="$xlists $nlists" 34 ;; 35 x) 36 lists="$xlists" 37 ;; 38 a) 39 machine_arch=${OPTARG} 40 machine_cpu=$(arch_to_cpu ${OPTARG}) 41 ;; 42 m) 43 machine=${OPTARG} 44 ;; 45 s) 46 setsdir=${OPTARG} 47 ;; 48 t) 49 target=${OPTARG} 50 ;; 51 *) 52 usage 53 ;; 54 esac 55done 56shift $((${OPTIND} - 1)) 57if [ -n "$1" ]; then 58 lists="$*" 59fi 60 61if [ ! -d $target ] ; then 62 echo "target directory [$target] doesn't exist" 63 exit 1 64fi 65 66for setname in $lists; do 67 file=$target/${setname} 68 list_set_files $setname | awk '{print $1}' | sort -ru > $file 69 if [ ! -s $file ] ; then 70 rm $file 71 fi 72done 73