-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 11132fc assumed that the value of 0 is never used in practice and thus used it to indicate "disabled", however that assumption has turned out to be wrong because ostree uses precisely that value as mtime in inodes, which in turn breaks existing workflows in this space (see the associated ticket). Fix this by reverting the above commit (except leaving source_date_epoch initialized to 0, to prevent GCC warnings as mentioned in that commit). As to why not just initialize source_date_epoch to -1: time_t happens to be a signed integer on most platforms but POSIX doesn't specify its signed-ness. Add some accompanying tests too. Fixes: #2679
- Loading branch information
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Name: test | ||
Version: 1 | ||
Release: 1 | ||
Summary: test SOURCE_DATE_EPOCH | ||
License: GPLv2 | ||
BuildArch: noarch | ||
|
||
%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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters