Add configuration option for Upgrade operation SigLevel

Add LocalFileSigLevel and RemoteFileSigLevel to control the signature
checking for "pacman -U <file>" and "pacman -U <url>" operations
respectively. The starting value for both these options is SigLevel,
if it is specified in the [options] section, or the built-in system
default. The specified values override and/or supplement this initial
value. Note there is no distinction between setting "Required" and
"PackageRequired" as there are no database options for Upgrade
operations.

Signed-off-by: Allan McRae <allan@archlinux.org>
Document LocalFileSigLevel and RemoteFileSigLevel

Signed-off-by: Allan McRae <allan@archlinux.org>
inline libarchive compat wrappers

Suggested-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
unset executable bit on updpkgsums.sh.in

No other contrib script is executable.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
add missing utilities to contrib/README

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
make test/scripts/human_to_size.sh executable

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: make $pkgdir non-accessible during build()

The idea of having separate build() and package() functions is that
build() is run as a normal uses and package() as (fake)root.  Any
files placed in $pkgdir during build() can have the wrong permissions.

Restrict access to $pkgdir during build() - unless there is no package()
function.

Also, set $pkgdir to something "useful" during build().  For split
packages, this uses "<path>/pkg/$pkgbase" because it is not obvious
which $pkgdir is being referred to.

Signed-off-by: Allan McRae <allan@archlinux.org>
doc: update PKGBUILD man page

Rearrange the functions section of the PKGBUILD man package. Clarify
that the package() function is a requirement and the rest are all
optional.  Note that $pkgdir should only be used in the package()
function.

Signed-off-by: Allan McRae <allan@archlinux.org>
Better error message with "-" is specified without stdin

Signed-off-by: Allan McRae <allan@archlinux.org>
document that stdin must not be a tty to read from it

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
use strtok_r to parse multi-value config options

This prevents multiple spaces between values from being
parsed as empty values.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Print a warning if fakechroot is not found

Fixes FS#33551.

Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Remove conditional checks for fakechroot from test files

We don't want test files to do any checks for fakechroot since we will
print a warning if it is not found.

Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Remove outdated instructions in pactest README

Signed-off-by: Allan McRae <allan@archlinux.org>
Document fakeroot and fakechroot as dependencies

Signed-off-by: Allan McRae <allan@archlinux.org>
Additions to .mailmap

Standardize on the most common name for email addresses with multiple
name variants.

Signed-off-by: Allan McRae <allan@archlinux.org>
Make key_in_keychain available in library

In preparation for checking key presence and downloading needed keys
before conflict checking.

Signed-off-by: Allan McRae <allan@archlinux.org>
Move key importing into separate function

This will be useful for checking the availablity of all keys before
perfoming validation in sync operations and for downloading a needed
key in upgrade operations.

Signed-off-by: Allan McRae <allan@archlinux.org>
Add function to extract key id from signatures

This does not support all possibilities of RFC4880, but it does
cover every key currently used in Arch Linux.

Signed-off-by: Allan McRae <allan@archlinux.org>
Make decode_signature available to the library

Signed-off-by: Allan McRae <allan@archlinux.org>