diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-08-25 02:40:57 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-08-25 02:40:57 +0000 |
commit | 5f65d578e0d61f6431acae61bb4290d2bb6ec39a (patch) | |
tree | 96e53707345902252ccb6eb5561659418da82275 /rpm-find-leaves | |
parent | f7547c9e152486334b417e69337782389d372c4f (diff) | |
download | urpmi-5f65d578e0d61f6431acae61bb4290d2bb6ec39a.tar urpmi-5f65d578e0d61f6431acae61bb4290d2bb6ec39a.tar.gz urpmi-5f65d578e0d61f6431acae61bb4290d2bb6ec39a.tar.bz2 urpmi-5f65d578e0d61f6431acae61bb4290d2bb6ec39a.tar.xz urpmi-5f65d578e0d61f6431acae61bb4290d2bb6ec39a.zip |
Add a --root option (by Michael Scherer)
Diffstat (limited to 'rpm-find-leaves')
-rw-r--r-- | rpm-find-leaves | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves index 894003b9..58787184 100644 --- a/rpm-find-leaves +++ b/rpm-find-leaves @@ -7,10 +7,12 @@ sub main { my %options; $options{restrict_group} = 0; $options{group} = 'System/Libraries'; + $options{root} = ''; my $usage = N("usage: %s [options] where [options] are from ", $0) . N(" -h|--help - print this help message. +") . N(" --root <path> - use the given root instead of / ") . N(" -g [group] - restrict results to given group. ") . N(" defaults is %s. ", $options{group}); @@ -18,6 +20,12 @@ where [options] are from my $group; while ($_ = shift @_) { + /^--root$/ and do { + $root=shift @_; + $root and $options{root}=$root; + next; + + }; /^-g$/ and do { $options{restrict_group}=1; $group=shift @_; @@ -30,7 +38,7 @@ where [options] are from my @packages; { - my $db = URPM::DB::open or die; + my $db = URPM::DB::open($options{root}) or die; $db->traverse(sub { my ($p) = @_; $p->pack_header; |