From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CBmgG32fzGH3JQEAgWs5BA (envelope-from ) for ; Wed, 29 Dec 2021 18:48:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KNJQFH2fzGG1EAAAG6o9tA (envelope-from ) for ; Wed, 29 Dec 2021 18:48:45 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 17496345C4 for ; Wed, 29 Dec 2021 18:48:45 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6CEA05F704; Wed, 29 Dec 2021 17:48:42 +0000 (UTC) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 682DA5F6C2 for ; Wed, 29 Dec 2021 17:48:39 +0000 (UTC) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 104961B0001D; Wed, 29 Dec 2021 19:48:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1640800119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xSfccll8BDZBhooj8LvgPhBoI8FIRNcbcW10TvQ00co=; b=Ffji2z3gGt43FryQk14WLwY+UZmwlRXgDDIm5XOdKhrBAnUtrA8dfhRKU7hmsYCssBvbdV Imu+qVtI0twIZSN66HKfEyzLrKbFxPP462iDx8G5T1PqSstsBX6MWHMjNpCRizyhVOa+4i cVHBCOX8xREvYGtrubCJ14gI1bUliErJmSJlLwK1eNHCCTIMo4CA4FSRhO1xt6H24i6jnI rB2km5yj6Riu6OC7PBgZySmVOxgYI3JBx8Feh3gvSkN89PSUZD02xw+u8Ku1r8DdLs1j8p sJRENR+L2SGig9wjuR8d3rfAWeOi1pM6w9aRmrOM/GUfgEUkAb6yCTiSkn0HtQ== From: Tomi Ollila To: David Bremner , David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] lib/open: do not consider .notmuch alone as an existing database. In-Reply-To: <20211225212256.3302545-2-david@tethera.net> References: <87a6h3xsir.fsf@tethera.net> <20211225212256.3302545-1-david@tethera.net> <20211225212256.3302545-2-david@tethera.net> User-Agent: Notmuch/0.33+54~gcaf4513 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1640800119; a=rsa-sha256; cv=none; b=RncPBjEQF3ZIhOtHiA+ilOrMKLy4UjP6tGe/2l8PHJTDHfKl+jry0OW7PUR4b9ZLZjrwfd w5iVt+k9YrSTe1zXnI75X5/sPMntHRSV4KmbKu3CamQyRS+98mclZ+WZ811vctlROLeqLk 2Idqe7yFF6qV+tOa0VT6RvJpKctcI5aJbHapfrR/PQLpRDDN2epzHUs3b+rLMoX9N3EKj5 s1MuyKespXRCVm6gkg85ky14ml9zSn1wrxLrVn8nX2TDv1JJnVNfGN3HPDpxHvyW88CYHd btgWrqijtpUnuBlks2a7wtYCcDOop2fWorpFoCGC39hbKklYKFSdCKnZMvo9Ug== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1640800119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xSfccll8BDZBhooj8LvgPhBoI8FIRNcbcW10TvQ00co=; b=EJN3aQGIsympCzcNt83cscrB+1nSRzi/E0GbqFqYRxuCmLLTsTwuUEpHGDrZVm5SOgxL8V Dsagdw5d+51eJXSbBZXzrzDPxgsYFcl8kq617/7tAgOMCGqehidj48tI3kYzl8ZhWD1sGf ts8Kw767oyFNLBHfNSzK2gLo5C4Gn510fOMA784KWtRlpuwNFm7ziUNMV18cC4XduWdzVH nWvQeEgYUDmldU7FsucAjJA1vfm0kxTlZRYDwcs/IHX2fJtzEuydX9S0QfgwK0iYFROtU1 46AWU/v1qoOFpJoAIkaMHODI4WwLofh/zGf0zQQLOp8mlMUoWlhLv6oWoJbAIw== Message-ID-Hash: 3HBP5GDWBF4A4NL46GVJJJT67YANOOC6 X-Message-ID-Hash: 3HBP5GDWBF4A4NL46GVJJJT67YANOOC6 X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640800125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=o05SWCGgMfhheBw85bT4ZMh9AbJvmW6jNTap2ZKYa4o=; b=C2fMudEH2Kq1rdKAFK3rbILlvqxW0OoRuXfaEtRf3/CucRneVqZ7UgiFS5zfcCtlNoOUfx 8X7yg34hpXXhIVpz6eAoqfrs0rn7e8cm62Jdy02i/Q3CEiaj0t5mbbJ4bP0gLyOkZScpfy 85itPf0mUrYfAbSmVNUQpKV/JX4iXLucS16rI1MUiBovUzPt6WbHxtTLUYE28SLiUH/V0Q I3L4PCMhtrsonqZBpoC5pHt+Sgh5RGtkgwjNrNXCjxcr88E83FNIQEEXMU/cwJnmkJgRLO EdMYlMS/EZ1B5Wi9XMghDMlxVrhUznHhmMwmV8Tzq91+TKPTNZ1ctq7rRP8ToA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1640800125; a=rsa-sha256; cv=fail; b=tm5GALqWK/yVr6XQyrgSGfqJe0YDix3FLxBJJTANicadmkGqmT5fBnfVA9lLOexmKI7kex ybz2FWk3vdVU9ksQozv7O7qqSLQr8JcIioRExHP+ZSG8Y2fDx8XGu6st5TLXuPUK+qtQiN DocvGDM5xzWMKtPIqFAZaCJbx8ByLl4K1olac666bDVDh6V69Ptvd8MJlbSHuNIfeBLbzz lKvAf3emmb0QNFplNdIDnEgwRReoLdG4DuAUcmoAgkGcKq6WbTS88gGkVBOSq5Sm0mWlpB h4q8Vs5NfhLOLxtIy9mvbt1uY40nWvYg4Y80o0V5d+zruafoqReDu81vmlT8OQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=Ffji2z3g; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.25 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=Ffji2z3g; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 17496345C4 X-Spam-Score: -1.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: dsPy5dnT4V5m On Sat, Dec 25 2021, David Bremner wrote: > It makes perfect sense for users to want to pre-create .notmuch, > e.g. to install hooks, so we should handle the case of a .notmuch > directory without an actual xapian database more gracefully. Series LGTM. Tomi > --- > lib/open.cc | 8 ++------ > test/T055-path-config.sh | 1 - > 2 files changed, 2 insertions(+), 7 deletions(-) > > 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 374aea3b..1df240dd 100755 > --- a/test/T055-path-config.sh > +++ b/test/T055-path-config.sh > @@ -322,7 +322,6 @@ EOF > *) > backup_database > test_begin_subtest ".notmuch without xapian/ handled gracefully ($config)" > - test_subtest_known_broken > rm -r $XAPIAN_PATH > test_expect_success "notmuch new" > restore_database > -- > 2.34.1 > > _______________________________________________ > notmuch mailing list -- notmuch@notmuchmail.org > To unsubscribe send an email to notmuch-leave@notmuchmail.org