From f8862c26219774e7e900d2464dd0ff51cbbd6311 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 5 Sep 2021 12:20:56 +0300 Subject: mkarchiso: replace external date command with printf printf is a bash builtin, so by using it an external command can be avoided. Due to the differences between date(1) and strftime(3), the time zone output will not contain a colon anymore. Fortunately, that is still a supported format according to https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC . --- archiso/mkarchiso | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'archiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 6181af2..9a310c7 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -7,7 +7,8 @@ set -e -u # Control the environment umask 0022 export LC_ALL="C" -export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-"$(date +%s)"}" +[[ -v SOURCE_DATE_EPOCH ]] || printf -v SOURCE_DATE_EPOCH '%(%s)T' -1 +export SOURCE_DATE_EPOCH # Set application name from the script's file name app_name="${0##*/}" @@ -113,7 +114,7 @@ ENDUSAGETEXT # Shows configuration options. _show_config() { local build_date - build_date="$(date --utc --iso-8601=seconds -d "@${SOURCE_DATE_EPOCH}")" + printf -v build_date '%(%FT%R%z)T' "${SOURCE_DATE_EPOCH}" _msg_info "${app_name} configuration settings" _msg_info " Architecture: ${arch}" _msg_info " Working directory: ${work_dir}" -- cgit v1.2.3-70-g09d2