]> git.cworth.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <david@tethera.net>
Wed, 29 Dec 2021 18:20:49 +0000 (14:20 -0400)
committerDavid Bremner <david@tethera.net>
Wed, 29 Dec 2021 18:20:49 +0000 (14:20 -0400)
configure
lib/open.cc
test/T055-path-config.sh

index d399457a92f36cd75810d0d226143852f2a3a811..e7bb7edcbda39ee4184689e7797532382c426d3e 100755 (executable)
--- a/configure
+++ b/configure
@@ -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}
index a91d22efe6ecbf5e133dc1daded781229f9bf0a9..54510eace89b04a565a1b868af2d7f88d44f1e66 100644 (file)
@@ -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;
        }
     }
 
index f0ce55dac93a494d51ab3eab9cb1c9bbcdb9c9a7..1df240dd0cec2665c17faebc2b833cf4ccac73c3 100755 (executable)
@@ -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