diff options
Diffstat (limited to 'pkgtools/revbump/files/finddepends')
-rw-r--r-- | pkgtools/revbump/files/finddepends | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pkgtools/revbump/files/finddepends b/pkgtools/revbump/files/finddepends index bae857ffda5..7167a8bb7df 100644 --- a/pkgtools/revbump/files/finddepends +++ b/pkgtools/revbump/files/finddepends @@ -1,6 +1,6 @@ #!@PERL@ -w # -# $NetBSD: finddepends,v 1.1 2006/03/05 23:35:49 wiz Exp $ +# $NetBSD: finddepends,v 1.2 2006/03/07 04:30:54 wiz Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # @@ -34,19 +34,31 @@ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +use strict; +use Getopt::Std; + +my ($PKGSRCDIR, $arg, $bl3, %bl3content, @bl3files, @bl3result, + $content, $found, $key, $makefile, @makefiles, %opt, + $pattern, @searchlist); + $PKGSRCDIR = $ENV{PKGSRCDIR}; if (! $PKGSRCDIR) { $PKGSRCDIR = "/usr/pkgsrc"; } sub usage { - print STDERR "usage: finddepends package\n\n"; + print STDERR "usage: finddepends [-h] [-p pkgsrcdir] package\n\n"; print STDERR "Find all packages that depend on the argument package.\n"; exit 0; } -usage if (1 ne @ARGV); +getopts('hp:', \%opt); +usage() if $opt{h}; +if ($opt{p}) { + $PKGSRCDIR = $opt{p}; +} +usage if (1 ne @ARGV); $arg = shift; @searchlist = (); |