mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 23:42:16 +02:00
update/release: be more thorough updating times
use find and touch, to force all files, directories and links to the desired timestamp (versiondate file) Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -264,11 +264,21 @@ insert_version_files()
|
|||||||
mktarball()
|
mktarball()
|
||||||
{
|
{
|
||||||
# preserve timestamps for reproducible tarballs
|
# preserve timestamps for reproducible tarballs
|
||||||
|
touch_implementation="$(touch --version)"
|
||||||
tar_implementation="$(tar --version)"
|
tar_implementation="$(tar --version)"
|
||||||
tar_implementation="${tar_implementation% *}"
|
eval "$(setvars "" mtime touch)"
|
||||||
mtime=""
|
[ "${tar_implementation% *}" = "tar (GNU tar)" ] && \
|
||||||
[ "${tar_implementation}" = "tar (GNU tar)" ] && \
|
mtime="--mtime='@${versiondate}'"
|
||||||
mtime="--mtime=${versiondate}"
|
[ "${touch_implementation% *}" = "touch (GNU coreutils)" ] || \
|
||||||
|
touch_implementation=""
|
||||||
|
|
||||||
|
(
|
||||||
|
x_ cd "${1}"
|
||||||
|
[ -z "${touch_implementation}" ] || \
|
||||||
|
find . -exec touch -h -a -m \
|
||||||
|
-d "$(date -Rd @${versiondate})" {} + || \
|
||||||
|
err "mktarball ${1}: can't set universal timestamps"
|
||||||
|
)
|
||||||
|
|
||||||
[ "${2%/*}" = "${2}" ] || x_ mkdir -p "${2%/*}"
|
[ "${2%/*}" = "${2}" ] || x_ mkdir -p "${2%/*}"
|
||||||
x_ tar -c "${1}" ${mtime} | xz -T0 -9e > "${2}"
|
x_ tar -c "${1}" ${mtime} | xz -T0 -9e > "${2}"
|
||||||
|
|||||||
Reference in New Issue
Block a user