Home | History | Annotate | Line # | Download | only in sets
listpkgs revision 1.6
      1 #!/bin/sh
      2 #
      3 # $NetBSD: listpkgs,v 1.6 2003/11/25 07:19:46 dyoung Exp $
      4 #
      5 # List all packages in the given pkgset by parsing the list files.
      6 #
      7 
      8 # set defaults
      9 . ./sets.defaults
     10 
     11 setd=`dirname $0`
     12 prefix=/
     13 
     14 . ./sets.subr
     15 
     16 usage() {
     17 exec 1>&2
     18 
     19 echo "Usage: $0 [-a arch] [-m machine] [-s setsdir] [-p prefix] setname"
     20 echo "	-a arch		set arch (e.g, m68k, mips, powerpc)	[$machine_arch]"
     21 echo "	-m machine	set machine (e.g, amiga, i386, macppc)	[$machine]"
     22 echo "	-s setsdir	directory to find sets			[$setd]"
     23 echo "	setname set to list packages for"
     24 
     25 exit 1
     26 }
     27 
     28 # handle args
     29 while : ; do
     30 	case $1 in
     31 	-a*)
     32 		machine_arch=$2; shift
     33 		;;
     34 	-m*)
     35 		machine=$2; shift
     36 		;;
     37 	-s*)
     38 		setd=$2; shift
     39 		;;
     40 	-*)
     41 		usage
     42 		exit 1
     43 		;;
     44 	*)
     45 		break
     46 		;;
     47 	esac
     48 	shift
     49 done
     50 if [ -n "$1" ]; then
     51 	setname="$1"
     52 else
     53 	usage
     54 	exit 1
     55 fi
     56 
     57 # Convert mipse[lb] to mips after processing command line arguments.
     58 machine_arch=`echo $machine_arch | sed s,^mipse.,mips, | sed s,^sh3e.,sh3,`
     59 
     60 # Compute toolchain  used on target cpu.
     61 if [ "$machine_arch" = "mips" -o "$machine" = "alpha" -o "$machine_arch" = "powerpc" -o "$machine_arch" = "sparc" -o "$machine_arch" = "sparc64" -o "$machine_arch" = "i386" -o "$machine_arch" = "arm" -o "$machine" = "mvme68k" -o "$machine" = "hp300" ]; then
     62 	shlib=elf
     63 else
     64 	if [ "$machine_arch" = "sh3" ]; then
     65 		shlib=
     66 	else
     67 		shlib=aout
     68 	fi
     69 fi
     70 
     71 list_set_files $setname | awk -- '/^[^#]/ {print $2}' | sort -u
     72