summaryrefslogtreecommitdiff
path: root/src/pacman/pacman.c
Commit message (Collapse)AuthorAge
...
* Make it easier to ignore multiple packages.Nathan Jones2007-11-13
| | | | | | | | | | | | This makes --ignore and --ignoregroup able to accept multiple packages/groups by separating each with a comma. For instance: pacman -Su --ignore kernel26,udev,glibc This was requested in the comments of FS#8054. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add help for --ignoregroup.Nathan Jones2007-11-13
| | | | | | Signed-off-by: Nathan Jones <nathanj@insightbb.com> [Dan: split usage line into two lines for clarity] Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman: remove leftover help string for -RhDan McGee2007-11-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add TotalDownload option.Nathan Jones2007-11-11
| | | | | | | This will be used in the next commit. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add IgnoreGroup and --ignoregroup option.Nathan Jones2007-11-11
| | | | | | | This will be used in the next commit. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add LOGFILE as a define at compile time for pacmanDan McGee2007-11-05
| | | | | | | | | It has always been a bit odd that logfile had to be specified in the config file, but no other paths did. Add LOGFILE as a preprocessor definition, and make a call to alpm_option_set_logfile() to set the default location so no logfile parameter is necessary in pacman.conf. Signed-off-by: Dan McGee <dan@archlinux.org>
* Clean up usage of extern variablesDan McGee2007-11-04
| | | | | | | | Instead of declaring the extern variable in every *.c file, include it in the header file that makes sense. This means handle.h for the handle, and conf.h for the pacman side config object. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix basename usage in pacman and utilitiesDan McGee2007-11-04
| | | | | | | | | basename() is a rather untrusty function call on a lot of platforms as it does some weird and different things. To solve this, I added a mbasename fuction to pacman to take its place, and simply removed its usage in the utilities (it isn't worth dealing with there). Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix mcheck detection and usageDan McGee2007-10-26
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure all localization stuff is correctly guardedDan McGee2007-10-22
| | | | | | | Anything dealing with libintl and localization should be correctly guarded inside an ENABLE_NLS block on both the pacman and libalpm sides. Signed-off-by: Dan McGee <dan@archlinux.org>
* Download delta files if UseDelta is set.Nathan Jones2007-10-19
| | | | | | | | Delta files will be used if the size is smaller than a percent (MAX_DELTA_RATIO) of the package size. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman/pacman.c : put back root check even if -r is specified.Chantry Xavier2007-10-14
| | | | | | | Root is needed for most install / remove operation, because it's needed for chrooting, for running scriptlets. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* pacman/pacman.c : add --logfile option.Chantry Xavier2007-10-08
| | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Remove the non-user friendly --ask optionDan McGee2007-10-08
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* needs_transaction adjustmentsChantry Xavier2007-10-03
| | | | | | | | | | | | | | | I just moved the root path check out of needs_transaction, and put it directly in pacman.c . I think this part is alright. For the other problems, I thought about doing the transaction first, in a new sync trans function, which will init and release a transaction. And then doing the commands like -Ss / -Sl / -Sg / -Si. The problem is that for commands like -Sys / -Syl / etc, only the refresh part of the transaction should be done. So I had to introduce an ugly sync_only hack. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* Break out transaction test to a separate functionAaron Griffin2007-09-28
| | | | | | Added needs_transaction, putting out "hey do we need root?" tests in one place. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* OMG a space!Aaron Griffin2007-09-28
| | | | | | Yeah, I added a space. It deserves its own commit. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* document the -Qii option.Chantry Xavier2007-09-27
| | | | | | | | | I suppose -Qii could be used for other things than displaying the list of backup files, but currently, it's the only one, so that's how I documented it.. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* trans.c : reworking of transaction interruptionsChantry Xavier2007-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | My two previous hacks related to this part (8038190c7c4786e1c49494eea1b40cdddcbd5136 and b15a5194d1a8485a2769560e49e6ff03e1862533) were caused by the lack of understanding of a feature introduced a while ago: Better control over CTRL-C interruptions -- do not leave the DB in an inconsistent state (54008798efcc9646f622f6b052ecd83281d57cda). Now I have been looking at this commit, and the added feature is indeed interesting. The main problem I had with it is that it does a rather unusual use of alpm_trans_release, which caused a few problems that I tried to fix in a weird way. I think these problems were caused by the fact that there weren't any difference between "interrupt transaction" and "release a transaction which failed" actions from the alpm_trans_release POV. So I decided to add a new function instead, alpm_trans_interrupt, which is called on Ctrl+C, and which only sets trans->state to STATE_INTERRUPTED so that remove_commit and add_commit can exit cleanly at a safe moment. This allowed me to revert my two previous hacks as well. Also ensure we handle SIGINT correctly in all cases- if a transaction is not ongoing, then we can free the transaction and exit quickly. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove the DB consistency check from pacman and libalpm.Chantry Xavier2007-09-16
| | | | | | | | | | | | This reverts commit dfc85cb5f516ffbcff557522e9703c5c7d88b047 and b6f3fe6957d0206485eac98fb2120578b75d0058. This DB check is already in testdb (among others). Also testdb now uses the db path set at make time by default, so specifying the db path is optional. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* make alpm_strerror binding friendlyStefano Esposito2007-09-11
| | | | | | | | | | | | | | | | | I'm currently working on python bindings for alpm written in pyrex. While working i found that declaring alpm_strerror as char * alpm_strerror (void) instead of char * alpm_strerror (int err) and then using pm_errno in the implementation instead of err, could make it more bindings-friendly. Dan: cleaned up and added void to declaration. Instead of replacing existing function, add a new function called 'alpm_strerrorlast(void)'. Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* separate local from sync dbs on filesystemTravis Willard2007-08-26
| | | | | | | | | | | | | | | | Introduce two new methods into the API - alpm_db_register_sync and alpm_db_register_local, which replace the functionality of alpm_db_register. db_register_local always returns the local DB, and db_register_sync will always try to register a sync DB. This conceptually separates the local DB from sync DBs in the code. Also updated the pacman frontend to use the new functions. In addition, this changes the location of all sync DBs in the filesystem from $DBPATH/$REPO to $DBPATH/sync/$REPO, This removes the silly limitation that a sync DB couldn't be named 'local', along with structurally separating sync DBs and the local DB in the filesystem. Signed-off-by: Travis Willard <travis@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman.c: clarify reason for doing 2 strcmp operationsDan McGee2007-08-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Various valgrind mem leak fixesDan McGee2007-08-21
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a default cachedir if one wasn't specifiedDan McGee2007-08-21
| | | | | | | Use the default cachedir (specified at compile time) if one wasn't specified on the command line or in the config file. Signed-off-by: Dan McGee <dan@archlinux.org>
* Post trial install changes, round oneDan McGee2007-08-21
| | | | | | | | | | | | | | A bunch of changes related to my first "real" install of pacman-git into /usr/local and trying to use it. * Shift some uses of free -> FREE in libalpm. * Move stat and sanity checks of config paths into libalpm from the config and argument parsing in pacman.c. * Fix issue where dbpath still was not defined early enough due to its requirement for being used in alpm_db_register. This should be rewritten so it doesn't have this dependency, but this will work for now. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix some errors spit out by -WextraDan McGee2007-08-16
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman.c: Alphabetize listing of query optionsDan McGee2007-08-16
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* new query options : explicit (-Qe) and deps (-Qd).Chantry Xavier2007-08-15
| | | | | | | | | | | The t shortcut for --test was removed, the orphan option (previously -Qe) was renamed to -Qt, -Qe lists all packages installed explictly, and -Qd lists all packages installed as dependencies. Besides, t can be combined with either e or d. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Cleanup of pacman.c and addition of default paths to frontendDan McGee2007-07-23
| | | | | | | | | | Instead of barfing when the root path and db path haven't been defined, have pacman set them to some sane defaults when they aren't specified on either the command line or the config file. Also do some cleaning of error output and Doxygen comments. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add --asdeps option to pacmanDan McGee2007-07-15
| | | | | | | | | | This replaces the former -D operation that was undocumented and rather hacky. It can be used with add, upgrade, or sync transactions and will affect all packages installed. Should close FS #7193. Also tell makepkg to use this new flag. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove gettext calls from all PM_LOG_DEBUG messagesDan McGee2007-07-10
| | | | | | | There is no real reason to burden our translators with these messages, as anyone helping to debug these will probably want them in English. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove lockfile configuration from frontend, make it job of libalpmDan McGee2007-06-27
| | | | | | | | | | | | I previously introduced some patches to make just about every path in pacman/libalpm configurable; doing this with the lockfile seemed a bit too far and we really should just place the lockfile where it belongs- with the DB that needs locking. More details in this thread: http://archlinux.org/pipermail/pacman-dev/2007-June/008499.html Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman.c: make parseconfig a bit more robustDan McGee2007-06-27
| | | | | | Don't let parseconfig overwrite settings that parseargs already made. Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman.c: Refine error messages used by parseconfigDan McGee2007-06-09
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow multiple CacheDirs to be specifiedDan McGee2007-06-09
| | | | | | | | | This should hopefully allow multiple cache dirs to be specified in pacman.conf and/or on the command line, and allow pacman to test each one for the package file. The first one found to be writeable is used as the download cache. Signed-off-by: Dan McGee <dan@archlinux.org>
* Implement a -Qt operation in frontend to test the databaseDan McGee2007-06-09
| | | | | | | | After adding a alpm_db_check() operation in the back end, we can call it in the front end and present a user-friendly interface to it. Inspired-by: VMiklos <vmiklos@frugalware.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix up things after the last few changesDan McGee2007-06-09
| | | | | | | | | * Readd default logmask of ERROR and WARNING * Remove DOWNLOAD log level as it no longer applies * Add 'no targets' logic back in where it applies * Switch some prints in parseconfig to ERROR Signed-off-by: Dan McGee <dan@archlinux.org>
* Revamp pacman.c main function ordering, switch some output to pm_printfDan McGee2007-06-09
| | | | | | | | | | Reorder some of the initilization stuff in pacman.c, as well as remove some code that should be reimplemented elsewhere- checking the target list to see if it is NULL. Change the temp printf statements in parseconfig to pm_printf as well. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix up outstanding parseconfig issuesDan McGee2007-06-04
| | | | | | | | The db variable was left unset when calling alpm_db_register, leading to a failure to ever register a sync db. Also added a check to ensure DBPath was set when trying to register a database. Signed-off-by: Dan McGee <dan@archlinux.org>
* Rip alpm_parse_config out of libalpmDan McGee2007-06-04
| | | | | | | | | | Switch over to the new frontend parseconfig. * Fix a few issues in parseconfig * Remove unused callback upon database registration * Remove conf file related errors from error.c/alpm.h Signed-off-by: Dan McGee <dan@archlinux.org>
* Move three config options out of the backendDan McGee2007-06-04
| | | | | | | | Move chomp, usecolor, and showsize out of the backend and into the pacman frontend as they are pacman-specific options and not related to the behavior of libalpm. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a parseconfig to the pacman frontend that compilesDan McGee2007-06-04
| | | | | | Warning: this compiles but may not work as intended quite yet. :) Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove hardcoded defines from libalpmDan McGee2007-06-04
| | | | | | | | Remove any use of the former path variables defined by the Makefiles or config.h. These are now runtime configurable only with pacman.conf (or by using flags on the command line). Signed-off-by: Dan McGee <dan@archlinux.org>
* Change -z|--showsize flag to ShowSize pacman.conf optionNathan Jones2007-06-01
| | | | | | | Also cleaned up some duplicate printf lines related to the ShowSize option. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Move DB and cache dirs away from there dependence on ROOTDIRDan McGee2007-05-31
| | | | | | | | | | | | | | | | | | | This change allows us to use all autoconf specified paths, most notably $(localstatedir). It is quite a change and touches a lot of files, as all references to the DB and cache were done with the ROOTDIR as a prefix. * add --lock command-line option to pacman to specify the location of the lockfile (this can now be specified at configure time by setting the $localstatedir path). * Rip quite a few settings out of configure.ac as they are now picked by setting the paths during configure or make. * Fix bug with /tmp fallback for sync downloads not working correctly (related to root location, now the system tmp dir is used). * Simplified the parameters to some libalpm functions, and added get/set for the new lockfile option. * Renamed several of the DEFS to names without the PM_ prefix. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add -Qee option for the original behavior of -QeChantry Xavier2007-05-20
| | | | | | | | | | | -Qee now lists "orphans" the way pacman used to - that is, -Qe lists packages required by nothing that were installed as a dependency, but -Qee lists all packages not required by something else. Also, I snuck in a compile fix for my real_path cleanup earlier, heh Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* Display size for packagesNathan Jones2007-05-14
| | | | | | | | | This patch adds a -z|--showsize option to the -Q and -S commands. The option displays the size of individual packages. This is something that I have wanted for a while, and there is a feature request for it. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Set HTTP_USER_AGENT envvar in pacmanDan McGee2007-04-28
| | | | | | | | | | Instead of using libdownload's default user agent string, make one of our own. Format: Pacman/3.0.1 (Linux i686 2.6.21-rc7-ARCH; en_US.utf8) libalpm/1.0.0 Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a cb_log call on segfaultsDan McGee2007-04-28
| | | | | | | This should make it easier to see exactly where a segfault occurs; old method was prone to output flushing issues. Signed-off-by: Dan McGee <dan@archlinux.org>