aboutsummaryrefslogtreecommitdiffstats
path: root/iurt2
diff options
context:
space:
mode:
authorClaudio Matsuoka <claudio@mandriva.com>2006-12-05 16:37:37 +0000
committerClaudio Matsuoka <claudio@mandriva.com>2006-12-05 16:37:37 +0000
commita8eb19c4f2c943ae497a6a100f70d9aba3543710 (patch)
tree07fcec0e76e0445848552bb4a44616d30f797e0a /iurt2
parent4bbb738682ea67070163e72e6fba1a51e18cf5d2 (diff)
downloadiurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar
iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar.gz
iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar.bz2
iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar.xz
iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.zip
Replaced cryptic regexps for descriptive functions (misc)
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)");