From dc64d8235d4b2706fa2bce6a6bd59d62e2fa9d88 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Sun, 3 May 2020 18:35:02 +0100 Subject: [PATCH] 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 --- scripts/build/binary_syslinux | 14 +++++++------- 1 file 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" " ")"