unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 3109da8834cf223292830ff576f617fcd4e14315 844 bytes (raw)
name: test/export-dirs.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
# Source this script to set and export NOTMUCH_SRCDIR and
# NOTMUCH_BUILDDIR.
#
# For this to work, always have current directory somewhere within the
# build directory hierarchy, and run the script sourcing this script
# using a path (relative or absolute) to the source directory.

if [[ -z "${NOTMUCH_SRCDIR}" ]]; then
	export NOTMUCH_SRCDIR="$(cd "$(dirname "$0")"/.. && pwd)"
fi

find_builddir () {
	local dir="$1"

	while [[ -n "$dir" ]] && [[ "$dir" != "/" ]]; do
		if [[ -x "$dir/notmuch" ]] && [[ ! -d "$dir/notmuch" ]]; then
			echo "$dir"
			break
		fi
		dir="$(dirname "$dir")"
	done
}

if [[ -z "${NOTMUCH_BUILDDIR}" ]]; then
	export NOTMUCH_BUILDDIR="$(find_builddir "$(pwd)")"

	if [[ -z "${NOTMUCH_BUILDDIR}"  &&  -z "${NOTMUCH_TEST_INSTALLED}" ]]; then
		echo "Run tests in a subdir of built notmuch tree." >&2
		exit 1
	fi
fi

debug log:

solving 3109da88 ...
found 3109da88 in https://yhetil.org/notmuch/20211025145753.3031094-2-david@tethera.net/ ||
	https://yhetil.org/notmuch/20230104124145.2882983-4-david@tethera.net/ ||
	https://yhetil.org/notmuch/20230409142627.2216080-5-david@tethera.net/
found 0a048e1f in https://yhetil.org/notmuch.git/
preparing index
index prepared:
100644 0a048e1fe66940b914182c78400ad4dea8a8a94c	test/export-dirs.sh

applying [1/1] https://yhetil.org/notmuch/20211025145753.3031094-2-david@tethera.net/
diff --git a/test/export-dirs.sh b/test/export-dirs.sh
index 0a048e1f..3109da88 100644

Checking patch test/export-dirs.sh...
Applied patch test/export-dirs.sh cleanly.

skipping https://yhetil.org/notmuch/20230104124145.2882983-4-david@tethera.net/ for 3109da88
skipping https://yhetil.org/notmuch/20230409142627.2216080-5-david@tethera.net/ for 3109da88
index at:
100644 3109da8834cf223292830ff576f617fcd4e14315	test/export-dirs.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).