diff options
author | Leah Rowe <leah@libreboot.org> | 2023-10-14 01:40:23 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-10-14 01:40:23 +0100 |
commit | ca78fc6762913560d1cf8fb01e57dc72121870e5 (patch) | |
tree | 6325f4037295ed3810b63a8bcda435a70237dbf6 /script/update/project/release | |
parent | 7cd84aec285bf2ecf4c7c663adc5e4e5000492f4 (diff) |
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>
Diffstat (limited to 'script/update/project/release')
-rwxr-xr-x | script/update/project/release | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/script/update/project/release b/script/update/project/release index 426db72a..b6c0acf5 100755 --- a/script/update/project/release +++ b/script/update/project/release @@ -264,11 +264,21 @@ insert_version_files() mktarball() { # preserve timestamps for reproducible tarballs + touch_implementation="$(touch --version)" tar_implementation="$(tar --version)" - tar_implementation="${tar_implementation% *}" - mtime="" - [ "${tar_implementation}" = "tar (GNU tar)" ] && \ - mtime="--mtime=${versiondate}" + eval "$(setvars "" mtime touch)" + [ "${tar_implementation% *}" = "tar (GNU tar)" ] && \ + 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%/*}" x_ tar -c "${1}" ${mtime} | xz -T0 -9e > "${2}" |