contrib: remove wget-xdelta from gitignore

I removed this in ff713a51 over a year ago.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
contrib: remove pactree make rule

This is a vestige leftover from the rewrite over a year ago in
622e7fdd4.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
pkgdelta: rework option/argument parser

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
pkgdelta: implement requirments for delta generation

Big deltas or deltas for very small packages are not needed so we should
check that and not generate any.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
pkgdelta/repo-add: quoting fixes

This removes some unnecessary quotes and adds quotes in a few places to
hopefully work correctly if the tempdir has spaces.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
makepkg: restrict allowed characters in pkgname

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
configure: avoid linking against libssl

We're not linking to libssl, only libcrypto. -Wl,--as-needed will get
rid of this, but there's no sense in checking for and linking against a
library we don't need.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
scripts/library: introduce parseopts

This will replace our current options parser used in pacman-key,
makepkg, and ideally elsewhere. It follows heuristics closer to that of
GNU getopt long (and thus pacman itself), with the exception that it
does not allow for options with optional arguments. Due to the way this
parser will be used, this sort of functionality will not be needed.

Instead of relying on eval+set, options are normalized into an array,
OPTRET, which callers should expect to be populated after returning from
parseopts. This avoids problems with quotes and spaces in arguments,
assuming that the user quotes properly when passing into the
application.

A new test harness for parseopts is added in test/scripts.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
makepkg: adopt parseopts for option parsing

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
makepkg: allow specifying --pkg multiple times

Make this option additive, so that the following two operations are
equivalent:

  makepkg --pkg foo --pkg bar
  makepkg --pkg foo,bar
pacman-key: adopt parseopts for option parsing

This requires an ugly amount of reworking of how pacman-key handles
options. The change simply to avoid passing keys, files, and directories
as arguments to options, but to leave them as arguments to the overall
program. This is reasonable since pacman-key limits the user to
essentially one operation per invocation (like pacman).

Since we now pass around the positional parameters to the various
operations, we can add some better sanity checking. Each operation is
responsible for testing input and making sure it can operate properly,
otherwise it throws an error and exits.

The doc is updated to reflect this, and uses similar verbiage as pacman,
describing the non-option arguments now passed to pacman-key as targets.

Similar to the doc, --help is reorganized to separate operations and
options and remove argument tokens from operations.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
scripts: avoid dumping usage on parser fail

Avoid letting the error message from parseopts get lost in the usage
output from pacman-key and makepkg (which is already verbose).
bash_completion: update for changes to pacman-key

- only do file completion for options which expect files
- add completion for possible key ids when a relevant operation is in
  COMPWORDS.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
scripts/library: remove parse_options

This is retired, as the two consumers of this function are now using the
new parseopts instead.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
pacman-key: allow verification of multiple sig files

Loop through arguments passed to verify_sig and treat each as a
signature to be verified against a source file. Output each file as its
checked to avoid ambiguity.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
makepkg.8: remove bold from --pkg's optarg

Keep this in line with the rest of the manpages.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Merge branch 'parse-opts'
Merge branch 'maint'

Conflicts:
	scripts/repo-add.sh.in
pacman-key: lookup keys before receiving

Perform a search for keys that clearly aren't key IDs. This allows
receiving keys by name or email address, but only if the key resolves
unambiguously.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
patch to add zsh completion to pacman-key

This patch adds a _pacman_key function to the _pacman zsh site function
so that zsh users can have completion for pacman-key <keyids> and other
files which may be used with pacman-key

Signed-off-by: Daniel Wallace <daniel.wallace@gatech.edu>