Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [ISSUE] [RFC] set timestamps in a package only for files newer than commit date
Date: Sun, 22 Aug 2021 22:57:45 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-32638@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

New issue by tornaria on void-packages repository

https://github.com/void-linux/void-packages/issues/32638

Description:
The hook `pre-pkg/90-set-timestamps.sh` touches all files in a pkg to set the mtimes to the commit date. When a package installs files verbatim from its source, it might make sense to keep the original timestamp. This could be acomplished by using find predicate `-newermt` as in:
```diff
--- a/common/hooks/pre-pkg/90-set-timestamps.sh
+++ b/common/hooks/pre-pkg/90-set-timestamps.sh
@@ -5,6 +5,6 @@ hook() {
        # If SOURCE_DATE_EPOCH is set, set mtimes to that timestamp.
        if [ -n "$SOURCE_DATE_EPOCH" ]; then
                msg_normal "$pkgver: setting mtimes to %s\n" "$(date --date "@$SOURCE_DATE_EPOCH")"
-               find $PKGDESTDIR -print0 | xargs -0 touch -h --date "@$SOURCE_DATE_EPOCH"
+               find $PKGDESTDIR -newermt "@$SOURCE_DATE_EPOCH" -print0 | xargs -0 touch -h --date "@$SOURCE_DATE_EPOCH"
        fi
 }
```

I am thinking on a package like `pari-elldata` which ships only data files from its source. The alternative I found is to set `XBPS_USE_BUILD_MTIME=no` in the template, but (a) that is only good for this pkg because I know all the files in the package have a deterministic timestamp and (b) xlint complains when using this variable.

Rationale: the timestamp of the original files in the source is more canonical than the commit date.

             reply	other threads:[~2021-08-22 20:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 20:57 tornaria [this message]
2021-08-23 18:32 ` Chocimier
2021-08-23 22:39 ` tornaria
2021-08-23 22:41 ` ericonr
2021-08-23 23:05 ` tornaria
2021-08-23 23:05 ` [ISSUE] [CLOSED] " tornaria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-32638@inbox.vuxu.org \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).