Support the <SPEC_REL> macro. This allows user values in the Release to be combined...
authorDavid Greaves <david@dgreaves.com>
Fri, 21 Jan 2011 15:36:11 +0000 (15:36 +0000)
committerMartin Mohring <martin.mohring@5edatasoft.com>
Fri, 28 Jan 2011 17:16:55 +0000 (18:16 +0100)
Signed-off-by: Martin Mohring <martin.mohring@5edatasoft.com>
substitutedeps

index bf9815b..32d1338 100755 (executable)
@@ -113,7 +113,8 @@ for my $line (@$xspec) {
     }
   }
 
-  if ($line =~ /^Release:/i) {
+  if ($line =~ /^Release:(.*)\s*$/i) {
+    my $spec_rel = $1; # User-provided value
     my $oldl = $line;
     if (defined $release) {
       if (!($line =~ s/<RELEASE\d*>/$release/g)) {
@@ -132,11 +133,13 @@ for my $line (@$xspec) {
          $line =~ s/^(Release:\s*).*/$1$release/i;
        }
       }
+      $line =~ s/<SPEC_REL>/$spec_rel/;
     } else {
       # remove macros, as rpm doesn't like them
       $line =~ s/<RELEASE\d*>/0/;
       $line =~ s/<CI_CNT>/0/;
       $line =~ s/<B_CNT>/0/;
+      $line =~ s/<SPEC_REL>/0/;
     }
     # this is to be compatible to legacy autobuild.
     # you can specify a releaseprg in the project configuration,