[Git][NTPsec/ntpsec][master] ntpleapfetch: Fix some more GNU-isms.
Gary E. Miller
gitlab at mg.gitlab.com
Wed Dec 12 01:49:10 UTC 2018
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
4f37564b by Gary E. Miller at 2018-12-12T01:48:37Z
ntpleapfetch: Fix some more GNU-isms.
"echo -n" is not in the BSD shell. Also sed "!d" seems broken on
BSD. Note that osX also uses the BSD tools.
Now ntpleapfetch fails later in the process.
- - - - -
1 changed file:
- ntpclients/ntpleapfetch
Changes:
=====================================
ntpclients/ntpleapfetch
=====================================
@@ -290,11 +290,11 @@ verifySHA1() {
# Remove comments, except those that are markers for last update, expires and hash
- local RAW="`sed -e'/^\\([0-9]\\|#[\$@h]\)/!d' -e'/^#[\$@h]/!s/#.*\$//g' $1`"
+ local RAW="`sed -ne'/^#[\$@h]/p;/^[^#]/s/.#.*$//p' $1 `"
# Extract just the data, removing all whitespace
- local DATA="`echo \"$RAW\" | sed -e'/^#h/d' -e's/^#[\$@]//g' | tr -d '[:space:]'`"
+ local DSHA1="`printf \"$DATA\" | $SHASUM | sed -e's/[? *].*$//'`"
# Compute the SHA1 hash of the data, removing the marker and filename
# Computed in binary mode, which shouldn't matter since whitespace
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4f37564b6942a9ac6104b7a65ae5486d878747f7
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4f37564b6942a9ac6104b7a65ae5486d878747f7
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20181212/14a6591a/attachment-0001.html>
More information about the vc
mailing list