From ab7d2890a47f051a892b05b4d551de0e5c5c8282 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 26 Sep 2011 12:41:27 -0500 Subject: pacman-key: refine and clarify import/import-trustdb behavior * --import now only imports keys from pubkey.gpg and does not import owner trust; if you want to have both simply run the operations in sequence. * --import-trustdb has been simplified; it will overwrite existing values in the trust database as before, but there is no need to export it first as those values are safe if left untouched. * Fix the manpage referring to a non-existent option. Signed-off-by: Dan McGee --- scripts/pacman-key.sh.in | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 7eebf7c8..da07492c 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -74,7 +74,7 @@ usage() { echo "$(gettext " --edit-key Present a menu for key management task on keyids")" printf "$(gettext " --gpgdir Set an alternate directory for GnuPG (instead\n\ of '%s')")\n" "@sysconfdir@/pacman.d/gnupg" - echo "$(gettext " --import Imports pubring.gpg and trustdb.gpg from dir(s)")" + echo "$(gettext " --import Imports pubring.gpg from dir(s)")" echo "$(gettext " --import-trustdb Imports ownertrust values from trustdb.gpg in dir(s)")" echo "$(gettext " --init Ensure the keyring is properly initialized")" echo "$(gettext " --keyserver Specify a keyserver to use if necessary")" @@ -343,30 +343,23 @@ edit_keys() { import_trustdb() { local importdir - local trustdb=$(mktemp) - "${GPG_PACMAN[@]}" --export-ownertrust > ${trustdb} for importdir in "${IMPORT_DIRS[@]}"; do if [[ -f "${importdir}/trustdb.gpg" ]]; then - gpg --homedir "${importdir}" --export-ownertrust >> ${trustdb} + gpg --homedir "${importdir}" --export-ownertrust | \ + "${GPG_PACMAN[@]}" --import-ownertrust - fi done - - "${GPG_PACMAN[@]}" --import-ownertrust ${trustdb} - rm -f ${trustdb} } import() { local importdir - # Imports public keys, then import trustdbs for importdir in "${IMPORT_DIRS[@]}"; do if [[ -f "${importdir}/pubring.gpg" ]]; then "${GPG_PACMAN[@]}" --quiet --batch --import "${importdir}/pubring.gpg" fi done - - import_trustdb } # PROGRAM START -- cgit v1.2.3-24-g4f1b