[pacman-dev] [PATCH 3/3] pacman-key: better handling of options and supressing gpg output

Denis A. Altoé Falqueto denisfalqueto at gmail.com
Mon Feb 21 21:04:08 EST 2011

On Sat, Feb 19, 2011 at 12:33 PM, Allan McRae <allan at archlinux.org> wrote:
>> +               if ! ${GPG_PACMAN} --quiet --verify "${ADDED_KEYS}.sig"
>> 1>/dev/null 2>&1; then
> using "&>/dev/null" would be cleaner.  And given --quiet is obviously not
> doing much, should we just remove it?
> As an aside, the man page for gpg says --verify should "verify it without
> generating any output".  Clearly there is output...

Yes, really weird...

>> +       case "$arg" in
>> +               --config) isconfig=1;;
>> +               --gpgdir) isgpgdir=1;;
> This leaves --config and --gpgdir in "$@".  So if I run (e.g.)
> "pacman-key --delete <keyid> --config <file>"
> Then the command run will be:
> ${GPG_PACMAN} --quiet --batch --delete-key --yes "$@"
> where "$@" is expanded to "<keyid> --config <file>", which clearly is bad...
>  So this needs to be slightly more clever.

I've remade the code. Now, it iterates over the parameters and creates
another vector for the values that are not related to --config and
--gpgdir. The real processing is made over the vector, not over $@. It
is a little uncommon, but pacman-key must know beforehand what is the
configuration and gpg home.

I'll resend the patches as a reply just after this mail.

A: Because it obfuscates the reading.
Q: Why is top posting so bad?

Denis A. Altoe Falqueto
Linux user #524555

More information about the pacman-dev mailing list