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>
Add missing header

Exposed when building with --without-libcurl

Signed-off-by: Allan McRae <allan@archlinux.org>
Hide unused parameter warnings when building without libcurl

Signed-off-by: Allan McRae <allan@archlinux.org>
be_sync: avoid crashing on files in the root of a DB

If a sync DB is malformed and contains entries in the root of the
archive, load_pkg_for_entry will leave the 'filename' variable empty,
leading to a crash in the ensuing strcmp() calls which determine the DB
fragment being examined.

While this isn't a read error, this should be reported to the user so
that it can be addressed by the creator of the DB.

As seen: https://bbs.archlinux.org/viewtopic.php?pid=1297766

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Remove autotools files

Signed-off-by: Allan McRae <allan@archlinux.org>
Update gitignore files for use with autoreconf

Signed-off-by: Allan McRae <allan@archlinux.org>
Use autoreconf in autogen.sh

Signed-off-by: Allan McRae <allan@archlinux.org>
Patch ltmain on autoreconf

We used to carry a patched version of ltmain in our repos to fix libtools
issues with -Wl,-as-needed. Now that ltmain is "generated" by autoreconf,
we manually patch it afterwards.

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

Use 'git clean' instead.

Signed-off-by: Allan McRae <allan@archlinux.org>
Carry a copy of gpgme.m4

On systems without gpgme installed, autoreconf will fail with an unrelated
error message unless the gpgme.m4 file is present.

Signed-off-by: Allan McRae <allan@archlinux.org>
pacdiff: Add quit to found pacnew options

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Install makedepends and checkdepends together

Fixes FS#31557

Signed-off-by: Ashley Whetter <awhetter.2011@my.bristol.ac.uk>
Signed-off-by: Allan McRae <allan@archlinux.org>
Clarify inter-conflicts message

Use a clear message rather than using a made up word to describe what
we are doing.

Signed-off-by: Allan McRae <allan@archlinux.org>
clarified descriptions for pactree -r (--help)

Signed-off-by: Zulker Nayeen Nahiyan <nahiyan02@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Fix typo

Signed-off-by: Allan McRae <allan@archlinux.org>
Corrected return codes for Sg flag

Non-zero is now returned if a group is searched for that doesn't exist.
Fixes FS#36097.

Signed-off-by: Ashley Whetter <awhetter.2011@my.bristol.ac.uk>
Signed-off-by: Allan McRae <allan@archlinux.org>