diff options
Diffstat (limited to 'iurt2')
-rwxr-xr-x | iurt2 | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -44,6 +44,8 @@ use Iurt::Mail qw(sendmail); use Iurt::Util qw(plog_init plog); use File::NCopy qw(copy); use File::Path qw(mkpath); +use File::Spec::Functions qw(rel2abs); +use File::Basename qw(fileparse); # I did not manage to make locks work over the network #use File::lockf; use Mkcd::Commandline qw(parseCommandLine usage); @@ -186,14 +188,8 @@ $run{todo} = []; die "FATAL $program_name: $_ not a file or cannot be read\n"; } - if (m,^(/.*/)([^/]*\.src\.rpm)$,) { - ($path, $srpm) = ($1, $2); - } elsif (m,([^/]*\.src\.rpm)$,) { - ($path, $srpm) = (`pwd`, $1); - chomp($path); - } else { - die "FATAL $program_name: $_ doesn't look like a SRPM\n"; - } + ($srpm, $path) = fileparse(rel2abs($_)); + ($srpm =~ /\.src\.rpm$/) || die "FATAL: $_ doesn't look like an SRPM"; if (check_arch($_, $run{my_arch})) { plog('DEBUG', "force build for $2 (from $1)"); |