[openwrt/openwrt] build: store SourceDateEpoch in manifest

LEDE Commits lede-commits at lists.infradead.org
Mon Aug 31 06:29:55 EDT 2020


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/62d5ec7306f9664aeba64bc64c0dee1d93978bb4

commit 62d5ec7306f9664aeba64bc64c0dee1d93978bb4
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sat Aug 15 10:57:03 2020 -1000

    build: store SourceDateEpoch in manifest
    
    The usage of granular `SOURCE_DATE_EPOCH` for packages is an
    incrementing integer which could be useful for downstream tooling,
    therefore add it to the packages manifest.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 include/package-ipkg.mk | 1 +
 package/Makefile        | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 808ac1c6e3..0b7a561edc 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -181,6 +181,7 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
 )$$(call addfield,LicenseFiles,$(LICENSE_FILES)
 )$$(call addfield,Section,$(SECTION)
 )$$(call addfield,Require-User,$(USERID)
+)$$(call addfield,SourceDateEpoch,$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh $(SOURCE))
 )$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
 )$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed
 )$(if $(filter essential,$(PKG_FLAGS)),Essential: yes
diff --git a/package/Makefile b/package/Makefile
index 58c1ba2bbf..f5373ee65d 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -84,7 +84,7 @@ $(curdir)/index: FORCE
 		mkdir -p $$d; \
 		cd $$d || continue; \
 		$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
-		grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages; \
+		grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require|SourceDateEpoch)' Packages.manifest > Packages; \
 		case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
 			$(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
 			{ echo ""; echo ""; } >> Packages;; \



More information about the lede-commits mailing list