FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-09-2011, 02:00 AM
Allan McRae
 
Default pacman-key: add --verify option

Signed-off-by: Allan McRae <allan@archlinux.org>
---
doc/pacman-key.8.txt | 5 ++++-
scripts/pacman-key.sh.in | 10 +++++++---
2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/doc/pacman-key.8.txt b/doc/pacman-key.8.txt
index f961bc2..2771ece 100644
--- a/doc/pacman-key.8.txt
+++ b/doc/pacman-key.8.txt
@@ -72,7 +72,10 @@ Options
*-u, --updatedb*::
Equivalent to --check-trustdb in GnuPG.

-*-v, --version*::
+* -v, --verify* <signature>::
+ Verify the given signature file.
+
+*-V, --version*::
Displays the program version.


diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 55c2abe..5324418 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -36,6 +36,7 @@ LIST=0
RECEIVE=0
RELOAD=0
UPDATEDB=0
+VERIFY=0

m4_include(library/output_format.sh)

@@ -57,6 +58,7 @@ usage() {
echo "$(gettext " -l, --list List keys")"
echo "$(gettext " -r, --receive <keyserver> <keyid(s)> Fetch the specified keyids")"
echo "$(gettext " -u, --updatedb Update the trustdb of pacman")"
+ echo "$(gettext " -v, --verify <signature> Verify the file specified by the signature")"
echo "$(gettext " -V, --version Show program version")"
echo "$(gettext " --config <file> Use an alternate config file")"
printf "$(gettext " (instead of '%s')")
" "@sysconfdir@/pacman.conf"
@@ -241,9 +243,9 @@ if ! type gettext &>/dev/null; then
}
fi

-OPT_SHORT="a::d:e:f::hlr:t:uV"
+OPT_SHORT="a::d:e:f::hlr:t:uv:V"
OPT_LONG="add,adv:,config:,del:,export::,finger::, gpgdir:,help,list"
-OPT_LONG+=",receive:,reload,trust:,updatedb,versio n"
+OPT_LONG+=",receive:,reload,trust:,updatedb,verif y:,version"
if ! OPT_TEMP="$(parse_options $OPT_SHORT $OPT_LONG "$@")"; then
echo; usage; exit 1 # E_INVALID_OPTION;
fi
@@ -268,6 +270,7 @@ while true; do
-r|--receive) RECEIVE=1; shift; KEYSERVER="${1[0]}"; KEYIDS=("${1[@]:1}") ;;
--reload) RELOAD=1 ;;
-u|--updatedb) UPDATEDB=1 ;;
+ -v|--verify) VERIFY=1; shift; SIGNATURE=$1 ;;

-h|--help) usage; exit 0 ;;
-V|--version) version; exit 0 ;;
@@ -309,7 +312,7 @@ PACMAN_KEYRING_DIR=${PACMAN_KEYRING_DIR:-@sysconfdir@/pacman.d/gnupg}
GPG_PACMAN="gpg --homedir ${PACMAN_KEYRING_DIR} --no-permission-warning"

# check only a single operation has been given
-numopt=$(( ADD + DELETE + EDITKEY + EXPORT + FINGER + LIST + RECEIVE + RELOAD + UPDATEBD ))
+numopt=$(( ADD + DELETE + EDITKEY + EXPORT + FINGER + LIST + RECEIVE + RELOAD + UPDATEBD + VERIFY ))

if (( ! numopt )); then
error "$(gettext "No operations specified")"
@@ -334,5 +337,6 @@ fi
(( RECEIVE )) && receive_keys
(( RELOAD )) && reload_keyring
(( UPDATEDB )) && ${GPG_PACMAN} --batch --check-trustdb
+(( VERIFY )) && ${GPG_PACMAN} --verify $SIGNATURE

# vim: set ts=2 sw=2 noet:
--
1.7.6
 

Thread Tools




All times are GMT. The time now is 02:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org