aboutsummaryrefslogtreecommitdiff
path: root/test/T055-path-config.sh
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-05-10 07:39:18 -0300
committerDavid Bremner <david@tethera.net>2021-05-15 08:40:05 -0300
commitb3258244c84a7673db39c46cad96ddb63b131dae (patch)
tree404daa0604888bcd7c5063fa83fecbdcf4bf0de0 /test/T055-path-config.sh
parent0e8795b28c809861e81dd50653a5355333cbcd59 (diff)
lib/open: restore default database path of $HOME/mail
Although this default worked for "notmuch config get", it didn't work most other places. Restore the previous functionality, with the wrinkle that XDG locations will shadow $HOME/mail if they exist. This fixes a bug reported by Jack Kamm in id:87eeefdc8b.fsf@gmail.com
Diffstat (limited to 'test/T055-path-config.sh')
-rwxr-xr-xtest/T055-path-config.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 2045a555..8ef76aed 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -16,6 +16,7 @@ restore_config () {
unset DATABASE_PATH
unset NOTMUCH_PROFILE
unset XAPIAN_PATH
+ rm -f "$HOME/mail"
cp notmuch-config-backup.${test_name} ${NOTMUCH_CONFIG}
}
@@ -42,6 +43,18 @@ symlink_config () {
unset DATABASE_PATH
}
+
+home_mail_config () {
+ local dir
+ backup_config
+ dir="${HOME}/mail"
+ ln -s $MAIL_DIR $dir
+ notmuch config set database.path
+ notmuch config set database.mail_root
+ XAPIAN_PATH="$MAIL_DIR/.notmuch/xapian"
+ unset DATABASE_PATH
+}
+
xdg_config () {
local dir
local profile=${1:-default}
@@ -66,7 +79,7 @@ xdg_config () {
notmuch --config=${CONFIG_PATH} config set database.path
}
-for config in traditional split XDG XDG+profile symlink; do
+for config in traditional split XDG XDG+profile symlink home_mail; do
#start each set of tests with an known set of messages
add_email_corpus
@@ -90,6 +103,9 @@ for config in traditional split XDG XDG+profile symlink; do
symlink)
symlink_config
;;
+ home_mail)
+ home_mail_config
+ ;;
esac
test_begin_subtest "count ($config)"
@@ -236,7 +252,9 @@ EOF
test_begin_subtest "Config list ($config)"
notmuch config list | notmuch_dir_sanitize | sed -e "s/^database.backup_dir=.*$/database.backup_dir/" \
-e "s/^database.hook_dir=.*$/database.hook_dir/" \
- -e "s/^database.path=.*$/database.path/" > OUTPUT
+ -e "s/^database.path=.*$/database.path/" \
+ -e "s,^database.mail_root=CWD/home/mail,database.mail_root=MAIL_DIR," \
+ > OUTPUT
cat <<EOF > EXPECTED
built_with.compact=true
built_with.field_processor=true