diff options
| author | David Bremner <david@tethera.net> | 2021-12-29 14:20:49 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-12-29 14:20:49 -0400 |
| commit | 3eb25c94bd8fe4065d6df6d665ee393cb9a0ad6f (patch) | |
| tree | 32de70bdd92cce6482af93375339e1f68c2cf8bb | |
| parent | 063f5e98620e2f2adeaa8b3313cdac85eb4ef4db (diff) | |
| parent | 14c4f9441d7fe0893003a5e793e19f1e55c9f73f (diff) | |
Merge branch 'release'
| -rwxr-xr-x | configure | 5 | ||||
| -rw-r--r-- | lib/open.cc | 8 | ||||
| -rwxr-xr-x | test/T055-path-config.sh | 9 |
3 files changed, 15 insertions, 7 deletions
@@ -55,6 +55,8 @@ subdirs="${subdirs} bindings" # the directory structure and copy Makefiles. if [ "$srcdir" != "." ]; then + NOTMUCH_BUILDDIR=$PWD + for dir in . ${subdirs}; do mkdir -p "$dir" cp "$srcdir"/"$dir"/Makefile.local "$dir" @@ -78,6 +80,8 @@ if [ "$srcdir" != "." ]; then "$srcdir"/bindings/python-cffi/notmuch2 \ "$srcdir"/bindings/python-cffi/setup.py \ bindings/python-cffi/ +else + NOTMUCH_BUILDDIR=$NOTMUCH_SRCDIR fi # Set several defaults (optionally specified by the user in @@ -1247,6 +1251,7 @@ cat > Makefile.config <<EOF # directory (the current directory at the time configure was run). srcdir = ${srcdir} NOTMUCH_SRCDIR = ${NOTMUCH_SRCDIR} +NOTMUCH_BUILDDIR = ${NOTMUCH_BUILDDIR} # subdirectories to build subdirs = ${subdirs} diff --git a/lib/open.cc b/lib/open.cc index a91d22ef..54510eac 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -661,16 +661,12 @@ notmuch_database_create_with_config (const char *database_path, err = mkdir (notmuch_path, 0755); if (err) { - if (errno == EEXIST) { - status = NOTMUCH_STATUS_DATABASE_EXISTS; - talloc_free (notmuch); - notmuch = NULL; - } else { + if (errno != EEXIST) { IGNORE_RESULT (asprintf (&message, "Error: Cannot create directory %s: %s.\n", notmuch_path, strerror (errno))); status = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; } - goto DONE; } } diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index f0ce55da..1df240dd 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -318,7 +318,14 @@ to=m.header('To') print(to) EOF test_expect_equal_file EXPECTED OUTPUT - ;& # fall through + ;; + *) + backup_database + test_begin_subtest ".notmuch without xapian/ handled gracefully ($config)" + rm -r $XAPIAN_PATH + test_expect_success "notmuch new" + restore_database + ;; esac case $config in |
