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
This commit is contained in:
Lyndon Brown 2020-05-03 18:35:02 +01:00
parent 7ad69658b2
commit dc64d8235d
1 changed files with 7 additions and 7 deletions

View File

@ -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" " ")"