Skip to content

Commit

Permalink
Only add the time zone offset once
Browse files Browse the repository at this point in the history
when computing the time of a changes entry in changelog2spec.

This avoids getting a date in the future which would fail when using it
for SOURCE_DATE_EPOCH for reproducible builds.

Such failures happened when we tried using it with
openSUSE/post-build-checks#58 .

Example failure from build log:
setting SOURCE_DATE_EPOCH to 1698749844
ERROR SOURCE_DATE_EPOCH is in the future, clamping mtime if
 used might fail in hard to notice way, returning error

"Mon Oct 30 12:36:34 CET 2023" in .changes results in
SOURCE_DATE_EPOCH=1698669395 but that's Mon 30. Oct 12:36:35 UTC 2023

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1216738
  • Loading branch information
JanZerebecki committed Jan 31, 2024
1 parent ff855fc commit b119a72
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion changelog2spec
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ sub parse_suse {
$tdt = str2time("$year-1-1");
}
$tdt += 12 * 3600 unless $dt =~ /\d:\d/; # 12:00 if not specified
$tdt += ($zone || 0);
my $ok = 1;
my $change = '';
while(<>) {
Expand Down

0 comments on commit b119a72

Please sign in to comment.