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 06-18-2012, 02:46 PM
Pierre Schmitz
 
Default pacman-key: Use lsign_keys function in --populate

This reduces code duplication and also makes --populate a non-interactive function.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
---
scripts/pacman-key.sh.in | 3 ++-
1 Datei geändert, 2 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index ae491d2..e5b6021 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -302,7 +302,7 @@ populate_keyring() {
msg "$(gettext "Locally signing trusted keys in keyring...")"
for key_id in "${!trusted_ids[@]}"; do
msg2 "$(gettext "Locally signing key %s...")" "${key_id}"
- "${GPG_PACMAN[@]}" --quiet --lsign-key "${key_id}"
+ lsign_keys "${key_id}"
done
msg "$(gettext "Importing owner trust values...")"
for keyring in "${KEYRINGIDS[@]}"; do
@@ -440,6 +440,7 @@ list_sigs() {

lsign_keys() {
check_keyids_exist
+ # we cannot use --yes here as gpg would still ask for confirmation if a key has more than one uid
printf 'y
y
' | LANG=C "${GPG_PACMAN[@]}" --command-fd 0 --quiet --batch --lsign-key "$@" 2>/dev/null
if (( PIPESTATUS[1] )); then
error "$(gettext "A specified key could not be locally signed.")"
--
1.7.10.4
 
Old 06-18-2012, 02:48 PM
Pierre Schmitz
 
Default pacman-key: Use lsign_keys function in --populate

Am 18.06.2012 16:46, schrieb Pierre Schmitz:
> lsign_keys() {
> check_keyids_exist
> + # we cannot use --yes here as gpg would still ask for confirmation
> if a key has more than one uid
> printf 'y
y
' | LANG=C "${GPG_PACMAN[@]}" --command-fd 0 --quiet
> --batch --lsign-key "$@" 2>/dev/null
> if (( PIPESTATUS[1] )); then
> error "$(gettext "A specified key could not be locally signed.")"

Just a note: This function looks like it would accept more than one
keyid, but it seems gpg wont handle that.

--
Pierre Schmitz, https://pierre-schmitz.com
 
Old 06-19-2012, 04:52 AM
Allan McRae
 
Default pacman-key: Use lsign_keys function in --populate

On 19/06/12 00:46, Pierre Schmitz wrote:
> This reduces code duplication and also makes --populate a non-interactive function.
>
> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
> ---
> scripts/pacman-key.sh.in | 3 ++-
> 1 Datei geändert, 2 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
>
> diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
> index ae491d2..e5b6021 100644
> --- a/scripts/pacman-key.sh.in
> +++ b/scripts/pacman-key.sh.in
> @@ -302,7 +302,7 @@ populate_keyring() {
> msg "$(gettext "Locally signing trusted keys in keyring...")"
> for key_id in "${!trusted_ids[@]}"; do
> msg2 "$(gettext "Locally signing key %s...")" "${key_id}"
> - "${GPG_PACMAN[@]}" --quiet --lsign-key "${key_id}"
> + lsign_keys "${key_id}"
> done
> msg "$(gettext "Importing owner trust values...")"
> for keyring in "${KEYRINGIDS[@]}"; do
> @@ -440,6 +440,7 @@ list_sigs() {
>
> lsign_keys() {
> check_keyids_exist
> + # we cannot use --yes here as gpg would still ask for confirmation if a key has more than one uid
> printf 'y
y
' | LANG=C "${GPG_PACMAN[@]}" --command-fd 0 --quiet --batch --lsign-key "$@" 2>/dev/null
> if (( PIPESTATUS[1] )); then
> error "$(gettext "A specified key could not be locally signed.")"
>

Ack.
 

Thread Tools




All times are GMT. The time now is 07:21 AM.

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