diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-10-29 20:30:09 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-10-29 20:31:38 +0100 |
commit | cfc99dd12a50fac812fd55128771c500a9b9566f (patch) | |
tree | d7352ffe7c51471afe458cdd6982ce51fba00bba /community/notmuch/fix-tests-for-python3.patch | |
parent | 648e695f0375d80383ca47f003e63a39ca712611 (diff) | |
download | aports-cfc99dd12a50fac812fd55128771c500a9b9566f.tar.bz2 aports-cfc99dd12a50fac812fd55128771c500a9b9566f.tar.xz |
community/notmuch: use python3 for building and fix tests
This may also hopefully fix build on armhf...
Diffstat (limited to 'community/notmuch/fix-tests-for-python3.patch')
-rw-r--r-- | community/notmuch/fix-tests-for-python3.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/community/notmuch/fix-tests-for-python3.patch b/community/notmuch/fix-tests-for-python3.patch new file mode 100644 index 0000000000..1b71751db4 --- /dev/null +++ b/community/notmuch/fix-tests-for-python3.patch @@ -0,0 +1,20 @@ +Fix test-lib.sh for Python 3.5+. + +Since Python 3.5 json.tool does not sort JSON keys unless --sort-keys +is specified. +See https://docs.python.org/3/library/json.html#module-json.tool. + +--- a/test/test-lib.sh ++++ b/test/test-lib.sh +@@ -627,9 +627,9 @@ + # The test suite forces LC_ALL=C, but this causes Python 3 to + # decode stdin as ASCII. We need to read JSON in UTF-8, so + # override Python's stdio encoding defaults. +- output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \ ++ output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool --sort-keys \ + || echo "$1") +- expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \ ++ expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool --sort-keys \ + || echo "$2") + shift 2 + test_expect_equal "$output" "$expected" "$@" |