[Rpm-maint] [rpm-software-management/rpm] SOURCE_DATE_EPOCH=0 not clamping file mtime (Issue #2679)

Etienne Champetier notifications at github.com
Wed Sep 27 19:44:33 UTC 2023


Here a simple reproducer:
```
Name:    test
Version: 1
Release: 1
Summary: test SOURCE_DATE_EPOCH=0
License: GPLv2

%global source_date_epoch_from_changelog 0
%global clamp_mtime_to_source_date_epoch 1
%global use_source_date_epoch_as_buildtime 1

%description

%build
echo "this is a test" > 0.txt

%install
%{__install} -m 644 -D 0.txt %{buildroot}/0.txt

%files
/0.txt
```

```
$ SOURCE_DATE_EPOCH=0 rpmbuild -bb test.spec
$ rpm -q --dump ~/rpmbuild/RPMS/x86_64/test-1-1.x86_64.rpm
/0.txt 15 1695843332 91751cee0a1ab8414400238a761411daa29643ab4b8243e9a91649e25be53ada 0100644 root root 0 0 0 X
$ rpm -qi ~/rpmbuild/RPMS/x86_64/test-1-1.x86_64.rpm
Build Date  : Wed Dec 31 19:00:00 1969
```

It works fine with SOURCE_DATE_EPOCH=1
```
$ SOURCE_DATE_EPOCH=1 rpmbuild -bb test.spec
$ rpm -q --dump ~/rpmbuild/RPMS/x86_64/test-1-1.x86_64.rpm
/0.txt 15 1 91751cee0a1ab8414400238a761411daa29643ab4b8243e9a91649e25be53ada 0100644 root root 0 0 0 X
```

This is an issue on both Fedora 38 (rpm-4.18.1-3.fc38.x86_64) and Alma 9 (rpm-4.16.1.3-22.el9.x86_64)
It works fine on Alma 8 (rpm-4.14.3-26.el8.x86_64)
```
$ SOURCE_DATE_EPOCH=0 rpmbuild -bb test.spec
$ rpm -q --dump ~/rpmbuild/RPMS/x86_64/test-1-1.x86_64.rpm
/0.txt 15 0 91751cee0a1ab8414400238a761411daa29643ab4b8243e9a91649e25be53ada 0100644 root root 0 0 0 X
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2679
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/2679 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230927/38ad81cb/attachment-0001.html>


More information about the Rpm-maint mailing list