Report which package is missing a signature

If any package in a sync transaction is missing a required signature,
we give an uninformative error message (which may or may not state that
the missing signature is the issue).  Always output the package with
the missing signature.

Signed-off-by: Allan McRae <allan@archlinux.org>
autogen.sh: remove useless shell flag and subshells

$ ./autogen.sh
./autogen.sh: 3: ./autogen.sh: BASH_SOURCE: parameter not set

The -u flag causes this (and lots of other mysterious problems). Since
there aren't even any variables in this script, it makes no sense to
use it.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Added list of mandatory options to PKGBUILD's man page

[Allan: Adjust wording due to remove al license warning]
Signed-off-by: Allan McRae <allan@archlinux.org>
Fix progress bar overflow while checking package integrity

On 32bit systems, the progress bar intergrity checking can show values
greater than 100% with large transactions.  This is due to the total
size of all package files being greater than a size_t.  Use uint64_t
for these sizes.

Fixes FS#36608

Signed-off-by: Allan McRae <allan@archlinux.org>
proto: remove missed $srcdir redundancies

Most of the redundant "cd $srcdir" in the prototypes were removed in commit
5f80d7af.  Fix the rest.

Signed-off-by: Allan McRae <allan@archlinux.org>
contrib/pacdiff: error if diffprog is not found

FS#35936

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: use source_safe when resourcing BUILDFILE

After updating the pkgver, we still need to safely source the BUILDFILE.

Signed-off-by: Allan McRae <allan@archlinux.org>
Ensure packages have a valid version

Currently you can manually create and then install a package with a
version not containing a pkgrel.  The created local database entry is
invalid as the directory name can not be split by _alpm_splitname due
to the assumtion of hyphens separating name-pkgver-pkgrel.

Ensure the package has a valid version when it is loaded. Fixes FS#35514.

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: validate updated pkgver before replacement

Validate the new pkgver efore blindly ramming it into the PKGBUILD.
This gives us good feedback and prevents corrupting the PKGBUILD, e.g.

==> Starting pkgver()...
==> ERROR: pkgver is not allowed to contain colons, hyphens or whitespace.
==> ERROR: pkgver() generated an invalid version: a horse is not a pkgver

As an additional failsafe, exchange a valid for invalid character as
command separator in @SEDINPLACE@ expressions. For even more paranoia,
exit if sed fails for any reason.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Make functions to decode a signature and extract keyid public

These are useful for frontends.

Signed-off-by: Allan McRae <allan@archlinux.org>
List signiture keyids in -Sii output

Signed-off-by: Allan McRae <allan@archlinux.org>
Fix detection of joint --native and --foreign usage

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg.8: document environmental variables that affect gpg signing

Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg.8: Document remaining environmental variables

Signed-off-by: Allan McRae <allan@archlinux.org>
repo-add.8: Provide example usage

Detail the current standard of generating two databases - with and
without the file list.

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

This function is useful for frontends to annotate package upgrades
that will be ignored.

Signed-off-by: Allan McRae <allan@archlinux.org>
Indicate ignored packages in -Qu output

Add "[ignored]" in the "pacman -Qu" output after packages that have their
upgrades ignored.

Signed-off-by: Allan McRae <allan@archlinux.org>
sortbydeps: include local pkgs in dep graph

Detecting indirect dependencies by traversing a package's entire
dependency tree is prohibitively slow for larger transactions.  Instead
add local packages to the dependency graph.  This additionally requires
delaying dependency ordering for sync operations so that removed
packages may be excluded from dependency detection.

tests/sync012.py was also updated to ensure that the dependency cycle
was actually detected.

Fixes FS#37380

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
makepkg: allow empty source arrays

Necessary for metapackages.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
libalpm/db.c: default to ALPM_DB_USAGE_ALL

This allows existing front-ends other than pacman to continue working
normally.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>