diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-09-27 22:06:02 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-10-03 07:55:42 +0200 |
commit | 88993256222bab1866247721d9846253e9ef12f5 (patch) | |
tree | d6b6a425cc8ced79db24d905e0f8102a7afb2503 /scripts | |
parent | 41a6284570fc1a014cb6b2b7ebd7470e2d3e1770 (diff) | |
download | ptxdist-88993256222bab1866247721d9846253e9ef12f5.tar.gz ptxdist-88993256222bab1866247721d9846253e9ef12f5.tar.xz |
define and use SOURCE_DATE_EPOCH
This is useful for more reproducible builds. See also:
https://reproducible-builds.org/specs/source-date-epoch/
It is used by the opkg-utils 0.3.6, so define this before updating that
package.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_lib_reproducible.sh | 17 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_lib_reproducible.sh b/scripts/lib/ptxd_lib_reproducible.sh new file mode 100644 index 000000000..f0c1bcf8f --- /dev/null +++ b/scripts/lib/ptxd_lib_reproducible.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Copyright (C) 2018 by Michael Olbrich <m.olbrich@pengutronix.de> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +ptxd_lib_reproducible() { + SOURCE_DATE_EPOCH="$(echo $(date --date="${PTXDIST_VERSION_YEAR}-${PTXDIST_VERSION_MONTH}-01 UTC" "+%s"))" + export SOURCE_DATE_EPOCH +} +export -f ptxd_lib_reproducible + +ptxd_lib_reproducible diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index 8c49cba9e..b3f2f20f3 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -916,7 +916,7 @@ executing '${pkg_label}.${1}' export -f ptxd_install_run ptxd_install_fixup_timestamps() { - local timestamp="${PTXDIST_VERSION_YEAR}-${PTXDIST_VERSION_MONTH}-01 UTC" + local timestamp="@${SOURCE_DATE_EPOCH}" local touch_args if touch --help | grep -q -- --no-dereference &> /dev/null; then touch_args="--no-dereference" |