aboutsummaryrefslogtreecommitdiffstats
path: root/iurt2
diff options
context:
space:
mode:
Diffstat (limited to 'iurt2')
-rwxr-xr-xiurt212
1 files changed, 4 insertions, 8 deletions
diff --git a/iurt2 b/iurt2
index 9e170a7..02b0222 100755
--- a/iurt2
+++ b/iurt2
@@ -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)");