aboutsummaryrefslogtreecommitdiffstats
path: root/rpmbuildupdate
diff options
context:
space:
mode:
authorMichael Scherer <misc@mandriva.com>2004-05-04 15:25:35 +0000
committerMichael Scherer <misc@mandriva.com>2004-05-04 15:25:35 +0000
commitdbf80d44035c9fff0d8302d57e04d018c28b74b5 (patch)
tree17d42cd07afd0d502fa2056f2c5835ff40559700 /rpmbuildupdate
parent7726114e1633e57feff7e6fa7fa77993ea26fc01 (diff)
downloadbootsplash-dbf80d44035c9fff0d8302d57e04d018c28b74b5.tar
bootsplash-dbf80d44035c9fff0d8302d57e04d018c28b74b5.tar.gz
bootsplash-dbf80d44035c9fff0d8302d57e04d018c28b74b5.tar.bz2
bootsplash-dbf80d44035c9fff0d8302d57e04d018c28b74b5.tar.xz
bootsplash-dbf80d44035c9fff0d8302d57e04d018c28b74b5.zip
- try to detect sources url with Url tag if Source not present
- some code factorisation
Diffstat (limited to 'rpmbuildupdate')
-rwxr-xr-xrpmbuildupdate16
1 files changed, 12 insertions, 4 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate
index b5de3c8..033a9ad 100755
--- a/rpmbuildupdate
+++ b/rpmbuildupdate
@@ -187,6 +187,8 @@ sub build
return;
}
+ my $tar_ball;
+
while(<SPECFILE>)
{
# Doing a s/// version
@@ -197,12 +199,15 @@ sub build
$spec =~ s/\%define(\s+)release(\s+)(.*)/\%define release $config{release}/;
$spec =~ s/Release\s*:(\s+)(\S*mdk)/Release:$1$config{release}/;
push(@url, $2) if(/(Source[0-9]*)\s*:\s+((?:ftp|svns?|https?):\S+)/i);
+ $tar_ball=$2 if(/(Source[0-9]*)\s*:\s+([^:\s]+)/i) and not $tar_ball;
# For %vars !
$specvars{$1} = $2 if(/\%define\s+(\S+?)\s+(\S+)/g);
- $specvars{version} = $1 if(!$specvars{version} && /Version\s*:\s+(\S+)/gi);
- $specvars{name} = $1 if(!$specvars{name} && /Name\s*:\s+(\S+)/gi);
-
+ for my $i ( 'url','name','version' )
+ {
+ $specvars{$i} = $1 if(!$specvars{$i} && /$i\s*:\s+(\S+)/gi);
+ }
+
if(/\%changelog/)
{
my $email;
@@ -217,7 +222,10 @@ sub build
if(!$url[0])
- { print "URL was not found ! Skipping...\n"; return; }
+ {
+ print "URL of sources was not found ! Trying to guess it with url tag ...\n";
+ push(@url, $specvars{'url'}.$tar_ball)
+ }
$found = 0;