diff options
author | Claudio Matsuoka <claudio@mandriva.com> | 2006-12-05 16:37:37 +0000 |
---|---|---|
committer | Claudio Matsuoka <claudio@mandriva.com> | 2006-12-05 16:37:37 +0000 |
commit | a8eb19c4f2c943ae497a6a100f70d9aba3543710 (patch) | |
tree | 07fcec0e76e0445848552bb4a44616d30f797e0a | |
parent | 4bbb738682ea67070163e72e6fba1a51e18cf5d2 (diff) | |
download | iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar.gz iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar.bz2 iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.tar.xz iurt-a8eb19c4f2c943ae497a6a100f70d9aba3543710.zip |
Replaced cryptic regexps for descriptive functions (misc)
-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)"); |