aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Iurt/Util.pm')
-rw-r--r--lib/Iurt/Util.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Iurt/Util.pm b/lib/Iurt/Util.pm
index bf726d0..439e146 100644
--- a/lib/Iurt/Util.pm
+++ b/lib/Iurt/Util.pm
@@ -5,6 +5,7 @@ use Fcntl qw(:flock SEEK_END);
use strict;
our @EXPORT = qw(
+ logdir
plog_init
plog
pdie
@@ -121,6 +122,22 @@ sub pdie {
die $@;
}
+=item logdir($srpm)
+
+Get the name of the log directory based on the src.rpm filename.
+
+=cut
+
+sub logdir {
+ my $srpm = shift;
+ (my $logdir = $srpm) =~ s/^(?:[^:]*:)?([^:]*)\.(buildreqs\.nosrc|src).rpm/$1/;
+ return $logdir;
+}
+
+=back
+
+=cut
+
=head2 SSH HELPERS
=over 8