summaryrefslogtreecommitdiff
path: root/src/pacman
Commit message (Collapse)AuthorAge
...
* | remove support for .pacorig filesAndrew Gregory2015-01-21
| | | | | | | | | | | | | | | | 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>
* | ini.c: move error output into conf.cAndrew Gregory2015-01-21
| | | | | | | | | | | | | | Move the remaining output into conf.c by notifying the callback of read errors. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* | ini.c: remove useless key checkAndrew Gregory2015-01-21
| | | | | | | | | | | | | | 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>
* | ini.c: remove empty section name restrictionAndrew Gregory2015-01-21
| | | | | | | | | | | | | | alpm will reject empty database names already. Reduces error handling in the ini parser. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* | ini.c: remove unnecessary helper functionAndrew Gregory2015-01-21
| | | | | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* | ini.c: move Include parsing to conf.cAndrew Gregory2015-01-21
| | | | | | | | | | | | | | 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>
* | ini.c: remove final callback callAndrew Gregory2015-01-21
| | | | | | | | | | | | | | 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>
* | conf.c: parse config in a single passAndrew Gregory2015-01-21
| | | | | | | | | | | | Fixes FS#28255 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* | conf.c: use masks for siglevel inheritanceAndrew Gregory2015-01-21
| | | | | | | | | | | | | | | | 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>
* | conf.c: store repo settings in dedicated structAndrew Gregory2015-01-21
| | | | | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* | Integrate testdb into pacmanAllan McRae2015-01-02
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Split install reason changing into its own functionAllan McRae2015-01-02
| | | | | | | | | | | | Prepare for other functions to be added to the --database option. Signed-off-by: Allan McRae <allan@archlinux.org>
* | Clarify "assume installed" error messageAllan McRae2014-12-28
| | | | | | | | | | | | | | | | 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>
* | pacman/util.c: fix potential memory leak in indentprintAllan McRae2014-12-24
| |
* | Fix memory leak in ALPM_EVENT_OPTDEP_REMOVAL callbackAllan McRae2014-12-24
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Improve db upgrade error messageAllan McRae2014-12-24
|/ | | | | | This message is clearer without (another) error prefix. Signed-off-by: Allan McRae <allan@archlinux.org>
* Update translations from transifexAllan McRae2014-12-19
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* shut up GCC on -Wmaybe-initialized warningsDave Reisner2014-12-18
| | | | | | Admittedly, these are totally bogus, but a clean build is a happy build. Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix pointer declarations to be globally consistentMicah Saint Germain2014-12-18
| | | | | | | | | | | | 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>
* Update po files to send to TransifexAllan McRae2014-11-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Pull translation updates from TransifexAllan McRae2014-11-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Do not warn about missing files in NoExtractAllan McRae2014-11-18
| | | | | | When checking a packages files, ignore any missing files in NoExtract Signed-off-by: Allan McRae <allan@archlinux.org>
* Add --assume-installed to pacman --helpFlorian Pritz2014-11-05
| | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: add --confirm optionAndrew Gregory2014-10-13
| | | | | | | | | --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>
* Add --assume-installed optionFlorian Pritz2014-09-30
| | | | | | This allows to ignore specific dependencies. Signed-off-by: Florian Pritz <bluewind@xinu.at>
* table_display: only check width when non-zeroAndrew Gregory2014-09-30
| | | | | | | | 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>
* avoid line wrapping if not in a tty or COLUMNS=0Andrew Gregory2014-09-30
| | | | | | | Scripts that parse pacman's output (like pacsearch) generally do not want wrapped lines. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* Revert "Remove log_cb, add ALPM_EVENT_LOG instead"Andrew Gregory2014-09-30
| | | | | | | | | | | | | | | 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>
* pacman.c: Add -gg, -ii, and -yy to help summaryJohannes Löthberg2014-09-23
| | | | | | | | | | | | | 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>
* pacman: set SA_RESTART for signal handlerAndrew Gregory2014-09-23
| | | | | | | Calling a signal handler interrupts some functions, most notably read() and therefore fgets(). Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* wrap fgets to retry on EINTRAndrew Gregory2014-09-23
| | | | | | | | | | 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>
* sync.c: fix style violationsAndrew Gregory2014-08-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman.c: simplify stdin parsingAndrew Gregory2014-08-04
| | | | | | | | 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>
* check_pkg_fast: check file typeAndrew Gregory2014-08-03
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* check_file_exists: replace lstat with llstatAndrew Gregory2014-08-03
| | | | | | | 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>
* use monotonic clock for progress updatesAndrew Gregory2014-06-29
| | | | | | | | | | | | gettimeofday is susceptible to backwards system time adjustments, skewing or altogether breaking progress output. For the sake of platforms that lack clock_gettime support, gettimeofday is retained as a fallback. Fixes FS#36983 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* cache terminal size, add SIGWINCH handler to resetDave Reisner2014-06-29
| | | | | | | | | | | | | 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.
* Revert refactoring in fa0c1e14Allan McRae2014-06-29
| | | | | | | 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>
* pacman: Correct signal handler comment and refactorSilvan Jegen2014-06-24
| | | | | | | | | | | | | 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>
* events: Make alpm_event_t an union of all event-specific structOlivier Brunel2014-06-24
| | | | | Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update the question callbackOlivier Brunel2014-06-24
| | | | | | | | | | | | Much like with events, instead of using a bunch of void* arguments for all questions, we now send one pointer to an alpm_question_t union. This contains the type of question that was triggered. With this information, a question-specific struct can be accessed in order to get additional arguments. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Move break to a new line for consistencyHong Shick Pak2014-06-23
| | | | | | | | 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>
* Clarify that -Ql prints a file listAllan McRae2014-05-25
| | | | | | FS#40234 Signed-off-by: Allan McRae <allan@archlinux.org>
* util: Use off_t instead of int for size valuesFlorian Pritz2014-05-22
| | | | | | | | | | | | | Old output: > Total Installed Size: -1527.44 MiB Fixed: > Total Installed Size: 2568.56 MiB Bug introduced in 7b8f8753b15037bf4a88126ffde8195416432c72. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* remove.c: downgrade TRANS_DUP_TARGET to warningAndrew Gregory2014-05-07
| | | | | | | Matches the behavior for sync packages. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* strtrim: reset pointer after trimming leading whitespaceDave Reisner2014-04-21
| | | | | | | | | Breakage introduced in 92216c5864efccac when we changed the signature of strtrim to return something more useful. Fixes FS#39976. Signed-off-by: Allan McRae <allan@archlinux.org>
* conf.c: remove extra indentationAndrew Gregory2014-03-27
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* check config_new return valueAndrew Gregory2014-03-27
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/upgrade: Fix memory leaksSören Brinkmann2014-03-27
| | | | | | | Make sure allocated memory is freed before returning. Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/upgrade: Refactor memory managementSören Brinkmann2014-03-27
| | | | | | | | Refactor the upgrade routine to use an array that can be allocated in one step instead of an alpm_list that is gradually extended in loops. Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>