Your message dated Sat, 8 Mar 2025 01:35:27 +0200
with message-id <Z8uCv96j6oCVPkGu@localhost>
and subject line Re: Processed: tagging 1060372
has caused the Debian Bug report #1060372,
regarding debchange: can't set timezone for changelog entries
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1060372: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060372
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: devscripts

Version: v2.23.7

Severity: important

Tags: patch


As the man page, user can set DEBCHANGE_TZ in /etc/devscripts.conf
and ~/.devscripts to change the timezone of changelog entries, and
also can change it by the environment variable TZ.

https://manpages.debian.org/stretch/devscripts/dch.1.en.html

But none of them is successful. The root cause is $DATE is always
set as localtime(). The timezone is passed via $opt_tz, so adding
judgement to check whether $opt_zt is set.

Test
a) Add DEBCHANGE_TZ in /etc/devscripts.conf
dch -i
b) TZ="xxxxxxxx" dch -i
From 82065bdbd2ae5bd696d0554f0152540f1a6e2f64 Mon Sep 17 00:00:00 2001
From: Yue Tao <[email protected]>
Date: Tue, 9 Jan 2024 21:44:23 -0800
Subject: [PATCH] debchange: can't set timezone for changelog entries

As the man page, user can set DEBCHANGE_TZ in /etc/devscripts.conf
and ~/.devscripts to change the timezone of changelog entries, and
also can change it by the environment variable TZ.

https://manpages.debian.org/stretch/devscripts/dch.1.en.html

But none of them is successful. The root cause is $DATE is always
set as localtime(). The timezone is passed via $opt_tz, so adding
judgement to check whether $opt_zt is set.

Test
a) Add DEBCHANGE_TZ in /etc/devscripts.conf
dch -i
b) TZ="xxxxxxxx" dch -i

Signed-off-by: Yue Tao <[email protected]>
---
 scripts/debchange.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/debchange.pl b/scripts/debchange.pl
index 73501c33..b91c5776 100755
--- a/scripts/debchange.pl
+++ b/scripts/debchange.pl
@@ -1043,7 +1043,11 @@ if (@ARGV and !$TEXT) {
 my $DATE;
 {
     local $ENV{TZ} = $opt_tz if $opt_tz;
-    $DATE = strftime "%a, %d %b %Y %T %z", localtime();
+    if ($opt_tz) {
+        $DATE = $opt_tz;
+    } else {
+        $DATE = strftime "%a, %d %b %Y %T %z", localtime();
+    }
 }
 
 if ($opt_news && !$opt_i && !$opt_a) {
-- 
2.42.0


--- End Message ---
--- Begin Message ---
Version: 2.24.2

On Fri, Mar 07, 2025 at 07:55:44PM +0000, Holger Levsen wrote:
> control: tags -1 - patch
> thanks
> 
> On Fri, Mar 07, 2025 at 07:48:02PM +0000, Debian Bug Tracking System wrote:
> > > tags 1060372 + patch
>  
> I wanted to review the patch with context, but....
> 
> user@debian-work:~/Projects/devscripts/devscripts$ wget 
> "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1060372;filename=0001-debchange-can-t-set-timezone-for-changelog-entries.patch;msg=5";
> --2025-03-07 20:51:53--  
> https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1060372;filename=0001-debchange-can-t-set-timezone-for-changelog-entries.patch;msg=5
> [...]
> user@debian-work:~/Projects/devscripts/devscripts$ patch -p1 < 
> bugreport.cgi\?att\=1\;bug\=1060372\;filename\=0001-debchange-can-t-set-timezone-for-changelog-entries.patch\;msg\=5
>  
> patching file scripts/debchange.pl
> Hunk #1 FAILED at 1043.
> 1 out of 1 hunk FAILED -- saving rejects to file scripts/debchange.pl.rej
> 
> 
> This being on current git main branch.

Yes sorry, I did this just blindly.

Looking closer, it seems the user actually wanted the --date option
(added later in 2.24.2).

TZ sets the *timezone* not the time.

And this works:
  TZ=Europe/Helsinki dch -i

What the user wanted is now available in trixie as:
  dch -i --date "Fri, 07 Mar 2025 23:00:51 +0000"

> cheers,
>       Holger

cu
Adrian

--- End Message ---

Reply via email to