[Rpm-maint] [rpm-software-management/rpm] Add support for setting the build time and clamping to the build time (PR #2944)

Panu Matilainen notifications at github.com
Wed Apr 3 07:09:53 UTC 2024


@pmatilai commented on this pull request.



>  
-    /* Limit the maximum date to SOURCE_DATE_EPOCH if defined
-     * similar to the tar --clamp-mtime option
-     * https://reproducible-builds.org/specs/source-date-epoch/
-     */
-    if (srcdate && rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")) {
-	char *endptr;
-	errno = 0;
-	source_date_epoch = strtol(srcdate, &endptr, 10);
-	if (srcdate == endptr || *endptr || errno != 0) {
-	    rpmlog(RPMLOG_ERR, _("unable to parse %s=%s\n"), "SOURCE_DATE_EPOCH", srcdate);
-	    fl->processingFailed = 1;
+    /* backward compatibility */
+    if (!*mtime_policy_str) {
+        if (srcdate && rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")) {

Maybe this should issue a deprecation warning?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2944#pullrequestreview-1975738512
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2944/review/1975738512 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240403/063d826e/attachment.html>


More information about the Rpm-maint mailing list