aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Util.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2024-12-20 19:33:16 +0000
committerPascal Terjan <pterjan@mageia.org>2024-12-20 20:07:06 +0000
commit066bc31b8884cdfcd32266621f7ede174cb1f502 (patch)
tree033c68c872be2017502a7c76bbfbf24a0c91a839 /lib/Iurt/Util.pm
parent72463db81d937c8aab0cccddbd721b7d40b22b9b (diff)
downloadiurt-066bc31b8884cdfcd32266621f7ede174cb1f502.tar
iurt-066bc31b8884cdfcd32266621f7ede174cb1f502.tar.gz
iurt-066bc31b8884cdfcd32266621f7ede174cb1f502.tar.bz2
iurt-066bc31b8884cdfcd32266621f7ede174cb1f502.tar.xz
iurt-066bc31b8884cdfcd32266621f7ede174cb1f502.zip
Log recreate_srpm
This unifies logdir name too as some logs were in different directories, and uses the same behaviour for all srpms. Building a src.rpm with svn revision like "@42:foo-42-1.src.rpm" used to use a directory "foo-42-1" while building "foo-42-1.src.rpm" would use the directory "foo-42-1.src.rpm". In order to not break Mageia's build system and UI the first one was picked and they will now both use "foo-42-1".
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