Age | Commit message (Collapse) | Author |
|
Add a configure test for a system library supplied strnlen, and disable
the embedded version in common if one is found.
Signed-off-by: Will Miles <wmiles@sgl.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
This small refactor reduces the number of replications of the local
imeplementation of strndup.
Signed-off-by: Will Miles <wmiles@sgl.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Leaks when using -Sii with package signatures
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Leave user files in place and save new config files with a .pacnew
extension. This reduces the complexity of file extraction and respects
the principle that pacman shouldn't modify files it didn't create.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Move the remaining output into conf.c by notifying the callback of read
errors.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
key points to a statically allocated string so it can't be NULL and
empty keys are rejected by the callback.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
alpm will reject empty database names already. Reduces error handling
in the ini parser.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Reduces the number of errors the ini parser must handle to make it more
suitable for sharing with the backend.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Storing repo information removes the need for the final callback. This
allows the call signature to be re-purposed for indicating read errors.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Fixes FS#28255
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
This will allow pacman to parse its config file in a single pass and
removes the need for the *_SET siglevels in alpm that were only required
for pacman's siglevel inheritance.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Replaced by pacman -Dk / -Dkk
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
The functionality of testdb is now available in pacman. pacman -Dk will
check the local database for consistency, and pacman -Dkk will check the
sync databases.
Note that unlike testdb, you can not specify individual sync databases to
check as sync databases act as a whole and not individually. A single database
can be checked using an alternative pacman.conf file.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Prepare for other functions to be added to the --database option.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
The error message on failing to add an "assume installed" entry to the backend
was not clear. Clarify by making "assume-installed" none translatable and
adding a hyphen to match calling flag.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
This message is clearer without (another) error prefix.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Admittedly, these are totally bogus, but a clean build is a happy build.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Refactored inconsistent pointer declarations to better improve consistency
throughout the pacman codebase which will, in turn, increase readability to
the user.
Expected format of a pointer declaration:
`typename *varname`
Signed-off-by: Micah Saint Germain <micah@lexme.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
This moves most of the parsing work out of the sorting path. The explode
and splitfile functions now call input_new and append input_t structs
to the list of sort candidates instead of raw strings. This lets us
make smarter and easier decisions in the sorting callbacks, which are
now also split into the version and file comparison methods for clarity.
This fixes two bugs:
1) Incorrect ordering with filenames containing epoch in the pkgver
2) Incorrect ordering with package names which are substrings of
each other (e.g. "systemd" and "systemd-sysvcompat").
Performance of the --files mode degrades slightly as a result of this
change, but not unreasonably. Sorting with small inputs (5-10) doubles
in runtime, but larger inputs (4000+) only increase by 20%.
ref: https://bugs.archlinux.org/task/37631
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
When checking a packages files, ignore any missing files in NoExtract
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Replaces the test for hidden files which appears to be leftover from
2e431e1cc before sync db checking was moved to a separate function.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
--confirm cancels the effect of a previous --noconfirm.
This makes it easier for scripts to default to --noconfirm
but allow users to override it.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
This allows to ignore specific dependencies.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
|
|
A width of 0 indicates that either pacman is not attached
to a tty or the user does not want line wrapping. Either
way pacman should not fall back to the basic display.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Scripts that parse pacman's output (like pacsearch) generally do not
want wrapped lines.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Moving logging to the event callback caused warnings
under clang due to non-literal format strings and
silenced all log messages when --print was used.
This reverts commit cd793c5ab7689cc8cbc18277375b368060e5acfe.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Conflicts:
lib/libalpm/alpm.h
src/pacman/callback.c
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
The sync help summaries was missing the information about:
* -gg: View all groups and members
* -ii: View extended information
* -yy: Force refresh even if DBs are up to date
Fixes FS#41388.
Original-work-by: Earnestly <zibeon@gmail.com>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Calling a signal handler interrupts some functions, most notably read()
and therefore fgets().
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
The read() underlying fgets() can be interrupted by a signal handler
causing fgets() to return NULL. Before we started handling SIGWINCH,
the odds of interrupting a read were low and typically resulted in
termination anyway. Replace all fgets calls with a wrapper that retries
in EINTR.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Incorporate memory exhaustion and end-of-stream
checks into the main loop.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Paths are constructed directly from package file lists and may contain
trailing slashes, causing lstat to dereference symlinks.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
This makes llstat's signature differ from lstat's, but we never actually
use it on a const string and this saves a large number of strdup's.
This also allows stripping multiple trailing slashes and corrects a bug
where calling llstat on "/" would result in calling lstat on an empty
string.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|
|
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
|