mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
gpg: Make --dry-run and show-only work for secret keys.
* g10/import.c (import_secret_one): Check for dry-run before transferring keys. -- The use of --dry-run or --import-option show-only had no effect when importing a secret key and the public key already existed. If the public key did not exist an error message inhibited the import of the secret key. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
1ba308aa03
commit
68c8619114
@ -2532,7 +2532,8 @@ import_secret_one (ctrl_t ctrl, kbnode_t keyblock,
|
|||||||
/* At least we cancel the secret key import when the public key
|
/* At least we cancel the secret key import when the public key
|
||||||
import was skipped due to MERGE_ONLY option and a new
|
import was skipped due to MERGE_ONLY option and a new
|
||||||
key. */
|
key. */
|
||||||
if (stats->skipped_new_keys <= nr_prev)
|
if (!(opt.dry_run || (options & IMPORT_DRY_RUN))
|
||||||
|
&& stats->skipped_new_keys <= nr_prev)
|
||||||
{
|
{
|
||||||
/* Read the keyblock again to get the effects of a merge. */
|
/* Read the keyblock again to get the effects of a merge. */
|
||||||
/* Fixme: we should do this based on the fingerprint or
|
/* Fixme: we should do this based on the fingerprint or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user