Respect paths with spaces on --install

makepkg --install doesn't quote the absolute path, so if the path contains
spaces pacman -U fails.

Signed-off-by: Allan McRae <allan@archlinux.org>
Merge branch 'maint'
Install unchanged backup files to get correct timestamps.

Fixes FS#35515.

Signed-off-by: Allan McRae <allan@archlinux.org>
Make --unrequired filter packages that are optdep as well

Specify it twice to only filter direct dependencies.

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
deps.c: check for indirect deps when ordering

On upgrades, indirect dependencies were not being detected if there was
a dependency in between them that was not part of the transaction.  For
example, with the dependency chain: pkg1 -> pkg2 -> pkg3, if pkg1 and
pkg3 are being upgraded but not pkg2 pacman would not order pkg1 and
pkg3 properly.

This was particularly problematic when replacements were involved
because the replaced package(s) would be removed at the start of the
transaction.  If an install script required the replacer and lacked
a direct dependency, it could fail.

Fixes FS#32764.

Partially fixes FS#23011.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Enable inverted patterns in NoExtract and NoUpgrade.

It is now possible to invert patterns in NoExtract and NoUpgrade.
This feature allows users to whitelist certain files that were
previously blacklisted by another entry.

Signed-off-by: Allan McRae <allan@archlinux.org>
skip unknown repo names for pacman -Sl

Brings pacman -Sl behavior in line with other listing operations.

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

Relocated query_group() to allow calling filter().

Fixes FS#19716

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

We no longer need it for resolving package files and using it to
resolve root is unnecessary as alpm does that for us.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
query_fileowner: resolve trailing . or .. in paths

The full path needs to resolved any time it ends with "." or "..", not
just when those are the entire path.  This allows strange-but-valid
paths such as: "/home/." to be queried.

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

Signed-off-by: Allan McRae <allan@archlinux.org>
Consolidate and improve table implementations

Implement both the VerbosePkgList and the summary message with the same
table.

Improve VerbosePkgList by caching attributes and cell's lengths instead
of recaculating them.

Right align every cell that containing a file size in both the
VerbosePkgList and the summary.

Simplify the printf statements and the alignment application.

Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
do not check error from close(2)

On operating systems we support, the behavior is always such that the
kernel will do the right thing as far as invalidating the file
descriptor, regardless of the eventual return value. Therefore,
potentially looping and calling close multiple times is wrong.

At best, we call close again on an invalid FD and throw a spurious EBADF
error. At worst, we might close an FD which doesn't belong to us when a
multi-threaded application opens its own file descriptor between
iterations of the loop.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
use full path when checking for mountpoints

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