aboutsummaryrefslogtreecommitdiffstats
path: root/src-rpm-list
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-01-10 22:54:57 +0000
committerNicolas Vigier <boklm@mageia.org>2013-01-10 22:54:57 +0000
commit5ffd3bc2ee3279cc928be7544b49dfba91957eb4 (patch)
tree6bfd297d901e98f658ddc08bf9806a85044ac979 /src-rpm-list
parente670aa4c47f225f8801275ab08915035e70e8001 (diff)
downloadrelease-5ffd3bc2ee3279cc928be7544b49dfba91957eb4.tar
release-5ffd3bc2ee3279cc928be7544b49dfba91957eb4.tar.gz
release-5ffd3bc2ee3279cc928be7544b49dfba91957eb4.tar.bz2
release-5ffd3bc2ee3279cc928be7544b49dfba91957eb4.tar.xz
release-5ffd3bc2ee3279cc928be7544b49dfba91957eb4.zip
src-rpm-list: add skip list file as 2nd arg
Diffstat (limited to 'src-rpm-list')
-rwxr-xr-xsrc-rpm-list18
1 files changed, 17 insertions, 1 deletions
diff --git a/src-rpm-list b/src-rpm-list
index aa87a82..e5a8bf9 100755
--- a/src-rpm-list
+++ b/src-rpm-list
@@ -2,11 +2,15 @@
# This script takes a root SRPMS directory as argument, and print the
# list of package names on stdout
+# As second argument, it can optionally take a file containing a list
+# of packages (as regexp) to skip
use strict;
use URPM;
+use MDK::Common;
my $srpmsdir = $ARGV[0] or exit 1;
+my $skipfile = $ARGV[1];
my $urpm = URPM->new;
@@ -17,4 +21,16 @@ foreach (glob("$srpmsdir/*/*/media_info/synthesis.hdlist.cz")) {
my %res;
$urpm->traverse(sub { $res{$_[0]->name} = 1 });
-print join("\n", sort(keys %res), '')
+my @skip = $skipfile ? chomp_(cat_($skipfile)) : ();
+my @pkgs = grep {
+ my $res = 1;
+ foreach my $skipre (@skip) {
+ if ($_ =~ m/^$skipre$/) {
+ $res = 0;
+ last;
+ }
+ }
+ $res;
+ } (keys %res);
+
+print join("\n", sort @pkgs, '')