aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;