Skip to content

Commit 79b008a

Browse files
aparcarAnsuel
authored andcommitted
build: fixup version.date creation for source archives
Published sources archives may contain a mixture of MTIMEs, so taking the time of the first file found varies based on filesystem order. To fix this, sort all MTIMEs and take the latest. Since piping into a file directly creates that file, we also need to specifically tell `find` to ignore `version.date`. Furthermore, move this prior to the ./src copy step, since for some packages, the OpenWrt build system ships extra ./src files, which would introduce the wrong timestamps again. Fix: e36c294 build: derive PKG_SOURCE_DATE_EPOCH from the unpacked source tree Link: openwrt/openwrt#23756 Signed-off-by: Paul Spooren <mail@aparcar.org> (cherry picked from commit 8ba4c5e) Link: openwrt/openwrt#23846 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
1 parent 8be3ba9 commit 79b008a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎include/package-defaults.mk‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ Build/Patch:=$(Build/Patch/Default)
6363
ifneq ($(strip $(PKG_UNPACK)),)
6464
define Build/Prepare/Default
6565
$(PKG_UNPACK)
66+
-find $(PKG_BUILD_DIR) -mindepth 1 -type f -not -name '.*' -not -name 'version.date' -printf '%T@\n' 2>/dev/null |\
67+
cut -d. -f1 | sort -n | tail -n1 > $(PKG_BUILD_DIR)/version.date
6668
[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
67-
-find $(PKG_BUILD_DIR) -mindepth 1 -type f -printf '%T@\n' 2>/dev/null | head -n1 | cut -d. -f1 > $(PKG_BUILD_DIR)/version.date
6869
$(Build/Patch)
6970
endef
7071
endif

0 commit comments

Comments
 (0)