[Reproducible-builds] Bug#788238: kfreebsd-10: source tarball has unreproducible timestamps
Steven Chamberlain
steven at pyro.eu.org
Tue Jun 9 16:33:40 UTC 2015
Package: src:kfreebsd-10
Version: 10.1~svn274115-4
Severity: wishlist
Tags: patch pending
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
Hi,
The kfreebsd-10 (kernel) packaging distributes a source tarball in
kfreebsd-source, a binary arch-indep package.
Some of these files are patched during the build, so the file and
directory timestamps in the tarball are not reproducible.
This patch will clamp timestamps to be no later than the latest
debian/changelog entry (replacing an earlier, incomplete fix).
--- debian/rules (revision 5714)
+++ debian/rules (working copy)
@@ -44,6 +44,7 @@
ORIG_DIR := $(source)-$(tar_version)
ORIG_TAR := $(source)_$(tar_version).orig.tar.xz
PATH := /usr/lib/freebsd:$(PATH)
+BUILD_DATE ?= $(shell dpkg-parsechangelog --show-field=Date)
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
@@ -169,8 +170,10 @@
mkdir -p $(SOURCE_PACKAGE)/usr/src
chown -R root.src $(SRC_DIR)
- # Avoid the top-level directory timestamp changing
- touch $(SRC_DIR) --reference=$(SRC_DIR)/sys
+ # Clamp timestamps to be no newer than last changelog entry, see
+ # https://wiki.debian.org/ReproducibleBuilds/TimestampsInTarball
+ find $(SRC_DIR) -newermt "$(BUILD_DATE)" -print0 \
+ | xargs -0r touch --no-dereference --date="$(BUILD_DATE)"
# Create tarball with files sorted in a stable order, see
# https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs
find $(SRC_DIR) -print0 | LC_ALL=C sort -z \
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
More information about the Reproducible-builds
mailing list