bring forcebinary code in line with rpm by checking the SOURCEPACKAGE tag
authorMichael Schroeder <mls@suse.de>
Fri, 5 Oct 2012 13:14:02 +0000 (15:14 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 5 Oct 2012 13:15:17 +0000 (15:15 +0200)
Build/Rpm.pm

index caa339c..84d9ec6 100644 (file)
@@ -569,7 +569,7 @@ my %rpmstag = (
   "REQUIREVERSION" => 1050,
   "NOSOURCE"       => 1051,
   "NOPATCH"        => 1052,
-  "RPMVERSION"     => 1064,
+  "SOURCEPACKAGE"  => 1106,
   "PROVIDEFLAGS"   => 1112,
   "PROVIDEVERSION" => 1113,
   "DIRINDEXES"     => 1116,
@@ -722,11 +722,8 @@ sub rpmq {
       }
     }
   }
-  if ($forcebinary && $stags{1044} && !$res{$stags{1044}}) {
-    # don't force for rpm-5 rpms
-    if (!($stags{1064} && $res{$stags{1064}} && $res{$stags{1064}}->[0] =~ /^5/)) {
-      $res{$stags{1044}} = [ '(none)' ];       # like rpm does...
-    }
+  if ($forcebinary && $stags{1044} && !$res{$stags{1044}} && !($stags{1106} && $res{$stags{1106}})) {
+    $res{$stags{1044}} = [ '(none)' ]; # like rpm does...
   }
 
   if ($need_filenames) {
@@ -836,7 +833,7 @@ sub verscmp {
 sub query {
   my ($handle, %opts) = @_;
 
-  my @tags = qw{NAME SOURCERPM NOSOURCE NOPATCH SIGTAG_MD5 PROVIDENAME PROVIDEFLAGS PROVIDEVERSION REQUIRENAME REQUIREFLAGS REQUIREVERSION RPMVERSION};
+  my @tags = qw{NAME SOURCERPM NOSOURCE NOPATCH SIGTAG_MD5 PROVIDENAME PROVIDEFLAGS PROVIDEVERSION REQUIRENAME REQUIREFLAGS REQUIREVERSION SOURCEPACKAGE};
   push @tags, qw{EPOCH VERSION RELEASE ARCH};
   push @tags, qw{FILENAMES} if $opts{'filelist'};
   push @tags, qw{SUMMARY DESCRIPTION} if $opts{'description'};