aboutsummaryrefslogtreecommitdiffstats
path: root/rpmbuildupdate
diff options
context:
space:
mode:
authorMichael Scherer <misc@mandriva.com>2005-12-12 15:50:01 +0000
committerMichael Scherer <misc@mandriva.com>2005-12-12 15:50:01 +0000
commitae2f711331cbbb7f441e485b2b6e75155dc90b61 (patch)
tree5cac4e65f4eda0a8e897964af4d4d1034015a588 /rpmbuildupdate
parent9bcddc61e64e7c119c4497895bec3af4db049bc1 (diff)
downloadbootsplash-ae2f711331cbbb7f441e485b2b6e75155dc90b61.tar
bootsplash-ae2f711331cbbb7f441e485b2b6e75155dc90b61.tar.gz
bootsplash-ae2f711331cbbb7f441e485b2b6e75155dc90b61.tar.bz2
bootsplash-ae2f711331cbbb7f441e485b2b6e75155dc90b61.tar.xz
bootsplash-ae2f711331cbbb7f441e485b2b6e75155dc90b61.zip
- fix bug when the source use a %{url} tag, like udev.spec ( 1.136 ), thanks blino
Diffstat (limited to 'rpmbuildupdate')
-rwxr-xr-xrpmbuildupdate22
1 files changed, 13 insertions, 9 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate
index 86312b1..ac7f7fd 100755
--- a/rpmbuildupdate
+++ b/rpmbuildupdate
@@ -269,21 +269,25 @@ sub build {
$spec .= $_;
- if (/^Source[0-9]*:\s+(\S+)/i) {
+
+ # For %vars !
+ $specvars{$1} = $2 if /\%define\s+(\S+?)\s+(\S+)/g;
+ foreach my $i ('url', 'name', 'version', 'release', 'epoch') {
+ $specvars{$i} = $1 if !$specvars{$i} && /\b$i\s*:\s+(\S+)/gi;
+ }
+
+ if (/^Source[0-9]*:\s+(\S+)/i) {
my $source = $1;
- if ($source =~ /(?:ftp|svns?|https?):\/\/\S+/) {
+ # TODO could it be done cleanly with RPM4::expand ?
+ $source =~ s/\%url/$specvars{'url'}/;
+ $source =~ s/\%{url}/$specvars{'url'}/;
+ if ($source =~ /(?:ftp|svns?|https?):\/\/\S+/) {
push(@url, $source);
} else {
$tar_ball= $source unless $tar_ball;
};
}
-
- # For %vars !
- $specvars{$1} = $2 if /\%define\s+(\S+?)\s+(\S+)/g;
- foreach my $i ('url', 'name', 'version', 'release', 'epoch') {
- $specvars{$i} = $1 if !$specvars{$i} && /\b$i\s*:\s+(\S+)/gi;
- }
-
+
if (/^\%changelog/) {
$message =~ s/\%\%VERSION/$newversion/;
my @l = getpwuid($<);