[Git][reproducible-builds/reproducible-website][master] source-date-epoch: simplify shell date format usage

Bernhard M. Wiedemann gitlab at salsa.debian.org
Thu Dec 5 15:43:11 UTC 2019



Bernhard M. Wiedemann pushed to branch master at Reproducible Builds / reproducible-website


Commits:
93610af1 by Bernhard M. Wiedemann at 2019-12-05T15:42:34Z
source-date-epoch: simplify shell date format usage

similar to
commit 30c4eb936c8998fd7968e39467876df7483d6cc4

- - - - -


1 changed file:

- _docs/source-date-epoch.md


Changes:

=====================================
_docs/source-date-epoch.md
=====================================
@@ -106,9 +106,9 @@ BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
 If you need to support BSD date as well you should fallback to trying ther `-r seconds` timestamp variant:
 
 ```
-DATE_FMT="%Y-%m-%d"
+DATE_FMT="+%Y-%m-%d"
 SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
-BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT")
+BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT")
 ```
 
 ### Perl



View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/commit/93610af167dfdd80533c14fb9e5e925342d0ad87

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/commit/93610af167dfdd80533c14fb9e5e925342d0ad87
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20191205/01fc8a0e/attachment.htm>


More information about the rb-commits mailing list