summaryrefslogtreecommitdiffstats
path: root/bin/getpkgtree
blob: dd2517cc9a02c221d9de954023d3e56bd89cf4ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

prog=getpkgtree

if [ "$#" -ne 2 ]
then
	echo "usage: $prog [file] [section]"
	exit 2
fi

if ! [ -d "$1" ]
then
	echo "$prog: package file does not exist: $1" 1>&2
	exit 101
fi
if ! [ -d "$1/$2" ]
then
	echo "$prog: section does not exist: $2" 1>&2
	exit 102
fi

find "$1/$2" -maxdepth 1 -type f | sort | xargs cat