Home | History | Annotate | Line # | Download | only in sets
listpkgs revision 1.9
      1  1.1   jwise #!/bin/sh
      2  1.1   jwise #
      3  1.9     erh # $NetBSD: listpkgs,v 1.9 2004/07/23 15:11:26 erh Exp $
      4  1.2   lukem #
      5  1.2   lukem # List all packages in the given pkgset by parsing the list files.
      6  1.1   jwise #
      7  1.1   jwise 
      8  1.9     erh rundir=${0%/*}
      9  1.9     erh . ${rundir}/sets.subr
     10  1.6  dyoung 
     11  1.1   jwise prefix=/
     12  1.1   jwise 
     13  1.7   lukem usage()
     14  1.7   lukem {
     15  1.7   lukem 	cat 1>&2 <<USAGE
     16  1.7   lukem Usage: ${0##*/} [-a arch] [-m machine] [-s setsdir] [-p prefix] setname
     17  1.8   lukem 	-a arch		set arch (e.g, m68k, mips, powerpc)	[$MACHINE_ARCH]
     18  1.8   lukem 	-m machine	set machine (e.g, amiga, i386, macppc)	[$MACHINE]
     19  1.7   lukem 	-s setsdir	directory to find sets			[$setsdir]
     20  1.7   lukem 	setname set to list packages for
     21  1.7   lukem USAGE
     22  1.7   lukem 	exit 1
     23  1.1   jwise }
     24  1.1   jwise 
     25  1.1   jwise # handle args
     26  1.7   lukem while getopts a:m:s: ch; do
     27  1.7   lukem 	case ${ch} in
     28  1.7   lukem 	a)
     29  1.8   lukem 		MACHINE_ARCH=${OPTARG}
     30  1.8   lukem 		MACHINE_CPU=$(arch_to_cpu ${OPTARG})
     31  1.1   jwise 		;;
     32  1.7   lukem 	m)
     33  1.8   lukem 		MACHINE=${OPTARG}
     34  1.1   jwise 		;;
     35  1.7   lukem 	s)
     36  1.7   lukem 		setsdir=${OPTARG}
     37  1.1   jwise 		;;
     38  1.7   lukem 	*)
     39  1.1   jwise 		usage
     40  1.1   jwise 		;;
     41  1.1   jwise 	esac
     42  1.1   jwise done
     43  1.7   lukem shift $((${OPTIND} - 1))
     44  1.7   lukem if [ $# -ne 1 ]; then
     45  1.1   jwise 	usage
     46  1.1   jwise fi
     47  1.7   lukem setname="$1"
     48  1.1   jwise 
     49  1.7   lukem list_set_files $setname | awk '{print $2}' | sort -u
     50