mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-28 05:34:11 +01:00
config: deprecate/drop crypto.gpg_path under gmime 2.6/3.0
gmime 3.0 no longer offers a means to set the path for gpg. Users can set $PATH anyway if they want to pick a differently-installed gpg (e.g. /usr/local/bin/gpg), so this isn't much of a reduction in functionality. The one main difference is for people who have tried to use "gpg2" to make use of gpg 2.1, but that isn't usefully co-installable anyway.
This commit is contained in:
parent
8492298a61
commit
e142de643d
7 changed files with 42 additions and 7 deletions
|
@ -128,7 +128,9 @@ The available configuration items are described below.
|
||||||
**crypto.gpg_path**
|
**crypto.gpg_path**
|
||||||
|
|
||||||
Name (or full path) of gpg binary to use in verification and
|
Name (or full path) of gpg binary to use in verification and
|
||||||
decryption of PGP/MIME messages.
|
decryption of PGP/MIME messages. NOTE: This configuration
|
||||||
|
item is deprecated, and will be ignored if notmuch is built
|
||||||
|
against GMime 3.0 or later.
|
||||||
|
|
||||||
Default: ``gpg``.
|
Default: ``gpg``.
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,9 @@ typedef struct notmuch_crypto {
|
||||||
notmuch_crypto_context_t* pkcs7ctx;
|
notmuch_crypto_context_t* pkcs7ctx;
|
||||||
notmuch_bool_t verify;
|
notmuch_bool_t verify;
|
||||||
notmuch_bool_t decrypt;
|
notmuch_bool_t decrypt;
|
||||||
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
const char *gpgpath;
|
const char *gpgpath;
|
||||||
|
#endif
|
||||||
} notmuch_crypto_t;
|
} notmuch_crypto_t;
|
||||||
|
|
||||||
typedef struct notmuch_show_params {
|
typedef struct notmuch_show_params {
|
||||||
|
@ -289,12 +291,14 @@ void
|
||||||
notmuch_config_set_database_path (notmuch_config_t *config,
|
notmuch_config_set_database_path (notmuch_config_t *config,
|
||||||
const char *database_path);
|
const char *database_path);
|
||||||
|
|
||||||
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
const char *
|
const char *
|
||||||
notmuch_config_get_crypto_gpg_path (notmuch_config_t *config);
|
notmuch_config_get_crypto_gpg_path (notmuch_config_t *config);
|
||||||
|
|
||||||
void
|
void
|
||||||
notmuch_config_set_crypto_gpg_path (notmuch_config_t *config,
|
notmuch_config_set_crypto_gpg_path (notmuch_config_t *config,
|
||||||
const char *gpg_path);
|
const char *gpg_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
notmuch_config_get_user_name (notmuch_config_t *config);
|
notmuch_config_get_user_name (notmuch_config_t *config);
|
||||||
|
|
|
@ -104,10 +104,20 @@ static const char search_config_comment[] =
|
||||||
static const char crypto_config_comment[] =
|
static const char crypto_config_comment[] =
|
||||||
" Cryptography related configuration\n"
|
" Cryptography related configuration\n"
|
||||||
"\n"
|
"\n"
|
||||||
" The following option is supported here:\n"
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
|
" The following *deprecated* option is currently supported:\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\tgpg_path\n"
|
"\tgpg_path\n"
|
||||||
"\t\tbinary name or full path to invoke gpg.\n";
|
"\t\tbinary name or full path to invoke gpg.\n"
|
||||||
|
"\t\tNOTE: In a future build, this option will be ignored.\n"
|
||||||
|
#else
|
||||||
|
" The following old option is now ignored:\n"
|
||||||
|
"\n"
|
||||||
|
"\tgpgpath\n"
|
||||||
|
"\t\tThis option was used by older builds of notmuch to choose\n"
|
||||||
|
"\t\tthe version of gpg to use.\n"
|
||||||
|
#endif
|
||||||
|
"\t\tSetting $PATH is a better approach.\n";
|
||||||
|
|
||||||
struct _notmuch_config {
|
struct _notmuch_config {
|
||||||
char *filename;
|
char *filename;
|
||||||
|
@ -460,10 +470,12 @@ notmuch_config_open (void *ctx,
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
if (notmuch_config_get_crypto_gpg_path (config) == NULL) {
|
if (notmuch_config_get_crypto_gpg_path (config) == NULL) {
|
||||||
notmuch_config_set_crypto_gpg_path (config, "gpg");
|
notmuch_config_set_crypto_gpg_path (config, "gpg");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Whenever we know of configuration sections that don't appear in
|
/* Whenever we know of configuration sections that don't appear in
|
||||||
* the configuration file, we add some comments to help the user
|
* the configuration file, we add some comments to help the user
|
||||||
* understand what can be done. */
|
* understand what can be done. */
|
||||||
|
@ -752,6 +764,7 @@ notmuch_config_set_search_exclude_tags (notmuch_config_t *config,
|
||||||
&(config->search_exclude_tags));
|
&(config->search_exclude_tags));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
const char *
|
const char *
|
||||||
notmuch_config_get_crypto_gpg_path (notmuch_config_t *config)
|
notmuch_config_get_crypto_gpg_path (notmuch_config_t *config)
|
||||||
{
|
{
|
||||||
|
@ -764,6 +777,7 @@ notmuch_config_set_crypto_gpg_path (notmuch_config_t *config,
|
||||||
{
|
{
|
||||||
_config_set (config, &config->crypto_gpg_path, "crypto", "gpg_path", gpg_path);
|
_config_set (config, &config->crypto_gpg_path, "crypto", "gpg_path", gpg_path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Given a configuration item of the form <group>.<key> return the
|
/* Given a configuration item of the form <group>.<key> return the
|
||||||
|
|
|
@ -740,7 +740,9 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config);
|
params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (notmuch_database_open (notmuch_config_get_database_path (config),
|
if (notmuch_database_open (notmuch_config_get_database_path (config),
|
||||||
NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))
|
NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))
|
||||||
|
|
|
@ -1183,7 +1183,9 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (GMIME_MAJOR_VERSION < 3)
|
||||||
params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config);
|
params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (notmuch_database_open (notmuch_config_get_database_path (config),
|
if (notmuch_database_open (notmuch_config_get_database_path (config),
|
||||||
NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))
|
NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))
|
||||||
|
|
|
@ -44,6 +44,12 @@ test_expect_equal "$(notmuch config get foo.nonexistent)" ""
|
||||||
|
|
||||||
test_begin_subtest "List all items"
|
test_begin_subtest "List all items"
|
||||||
notmuch config list 2>&1 | notmuch_config_sanitize > OUTPUT
|
notmuch config list 2>&1 | notmuch_config_sanitize > OUTPUT
|
||||||
|
|
||||||
|
if [ "${NOTMUCH_GMIME_MAJOR}" -lt 3 ]; then
|
||||||
|
config_gpg_path="crypto.gpg_path=gpg
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
cat <<EOF > EXPECTED
|
cat <<EOF > EXPECTED
|
||||||
Error opening database at MAIL_DIR/.notmuch: No such file or directory
|
Error opening database at MAIL_DIR/.notmuch: No such file or directory
|
||||||
database.path=MAIL_DIR
|
database.path=MAIL_DIR
|
||||||
|
@ -54,8 +60,7 @@ new.tags=unread;inbox;
|
||||||
new.ignore=
|
new.ignore=
|
||||||
search.exclude_tags=
|
search.exclude_tags=
|
||||||
maildir.synchronize_flags=true
|
maildir.synchronize_flags=true
|
||||||
crypto.gpg_path=gpg
|
${config_gpg_path}foo.string=this is another string value
|
||||||
foo.string=this is another string value
|
|
||||||
foo.list=this;is another;list value;
|
foo.list=this;is another;list value;
|
||||||
built_with.compact=something
|
built_with.compact=something
|
||||||
built_with.field_processor=something
|
built_with.field_processor=something
|
||||||
|
|
|
@ -19,6 +19,12 @@ another.suite@example.com
|
||||||
foo bar
|
foo bar
|
||||||
baz
|
baz
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ "${NOTMUCH_GMIME_MAJOR}" -lt 3 ]; then
|
||||||
|
config_gpg_path="crypto.gpg_path=gpg
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
output=$(notmuch --config=new-notmuch-config config list | notmuch_built_with_sanitize)
|
output=$(notmuch --config=new-notmuch-config config list | notmuch_built_with_sanitize)
|
||||||
test_expect_equal "$output" "\
|
test_expect_equal "$output" "\
|
||||||
database.path=/path/to/maildir
|
database.path=/path/to/maildir
|
||||||
|
@ -29,7 +35,7 @@ new.tags=foo;bar;
|
||||||
new.ignore=
|
new.ignore=
|
||||||
search.exclude_tags=baz;
|
search.exclude_tags=baz;
|
||||||
maildir.synchronize_flags=true
|
maildir.synchronize_flags=true
|
||||||
crypto.gpg_path=gpg
|
""${config_gpg_path}""\
|
||||||
built_with.compact=something
|
built_with.compact=something
|
||||||
built_with.field_processor=something
|
built_with.field_processor=something
|
||||||
built_with.retry_lock=something"
|
built_with.retry_lock=something"
|
||||||
|
|
Loading…
Reference in a new issue