Skip to content

Commit

Permalink
PR: #702: Report build date in UTC when $SOURCE_DATE_EPOCH is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Apr 24, 2024
1 parent e4f5e84 commit 2077924
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions proj_mgmt/DATE_cmd.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
# -*- shell-script -*-

arg="$1"
Expand All @@ -14,10 +14,11 @@ if [ $osType = "Darwin" ]; then
fi
fi

#$my_cmd "$arg"


SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$($my_cmd +%s)}"
$my_cmd -u -d "@$SOURCE_DATE_EPOCH" "$arg" 2>/dev/null ||
$my_cmd -u -r "$SOURCE_DATE_EPOCH" "$arg" 2>/dev/null ||
if [ -n "${SOURCE_DATE_EPOCH+x}" ]; then
arg="${arg%% %:z} %Z"
$my_cmd -u -d "@$SOURCE_DATE_EPOCH" "$arg" 2>/dev/null ||
$my_cmd -u -r "$SOURCE_DATE_EPOCH" "$arg" 2>/dev/null ||
$my_cmd "$arg"
else
$my_cmd "$arg"
fi

0 comments on commit 2077924

Please sign in to comment.