[pacman-dev] [PATCH] Add a timestamp file into repo tarballs

Allan McRae allan at archlinux.org
Tue Nov 5 14:03:17 UTC 2019


On 5/11/19 11:58 pm, Morten Linderud wrote:
> On Tue, Nov 05, 2019 at 11:54:34PM +1000, Allan McRae wrote:
>> When creating or modifying repo tarballs, place a .TIMESTAMP file with
>> seconds since epoch in it.  This will be used in the future to enable
>> rejecting databases older that a given threshold.
>>
>> Also skip reading the .TIMESTAMP file in sync_db_populate().
>>
>> Signed-off-by: Allan McRae <allan at archlinux.org>
>> ---
>>

<snip>

>> diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
>> index caf1232d..c87409f1 100644
>> --- a/scripts/repo-add.sh.in
>> +++ b/scripts/repo-add.sh.in
>> @@ -526,6 +526,7 @@ create_db() {
>>  	TAR_OPT=$(verify_repo_extension "$REPO_DB_FILE")
>>  	# $LOCKFILE is already guaranteed to be absolute so this is safe
>>  	dirname=${LOCKFILE%/*}
>> +	timestamp=$(date +%s)
> 
> This should probably utilize SOURCE_DATE_EPOCH or something equivalent?
> 
> timestamp=$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%s))

Why?  I can see no reason why it should...


More information about the pacman-dev mailing list