X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Fcommon.sh;h=b869d56dfed711f55fa77e1ddc7c68c3d14e44e0;hb=d44d7ab7f82b27b1644c7ec93bdbe0fedc0fb4c5;hp=d195a7cf5d24b35d81c0b6e5e18ccc06602f4473;hpb=82325c1114254a76b8285bb710b2f651674331c7;p=mmh diff --git a/test/common.sh b/test/common.sh index d195a7c..b869d56 100644 --- a/test/common.sh +++ b/test/common.sh @@ -52,10 +52,16 @@ require_locale() test_skip "no suitable locale available" } +# Do a best guess at FQDN +mh_hostname() +{ + hostname -f 2>/dev/null || uname -n +} + # Some stuff for doing silly progress indicators progress_update() { - test -t 1 || return 0 # supress progress meter if non-interactive + test -t 1 || return 0 # suppress progress meter if non-interactive this="$1" first="$2" last="$3" @@ -69,11 +75,17 @@ progress_update() progress_done() { - test -t 1 || return 0 # supress progress meter if non-interactive + test -t 1 || return 0 # suppress progress meter if non-interactive printf "100%%\n" } +#### Replace generated Content-ID headers with static value +replace_contentid() +{ + sed "/^Content-ID/s/:.*/: /" "$@" +} + #### Filter that squeezes blank lines, partially emulating GNU cat -s, #### but sufficient for our purpose.