tags 834736 + patch
thanks

Hello.

I've simplified the proposed patch to the one in the attach,
and now it is probably as small as it can be without losing
readability (two lines).

It works for me, I have been using it for eight years now, and it's
still my preferred way to tell sbuild the filename that I want to use
for the build log.

[ If the environment variable name is not good enough, just use one
which makes sense. I will gladly adapt my scripts ]

Thanks.
commit 36f4e780f4a6de6a1ebceaa4fcd6bc53fe952fcb
Author: Santiago Vila <sanv...@debian.org>
Date:   Thu Apr 4 12:30:00 2024 +0200

    lib/Sbuild/Build.pm:
    
    Allow the user to set the timestamp part of the build log filename
    via SBUILD_LOG_TIMESTAMP environment variable.
    
    If such variable exists and it's not empty, it will be used
    instead of $date.

--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -3270,7 +3270,8 @@ sub open_build_log {
     } else {
        $filename .= $self->get('Package');
     }
-    $filename .= '_' . $self->get('Host Arch') . "-$date";
+    my $log_timestamp = $ENV{'SBUILD_LOG_TIMESTAMP'} || $date;
+    $filename .= '_' . $self->get('Host Arch') . "-$log_timestamp";
     $filename .= ".build" if $self->get_conf('SBUILD_MODE') ne 'buildd';
 
     open($saved_stdout, ">&STDOUT") or warn "Can't redirect stdout\n";

Reply via email to