Change cmd tests to if (( USE_FIND ))... as it is cleaner. All search
cmds have an option and a variable initialized to zero. The active option
should be set to 1. Add a switch to exclude multiple search options.
set the default when all are equal to zero.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Allow colors to be disabled for use on broken/serial terminals.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
loop over arguments, this will allow adding options such as --nocolor
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Clean up and reword --help
get rid of all the echos to make it easier to read in source.
Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Changes to pacman mean that -Sp can be called without root permissions
and '-d' needs passed twice to completely ignore dependencies.
Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
'-q' means "Exit as soon as each specified pattern or filename has
been matched." There is no reason to keep reading the whole package
from the cache when the install script has already been printed to
stdout.
Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
When maintaining a custom repo, often it is undesirable to retain older
versions of packages. This patch adds the --remove option to remove the
current package file and it's signature from disk before adding the new
one to the database. Documentation is also updated. This is an optional
flag and default behaviour (leaving ondisk files alone) is not changed.
Signed-off-by: Phillip Smith <fukawi2@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Several operations default to all packages/repos/etc if no targets are
provided. If a user provides '-' they almost certainly expect there to
be targets on stdin and will be surprised if pacman falls back to the
default because there are none.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>