X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/7a128512684cd0ece3d4dde369ebc5b7af360f06..9a0f997bac85d8f234238162f3cee4524b6f989c:/src/util/renew-opendmarc-tlds.sh diff --git a/src/util/renew-opendmarc-tlds.sh b/src/util/renew-opendmarc-tlds.sh index 2ce937699..d626aac37 100755 --- a/src/util/renew-opendmarc-tlds.sh +++ b/src/util/renew-opendmarc-tlds.sh @@ -1,4 +1,6 @@ #!/bin/sh -eu +# Copyright (c) The Exim Maintainers 2022 +# SPDX-License-Identifier: GPL-2.0-or-later # # Short version of this script: # curl -f -o /var/cache/exim/opendmarc.tlds https://publicsuffix.org/list/public_suffix_list.dat @@ -24,7 +26,8 @@ # This should be "pretty portable"; the only things it depends upon are: # * a POSIX shell which additionally implements 'local' (dash works) # * the 'curl' command; change the fetch_candidate() function to replace that -# * the 'stat' command, to get the size of a file; change size_of() if need be +# * the 'stat' command, to get the size of a file; else Perl +# + change size_of() if need be; it's defined per-OS # * the 'hexdump' command and /dev/urandom existing # + used when invoked with 'cron', to avoid retrieving on a minute boundary # and contending with many other automated systems. @@ -84,8 +87,10 @@ case $(uname -s) in Linux) size_of() { stat -c %s "$1"; } ;; -*) # optimism? - size_of() { stat -c %s "$1"; } +*) + # why do we live in a world where Perl is the safe portable solution + # to getting the size of a file? + size_of() { perl -le 'print((stat($ARGV[0]))[7])' -- "$1"; } ;; esac