summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Remove log_cb, add ALPM_EVENT_LOG insteadOlivier Brunel2014-03-03
| | | | | | | | When ALPM emits a log message, it still goes through _alpm_log() but instead of calling a specific log callback, it goes as an event. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update the event callbackOlivier Brunel2014-03-03
| | | | | | | | | | | | Instead of using two void* arguments for all events, we now send one pointer to an alpm_event_t struct. This contains the type of event that was triggered. With this information, the pointer can then be typecasted to the event-specific struct in order to get additional arguments. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactree: removed 'provision' from linear outputPierre Neidhardt2014-02-04
| | | | | | | | | | | Linear output is especially useful when piped to other commands, e.g. $ pactree -lu pacman | pacman -Qqkk - The above command would previously show errors on packages with provisions. Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm: export *_free functionsAndrew Gregory2014-02-04
| | | | | | | Front-ends should be able to free memory that alpm hands them. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Give groups display text singular and plural formsAllan McRae2014-02-04
| | | | | | Reported on transifex Signed-off-by: Allan McRae <allan@archlinux.org>
* Do not remove source code references in PO/POT filesRafael Ferreira2014-02-02
| | | | | | | FS#34240. This is useful for translators and has little cost to us since we moved to transifex for translations. Signed-off-by: Allan McRae <allan@archlinux.org>
* table_display: free memory on errorsAndrew Gregory2014-01-30
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* dump_pkg_full: fix optionalfor memory leakAndrew Gregory2014-01-30
| | | | | | | | alpm_pkg_compute_optional returns a generated list that needs to be free'd. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Move NULL check before dereferenceSilvan Jegen2014-01-30
| | | | | Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Another NULL check removedSilvan Jegen2014-01-30
| | | | | Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Another unneeded NULL check removedSilvan Jegen2014-01-30
| | | | | Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove unneeded NULL checkSilvan Jegen2014-01-30
| | | | | Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: use exit status 0 for --help and --versionAndrew Gregory2014-01-30
| | | | | | | 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>
* enable_colors: always set color stringsAndrew Gregory2014-01-28
| | | | | | | | Only setting color strings when colors is true allowed subsequent calls to enable colors but not disable them. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove ts and sw from vim modeline when noet is setFlorian Pritz2014-01-28
| | | | | | | | | | | | 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>
* pacman.c: free string commandline optionsAndrew Gregory2014-01-28
| | | | | | | 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>
* Rename ALPM_EVENT_OPTDEP_REQUIRED to _OPTDEP_REMOVALOlivier Brunel2014-01-28
| | | | | | | | Because this event is triggered when an optdepend for another package is being removed. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: Fix delayed warnings/errors sent to stdout not stderrOlivier Brunel2014-01-28
| | | | | Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman.c: remove unnecessary optarg checksAndrew Gregory2014-01-28
| | | | | | | | | | 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>
* create_verbose_row: free malloc'd stringsAndrew Gregory2014-01-10
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Minor struct member reordering for packing concernsDan McGee2014-01-06
| | | | | | | Noticed using clang and `-Wpadded`. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2014Allan McRae2014-01-06
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* conf.c: add missing newline to warningAndrew Gregory2014-01-06
| | | | | | | Fixes tests that use pacman's output when built without libcurl. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix build warnings with --disable-nlsAllan McRae2014-01-06
| | | | | | | | The gettext functions return a "char *", so do the same for the defines in the case where gettext is unavailable. This prevents a number of warnings about const being dropped. Signed-off-by: Allan McRae <allan@archlinux.org>
* Color output from pm_vasprintfAllan McRae2013-12-15
| | | | | | | This makes sure warning and error messages from _alpm_log are colored. Fixes FS#35160. Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix whitespace and other formatting issuesJason St. John2013-11-15
| | | | | | | | | 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>
* log important events from the backendAndrew Gregory2013-11-15
| | | | | | | | | | | | | This ensures that important events will be logged and consistent regardless of the frontend. The need for global context in the event callback is also removed. The event is logged before any post_* scripts run, so this also moves the post_* script output underneath the event in the log. Fixes FS#36504 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* support ALPM_SIG_USE_DEFAULT for file siglevelsAndrew Gregory2013-11-08
| | | | | | | This brings file siglevels in line with how db siglevels are handled. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove spaces between the opening "if" and the opening parenthesisJason St. John2013-11-08
| | | | | Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
* upgrade.c: use iterator variableAndrew Gregory2013-10-31
| | | | | | | | remote was being used to loop over itself, making the FREELIST ineffective. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* check for -1 return value from getopt_longAndrew Gregory2013-10-31
| | | | | | | | | 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>
* callback.c: check for negative xfered sizeAndrew Gregory2013-10-31
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman -Si/-Qi: Autodetect best fitting file size unitFlorian Pritz2013-10-31
| | | | | | | | | | | | | I've tracked this back to e223366 and it looks like this just forces KiB because back then humanize_size didn't exist, but the size was just divided by 1024 to keep it somewhat readable. When humanize_size got introduced in 3c8a448 this was just carried over. The unit detected for "Download Size" is reused for "Installed Size" to make it easier to read. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* Use getuid instead of geteuidVladimir A. Nazarenko2013-10-31
| | | | | | | | | | | 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>
* Indicate ignored packages in -Qu outputAllan McRae2013-10-31
| | | | | | | Add "[ignored]" in the "pacman -Qu" output after packages that have their upgrades ignored. Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix detection of joint --native and --foreign usageAllan McRae2013-10-31
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* List signiture keyids in -Sii outputAllan McRae2013-10-31
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* include invalid options in error messagesAndrew Gregory2013-10-14
| | | | | | | | 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>
* pacman: die on invalid option combinationsAndrew Gregory2013-10-14
| | | | | | | Fixes FS#20950 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* rename PKG_LOCALITY_LOCAL -> PKG_LOCALITY_NATIVEAndrew Gregory2013-10-14
| | | | | | | | | 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>
* do not run scriptlets with --dbonlyAndrew Gregory2013-10-14
| | | | | | | | 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>
* imply --print from --print-formatAndrew Gregory2013-10-14
| | | | | | | | | --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>
* use non-ascii identifiers for optflagsAndrew Gregory2013-10-14
| | | | | | | | | | | | | | | | | 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>
* pacman/util: remove strsplitAndrew Gregory2013-10-14
| | | | | | | 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>
* Display old and new version in pacman -Qu outputFlorian Pritz2013-10-14
| | | | | | | | This changes the output from "foo 1.0" to "foo 1.0 -> 1.1" which makes cronjobs that mail the -Qu output way more helpful. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactree: set full usage on DBs when registeringDave Reisner2013-09-04
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: add front end support for repo usage levelDave Reisner2013-09-04
| | | | | | | | | | | Add a "Usage" key to the repo section of the config which allows for the tokens "Search", "Install", "Upgrade", "All", which correspond to values in the alpm_db_usage_t enum. Users can specify "Usage" multiple times for a given repo, or multiple flags per "Usage" line and they will be OR'd together. If unspecified, the default is full usage of the repo. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/util.c: use switch when there are fall through statementsSami Kerola2013-09-04
| | | | | | | | | | | | | | An 'if' clause with empty statement is allowed, but unusual construct. When 'if' is used this way the statement should at least have orphan semicolon ';'. For empty statements 'switch' feels like a native way express what is meant. Signed-off-by: Sami Kerola <kerolasa@iki.fi> [Allan] Keep comment Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Improve --help switch output for pacman utilsJason St. John2013-09-04
| | | | | | | | | | | | | | | | | | | | | | | | Unify the formatting of the --help switch for pacman utils, if it exists. All of the pacman utils will now output help text using the following format: util-name (pacman) v<pacman version> one line description of util's purpose Usage: util-name [options] -b, --bar whatever --bar does -f, --foo whatever --foo does -h, --help display this help message The --help switch does not exist for a couple of the utils, so the help/usage text for those will be displayed when the util is run with no arguments. Reported-by: Karol Błażewicz <karol.blazewicz at gmail.com> Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
* common: compare value rather than pointer addressSami Kerola2013-09-04
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Allan McRae <allan@archlinux.org>