X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=4c9f2a2103e32a18c2c14dc257669300ecbe4d6f;hb=319dcfb50e5bc929719167afa353e19632ea55f3;hp=1f438042909d7115778ef19efe47c37ef709b0c4;hpb=2e9ee47072e161e85d2ac60515d1c922ea881e40;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index 1f438042..4c9f2a21 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -104,6 +104,9 @@ unset CDPATH unset GREP_OPTIONS +# For lib/open.cc:_load_key_file +unset XDG_CONFIG_HOME + # For emacsclient unset ALTERNATE_EDITOR @@ -697,12 +700,20 @@ notmuch_built_with_sanitize () sed 's/^built_with[.]\(.*\)=.*$/built_with.\1=something/' } -notmuch_passwd_sanitize () +notmuch_passwd_sanitize() { - local user=$(id -un) - local fqdn=$(hostname -f) - local full_name=$(getent passwd $user | cut -d: -f 5 | cut -d, -f1) - sed -e "s/$user/USERNAME/" -e "s/$fqdn/FQDN/" -e "s/$full_name/USER_FULL_NAME/" + ${NOTMUCH_PYTHON} -c' +import os, sys, pwd, socket + +pw = pwd.getpwuid(os.getuid()) +user = pw.pw_name +name = pw.pw_gecos.partition(",")[0] +fqdn = socket.getfqdn() + +for l in sys.stdin: + l = l.replace(user, "USERNAME").replace(fqdn, "FQDN").replace(".(none)","").replace(name, "USER_FULL_NAME") + sys.stdout.write(l) +' } notmuch_config_sanitize () @@ -1128,7 +1139,7 @@ notmuch_with_shim () { base_name="$1" shift shim_file="${base_name}.so" - LD_PRELOAD=./${shim_file}${LD_PRELOAD:+:$LD_PRELOAD} notmuch-shared "$@" + LD_PRELOAD=${LD_PRELOAD:+:$LD_PRELOAD}:./${shim_file} notmuch-shared "$@" } # Creates a script that counts how much time it is executed and calls