]> git.pld-linux.org Git - projects/cleanbuild.git/blobdiff - addbr
_binary_payload w1.gzdio
[projects/cleanbuild.git] / addbr
diff --git a/addbr b/addbr
index 63ca2059ee764cbe217bb6f70c61206b84b66a0d..6ab3dd4166ad2a45a29c4ab5fcb73cf1b900fc33 100755 (executable)
--- a/addbr
+++ b/addbr
@@ -5,7 +5,7 @@ use warnings;
 
 my $fname = shift @ARGV or die;
 my $add = shift @ARGV or die;
-my $msg = shift @ARGV or die;
+my $msg = shift @ARGV || "requested";
 
 $SIG{__WARN__} = sub
 {
@@ -16,19 +16,21 @@ $SIG{__WARN__} = sub
 
 warn "Adding: $add\n";
 
-my $file = "$ENV{HOME}/rpm/packages/$fname/$fname.spec";
--r $file or die;
+my $file = $fname;
+$file = "$ENV{HOME}/rpm/packages/$fname/$fname.spec"
+       unless -r $file;
+-r $file or die "Can't read $file";
 
 open FILE, "<", $file;
 my @in = <FILE>;
 close FILE;
 
-my $brm = qr/#?(?:%{!?\?with_\S+:)?\s*BuildRequires:\s*(\S+)\s*(?:(>|>=|==|<=|<).*)?}?/i;
+my $brm = qr/#?(?:%\{!?\?with_\S+:)?\s*BuildRequires:\s*(\S+)\s*(?:(>|>=|==|<=|<).*)?\}?/i;
 foreach ( @in ) {
        if ( /^$brm$/o ) {
                if ( $1 eq $add ) {
                        warn "$add already on the list\n";
-                       exit;
+                       exit(1);
                }
        }
 
@@ -36,7 +38,7 @@ foreach ( @in ) {
 
 my @out;
 while ( $_ = shift @in ) {
-       if ( /^\s*(build(requires|root|conflicts)|requires(\(.*\))?|provides|conflicts|obsoletes):/i ) {
+       if ( /^\s*(build(requires|root|conflicts|arch)|requires(\(.*\))?|provides|conflicts|obsoletes|excludearch):/i ) {
                unshift @in, $_;
                last;
        }
This page took 0.082465 seconds and 4 git commands to generate.