summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-12-05extract soft interrupt handlersAndrew Gregory
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>
2015-12-05extract SIGSEGV handlerAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05extract SIGWINCH handlerAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05move signal handlers to sighandler.[ch]Andrew Gregory
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>
2015-12-05avoid unsafe functions in signal handlerAndrew Gregory
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>
2015-12-05remove SIG_IGN check when setting signal handlerAndrew Gregory
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>
2015-12-05do not catch SIGTERMAndrew Gregory
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>
2015-12-05pacman: exit without memory cleanup on signalsAndrew Gregory
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>
2015-11-11Refactor strtrim functionSilvan Jegen
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-11Use correct format specifiersRikard Falkeborn
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04files_search: reset found for each targetAndrew Gregory
Otherwise any invalid targets following a successful match will not get an error message. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04files_search: free compiled regexAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04files: do not unnecessarily strdup targetsAndrew Gregory
Targets are never modified so we can just use the original copy. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04files.c: add vim modelineAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04add detail to broken dependency errorsAndrew Gregory
The difference between a sync target having an unmet dependency and breaking a dependency for an installed package is a common source of confusion. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04add --quiet to -FhAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-03package.c: Fix incorrect buffersize and constant-foldingPierre Neidhardt
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-03Add -F --machinereadable optionFlorian Pritz
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-27Align titles automatically in information displayPierre Neidhardt
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-27Use ARRAYSIZE macro for non-string array size computationPierre Neidhardt
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-21pacsort: clean up if errorRikard Falkeborn
* free memory * close open file Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-21pacsort: don't overwrite memory if realloc failsRikard Falkeborn
That makes it impossible to free it later. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-21pacsort: handle failing list_addRikard Falkeborn
Since it can fail, check the return value. If it fails, we need to free the memory of the object we wanted to add to the list. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-19Pluralize malloc failure stringAllan McRae
Not particularly useful in English (will always be plural), but useful in languages that have multiple plural forms. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18package.c: Comment stylePierre Neidhardt
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18Do not print any root prefix in files database operationsAllan McRae
Combining with the --root flag and outputing a consistent root prefix leads to many situations that make no sense. Instead, do not print any prefix for any --files operations. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18package.c: Remove obsolete param from docPierre Neidhardt
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18pacman: add user hook directoriesAndrew Gregory
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20move ini parser into commonAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20move strtrim to util-commonAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08copy assumeinstalled optionsAndrew Gregory
All other option setters copy their input. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08pacman/util.c: Fix memory leak if realloc failsRikard Falkeborn
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08Remove ko_KR translationAllan McRae
The "ko_KR" locale is the same as the "ko" locale. Remove the "ko_KR" variant as it is incomplete and has been superseded by "ko" on transifex. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20pacman/files.c: fix memory leak on regex errorAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Handle repo/pkg style arguments to sync repo file listingAllan McRae
Passing "-Fl pkg" will print the filelist for the first occurance of "pkg" in the sync repos. Other version of the package can be printed using "-Fl repo/pkg". Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Add regex search option to sync database file searchingAllan McRae
e.g. pacman -Fsx kcm.*print.*\.so Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Implement searching for a file in the sync databasesAllan McRae
Locates all packages that contain the listed file e.g. pacman -Fs libpng.so Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Implement listing files from sync packagesAllan McRae
Does the equivalent of the -Ql option for local packages e.g. pacman -Fl glibc Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Implement locating file owner in sync files databaseAllan McRae
Equivalent to -Qo but for packages in the sync database e.g. pacman -Fo /usr/bin/pacman Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Prototype pacman files database operationsAllan McRae
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>
2015-07-15pacman: move database syncing to util.cAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Add pacman support for .files databasesAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14Fix formatting in parsearg_upgradeAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14Simplify sync_cleandbAllan McRae
1) Remove checks for removing pre-tardb files 2) Remove the long redundant keep_used parameter 3) Fix pacman error due to removing .sig file along with database Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-12Fix overflow warningsAndrew Gregory
Fix new warnings generated by gcc-5 about potential overflows. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-06-20Match providers when showing optdep install statusLukas Fleischer
Use alpm_find_satisfier() instead of alpm_db_get_pkg() when retrieving the install status of a package to make sure we spot providers as well. Fixes FS#36412 Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-06-20util.c: table_display: Fix incorrect docstringJohannes Löthberg
Commit 7b8f8753 removed the title parameter but forgot to remove it from the docstring. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12Fix compilation if libarchive headers are not in standard locationCharles Duffy
With commit 097d5a478b32, including alpm.h also drags in archive.h. Ensure the tools we build that depend on ALPM also include the necessary flags to find libarchive headers if they are not installed in a standard location. [Dan: Add commit message] Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12pacsort: fix warning about signed overflow potential during comparison.Andrew Gregory
Some crazy person assumed we would have fewer than INT_MAX columns. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12Pluralize callback stringAllan McRae
In English, this string only has it plural form. However, we need to use the pluralized translation as some languages can have multiple plural formats. Signed-off-by: Allan McRae <allan@archlinux.org>