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