| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
The soft interrupt handler dereferences config, causing a segfault if
it is called during cleanup.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
Delays handler setup until after config is set to a valid
value to avoid a segmentation fault.
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>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
| |
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
| |
Signals are special because they run asynchronously, making them
non-trivial to handle correctly. Move the handlers a separate file to
offset them from the normal code and make them easier to separate into
individual functions without further cluttering pacman.c
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
signal(7) lists a set of functions that can safely be called from within
a signal handler. Even fileno and strlen are not guaranteed to be safe.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Our signal handler provides a way to gracefully interrupt a transaction
and should always be set.
The check appears to have originally been copied directly from the glibc
manual.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
| |
On SIGTERM pacman was exiting immediately, even in the middle of
a transaction. In this case we should leave the lock file in place as
an indication that the database may not be in a consistent state.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Memory allocation/deallocation functions are not safe to call from
signal handlers. Just remove the lock file if there is one and exit
immediately.
Fixes: FS#46375, FS#45995, FS#47011
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>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
| |
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
| |
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
| |
e.g. pacman -Fsx kcm.*print.*\.so
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
Add the -F/--files operations, -s/--sync support and nd provide dummy
functions for -s/--search, -l/-list and -o/--owns.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactoring getcols, yet again. We do the following:
1) Introduce a static global in src/pacman/util.c
2) getcols always prefers this cached value, but will derive it from
the COLUMNS environment var, the characteristics of stdout, or a sane
default (in that order).
3) Introduce a SIGWINCH signal handler to reset the cached value,
meaning we only call ioctl when we don't know the value.
On my machine, pacman -Syy goes from ~4300 ioctl calls to 3.
|
|
|
|
|
|
|
| |
This will cause the code to break as soon as we handle another signal such
as SIGWINCH...
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One of the comments for this function is out of sync with the code.
Since the code exhibits the more sane behavior of treating SIGINT and
SIGHUB the same way (by not exiting pacman when there is a commit in
flight) we adjust the comment.
Given this code flow, the if/else statements can be simplified somewhat
as well.
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
This was the only break that didn't have its own line in the function
parsearg_query.
Signed-off-by: Hong Shick Pak <hong@hspak.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
| |
FS#40234
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
| |
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
| |
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
| |
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
The user requesting usage or version information is not an error.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.
Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
Plugs a memory leak when values were passed twice.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
| |
getopt takes care of making sure that options that require a value have
one. These checks were only added to silence clang, which no longer
complains about optarg being unchecked, and newer options already use
optarg unchecked.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
| |
This commit:
-- replaces space-based indents with tabs per the coding standards
-- removes extraneous whitespace (e.g. extra spaces between function args)
-- adds missing braces for a one-line if statement
Signed-off-by: Jason St. John <jstjohn@purdue.edu>
|
|
|
|
|
|
|
|
|
| |
getopt_long returns -1 when it has finished parsing all args. A return
value of 0 indicates that a flag was set directly by getopt_long and
parsing should continue.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
| |
If someone gives the pacman binary setuid permissions, the geteuid check
allows it to start running but subsequently fail. As we do not support
setting pacman setuid, use getuid to check permissions instead.
FS#37174.
Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
On invalid combinations of flags we were only printing the unhelpfully
vague message "invalid option".
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
Fixes FS#20950
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
| |
PKG_LOCALITY_LOCAL was confusing because the enum is used with -Q, so
all packages are "local". Also reversed the config->op_q_locality
assignment so that the locality matches the option used.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
Running an install script does not fall under "Adds/removes the database
entry only."
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
| |
--print-format is totally useless without --print. Implying --print
will also save us the hassle of checking it when we add transaction
option validation.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the overlap between optflags for different operations that
allowed non-sensical combinations of flags such as:
$ pacman -Si --changelog $package
--changelog is -c, meaning --clean for -S
$ pacman -Q --sysupgrade
--sysupgrade is -u, meaning --upgrades for -Q
Also add a few missing braces.
Original-work-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
strsplit was used in only one place and did the same thing as strtok.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|