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