summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-03-03Add events on pacnew/pacsave/pacorig file creationOlivier Brunel3-0/+62
ALPM still adds a warning to the log, but doesn't emit an event about said warning, instead using a specific event to let the frontend what happened/how to inform the user. Note that there are 2 cases for installing a .pacnew file, to not overwrite user changes and because file is in NoUpgrade. In the later case the warning was a bit different: it happened before and said "extracting" instead of "installed." Now both happen after and are phrased the same. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-03Add events _PKGDOWNLOAD_{START, DONE, FAILED}Olivier Brunel1-0/+4
These will be emmitted when download a package file from a repository, indicating that the download starts, and whether it was successfull or not. Note that when multiple servers are available, no event is emmitted when switching to another server. (This doesn't apply to alpm_fetch_pkgurl(), but since it is called by the frontend, it shouldn't have problems knowing when the download starts and when it ends.) Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-03Add events ALPM_EVENT_RETRIEVE_{DONE, FAILED}Olivier Brunel1-0/+2
To go along with RETRIEVE_START, one other event will be emmitted once the downloads are done: RETRIEVE_DONE if all files were successfully downloaded, else RETRIEVE_FAILED. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-03Remove log_cb, add ALPM_EVENT_LOG insteadOlivier Brunel6-41/+42
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>
2014-03-03Update the event callbackOlivier Brunel2-39/+50
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>
2014-02-04pactree: removed 'provision' from linear outputPierre Neidhardt1-1/+4
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>
2014-02-04alpm: export *_free functionsAndrew Gregory2-6/+10
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>
2014-02-04Give groups display text singular and plural formsAllan McRae1-2/+3
Reported on transifex Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-02Do not remove source code references in PO/POT filesRafael Ferreira1-1/+1
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>
2014-01-30table_display: free memory on errorsAndrew Gregory1-4/+8
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30dump_pkg_full: fix optionalfor memory leakAndrew Gregory1-0/+1
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>
2014-01-30Move NULL check before dereferenceSilvan Jegen1-7/+7
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30Another NULL check removedSilvan Jegen1-4/+1
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30Another unneeded NULL check removedSilvan Jegen1-6/+4
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30Remove unneeded NULL checkSilvan Jegen1-3/+1
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-30pacman: use exit status 0 for --help and --versionAndrew Gregory2-3/+10
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>
2014-01-28enable_colors: always set color stringsAndrew Gregory1-0/+10
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>
2014-01-28Remove ts and sw from vim modeline when noet is setFlorian Pritz29-29/+29
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>
2014-01-28pacman.c: free string commandline optionsAndrew Gregory1-0/+5
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>
2014-01-28Rename ALPM_EVENT_OPTDEP_REQUIRED to _OPTDEP_REMOVALOlivier Brunel1-1/+1
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>
2014-01-28pacman: Fix delayed warnings/errors sent to stdout not stderrOlivier Brunel1-2/+3
Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28pacman.c: remove unnecessary optarg checksAndrew Gregory1-11/+0
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>
2014-01-10create_verbose_row: free malloc'd stringsAndrew Gregory1-5/+5
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Minor struct member reordering for packing concernsDan McGee1-1/+1
Noticed using clang and `-Wpadded`. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Update copyright years for 2014Allan McRae28-27/+29
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06conf.c: add missing newline to warningAndrew Gregory1-1/+1
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>
2014-01-06Fix build warnings with --disable-nlsAllan McRae1-2/+2
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>
2013-12-15Color output from pm_vasprintfAllan McRae1-2/+4
This makes sure warning and error messages from _alpm_log are colored. Fixes FS#35160. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Fix whitespace and other formatting issuesJason St. John7-18/+19
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>
2013-11-15log important events from the backendAndrew Gregory1-28/+2
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>
2013-11-08support ALPM_SIG_USE_DEFAULT for file siglevelsAndrew Gregory1-3/+1
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>
2013-11-08Remove spaces between the opening "if" and the opening parenthesisJason St. John2-2/+2
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-31upgrade.c: use iterator variableAndrew Gregory1-3/+3
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>
2013-10-31check for -1 return value from getopt_longAndrew Gregory1-8/+4
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>
2013-10-31callback.c: check for negative xfered sizeAndrew Gregory1-1/+1
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-31pacman -Si/-Qi: Autodetect best fitting file size unitFlorian Pritz1-2/+5
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>
2013-10-31Use getuid instead of geteuidVladimir A. Nazarenko1-1/+1
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>
2013-10-31Indicate ignored packages in -Qu outputAllan McRae1-0/+4
Add "[ignored]" in the "pacman -Qu" output after packages that have their upgrades ignored. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-31Fix detection of joint --native and --foreign usageAllan McRae1-1/+2
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-31List signiture keyids in -Sii outputAllan McRae1-2/+13
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14include invalid options in error messagesAndrew Gregory2-2/+8
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>
2013-10-14pacman: die on invalid option combinationsAndrew Gregory1-0/+140
Fixes FS#20950 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14rename PKG_LOCALITY_LOCAL -> PKG_LOCALITY_NATIVEAndrew Gregory3-5/+5
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>
2013-10-14do not run scriptlets with --dbonlyAndrew Gregory1-0/+1
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>
2013-10-14imply --print from --print-formatAndrew Gregory1-0/+1
--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>
2013-10-14use non-ascii identifiers for optflagsAndrew Gregory2-70/+206
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>
2013-10-14pacman/util: remove strsplitAndrew Gregory3-40/+5
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>
2013-10-14Display old and new version in pacman -Qu outputFlorian Pritz1-1/+8
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>
2013-09-04pactree: set full usage on DBs when registeringDave Reisner1-1/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-04pacman: add front end support for repo usage levelDave Reisner2-0/+64
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>