summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-05-03 18:35:02 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-03 20:31:43 +0100
commitdc64d8235d4b2706fa2bce6a6bd59d62e2fa9d88 (patch)
tree9d47453c84e5d4f9087a5eede2779d688dff56f5
parent7ad69658b249bd268497754b4933a65773c38593 (diff)
downloadvyos-live-build-dc64d8235d4b2706fa2bce6a6bd59d62e2fa9d88.tar.gz
vyos-live-build-dc64d8235d4b2706fa2bce6a6bd59d62e2fa9d88.zip
syslinux: fix date construction accuracy issue
don't construct each part from a fresh "now", which can result in inaccuracies in the overall date due to "now" drifting over the individual date calls. instead feed the full date that was obtained back into it when extracting the component parts. Gbp-Dch: Ignore
-rwxr-xr-xscripts/build/binary_syslinux14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux
index 34ce02b86..21cb68fe2 100755
--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -215,13 +215,13 @@ _VERSION="${_VERSION:-none}"
_DISTRIBUTION="${LB_DISTRIBUTION_BINARY}"
-_DATE=$(date -R)
-_YEAR="$(date +%Y)"
-_MONTH="$(date +%m)"
-_DAY="$(date +%d)"
-_HOUR="$(date +%H)"
-_MINUTE="$(date +%M)"
-_SECOND="$(date +%S)"
+_DATE="$(date -R)"
+_YEAR="$(date -d "${_DATE}" +%Y)"
+_MONTH="$(date -d "${_DATE}" +%m)"
+_DAY="$(date -d "${_DATE}" +%d)"
+_HOUR="$(date -d "${_DATE}" +%H)"
+_MINUTE="$(date -d "${_DATE}" +%M)"
+_SECOND="$(date -d "${_DATE}" +%S)"
_LINUX_VERSIONS="$(for _LINUX in chroot/boot/vmlinuz-* ; do chroot chroot apt-cache policy $(basename ${_LINUX} | sed -e 's|vmlinuz-|linux-image-|') | awk '/Installed: / { print $2 }' ; done | sort -Vru | tr "\n" " ")"