Sfoglia il codice sorgente

scripts/mk: Export SOURCE_DATE_EPOCH

The minimally guaranteed entry point to build packages is the
debian/rules file, dpkg-buildpackage and any environment it sets up
cannot be relied upon.

Export this variable from pkg-info.mk preset from the debian/changelog
Timestamp.

Closes: #824572
Guillem Jover 10 anni fa
parent
commit
5536b2b785
2 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 2 0
      debian/changelog
  2. 7 0
      scripts/mk/pkg-info.mk

+ 2 - 0
debian/changelog

@@ -44,6 +44,8 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
     Closes: #826161
     Closes: #826161
   * Do not emit warnings from dpkg-genchanges for automatic debug symbol
   * Do not emit warnings from dpkg-genchanges for automatic debug symbol
     packages that are not found in debian/control.
     packages that are not found in debian/control.
+  * Export SOURCE_DATE_EPOCH from pkg-info.mk makefile snippet.
+    Closes: #824572
   * Perl modules:
   * Perl modules:
     - Use warnings::warnif() instead of carp() for deprecated warnings.
     - Use warnings::warnif() instead of carp() for deprecated warnings.
     - Add new format_range() method and deprecate dpkg() and rfc822() methods
     - Add new format_range() method and deprecate dpkg() and rfc822() methods

+ 7 - 0
scripts/mk/pkg-info.mk

@@ -6,6 +6,9 @@
 # DEB_VERSION_UPSTREAM_REVISION: the package's version without the Debian epoch
 # DEB_VERSION_UPSTREAM_REVISION: the package's version without the Debian epoch
 # DEB_VERSION_UPSTREAM: the package's upstream version
 # DEB_VERSION_UPSTREAM: the package's upstream version
 # DEB_DISTRIBUTION: the distribution(s) listed in the current entry of debian/changelog
 # DEB_DISTRIBUTION: the distribution(s) listed in the current entry of debian/changelog
+#
+# SOURCE_DATE_EPOCH: the source release date as seconds since the epoch, as
+#   specified by <https://reproducible-builds.org/specs/source-date-epoch/>
 
 
 dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
 dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
 
 
@@ -15,3 +18,7 @@ DEB_VERSION_EPOCH_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_EPOCH_UPSTREAM,ec
 DEB_VERSION_UPSTREAM_REVISION = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM_REVISION,echo '$(DEB_VERSION)' | sed -e 's/^[0-9]*://')
 DEB_VERSION_UPSTREAM_REVISION = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM_REVISION,echo '$(DEB_VERSION)' | sed -e 's/^[0-9]*://')
 DEB_VERSION_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM,echo '$(DEB_VERSION_EPOCH_UPSTREAM)' | sed -e 's/^[0-9]*://')
 DEB_VERSION_UPSTREAM = $(call dpkg_late_eval,DEB_VERSION_UPSTREAM,echo '$(DEB_VERSION_EPOCH_UPSTREAM)' | sed -e 's/^[0-9]*://')
 DEB_DISTRIBUTION = $(call dpkg_late_eval,DEB_DISTRIBUTION,dpkg-parsechangelog -SDistribution)
 DEB_DISTRIBUTION = $(call dpkg_late_eval,DEB_DISTRIBUTION,dpkg-parsechangelog -SDistribution)
+
+SOURCE_DATE_EPOCH ?= $(call dpkg_late_eval,SOURCE_DATE_EPOCH,dpkg-parsechangelog -STimestamp)
+
+export SOURCE_DATE_EPOCH