summaryrefslogtreecommitdiffstats
path: root/src/pacman/pacman.c
AgeCommit message (Collapse)AuthorFilesLines
2008-01-14Disallow a NULL section in _parseconfigDan McGee1-2/+2
If we allow _parseconfig to continue processing when section is not defined, then we have the potential to segfault during strcmp calls. This is no good. For some reason, we had existing logic that tested this case but only if it was processing and 'Include' directive. Expand the check to check for a NULL section in all cases, and print an error message if this is the case. Reported here: http://bbs.archlinux.org/viewtopic.php?id=42235 Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12Make the user-agent string a bit less verboseDan McGee1-4/+2
We shouldn't pass things like the kernel version in the user agent string, as it may be a bit too revealing and is not really necessary. Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=57555 Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11Output a single newline on receipt of a SIGINTDan McGee1-5/+6
Fixes FS#9147, where issuing a ctrl-C at a prompt puts the users prompt on the same line as our question. This can also occur during download bars. Although we might end up putting one too many newlines to the screen now, it is better than not putting one at all. Also update the copyright in pacman.c. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11Rename -t --orphans to -t --unrequired (FS#9144).Chantry Xavier1-3/+3
It turns out the orphan name was misleading. Real orphans are packages installed as dependency no longer required by any others (-Qtd). The -t option only shows package not required by any others, so --unrequired describes it better. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-08Remove upgradedelay and all code associated with itDan McGee1-5/+0
It wasn't even implemented correctly, and it really doesn't have a use if packagers just do their job correctly anyway for a distro. Let's not try to solve a problem with the wrong solution now. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-18Allow unreadable Include files to be non-fatalAaron Griffin1-6/+3
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: remove unused variable, make parseconfig static] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-11Update GNU GPL boilerplate and copyright datesDan McGee1-3/+1
Update the GPL boilerplate to direct people to the GNU website for a copy of the license, as well as bump all of Judd's copyrights to 2007. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04Update some errors in messages found during localizationDan McGee1-2/+2
Also perform the updates in the message files so we don't break translations. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-04Oops- forgot to ever set init to 1 in setlibpaths()Dan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02parseconfig: refactor duplicate code out into a functionDan McGee1-66/+39
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Fixes for the ineptitude of libalpm DB registrationDan McGee1-45/+61
When a DB is "registered" in libalpm, it goes and tries to create paths and other BS which is stupid, but a pain in the butt to fix. For now, work around this terrible behavior by ensuring our paths are always set before we call any alpm_db_register function. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Make pacman path handling (hopefully) a bit more intuitiveDan McGee1-36/+48
I made pacman path handling a bit odd with my rootdir changes a while back in order to increase flexability. However, it had a bit of a drawback in that dbpath/logfile/etc. would not default to being under the rootdir if that was the only parameter you specified in the config file or on the command line. (Note: logfile handling was always broken due to the explicit logfile line required in config files) Pacman now works as follows: if a rootdir is specified but not dbpath or logfile: attempt to place the logfile and dbpath in their default locations under root if an explicit dbpath/logfile is specified: interpret these as absolute paths, regardless of the rootdir setting if nothing is specified: fall back to configured defaults Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02Add new --needed option for -S.Chantry Xavier1-5/+8
During a pacman operation such as a group install, pacman can ask several questions such as "local version is up to date. Upgrade anyway?". They are usually all answered either by yes or by no: * yes when you want to reinstall all the targets. * no when you only want to install the missing ones (either because you are installing a group, or because you are copying a pacman -S line from wiki or whatever). So instead of asking this question for each target, it is now now configured with a flag. Yes will be the default -S behavior, No will be achieved with the --needed flag. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25Move mbasename from pacman.c to util.cChantry Xavier1-22/+0
This function can be useful in other places. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25Add -q/--quiet option for controlling output.Artyom1-1/+7
Currently this only affects -Ss, -Sl, and -Q to output less information (only package names). In the future, we can reuse this flag for other things as well. [Aaron: rewritten as a front-end flag] Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: squashed commits together] Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-21Remove -F/--freshen operationDan McGee1-11/+1
This operation made sense in the days before sync DBs existed, but it no longer has the same usefulness it once did. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-14Make it easier to ignore multiple packages.Nathan Jones1-2/+16
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>
2007-11-14Add help for --ignoregroup.Nathan Jones1-0/+2
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>
2007-11-11pacman: remove leftover help string for -RhDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11Add TotalDownload option.Nathan Jones1-0/+3
This will be used in the next commit. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11Add IgnoreGroup and --ignoregroup option.Nathan Jones1-0/+15
This will be used in the next commit. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-06Add LOGFILE as a define at compile time for pacmanDan McGee1-1/+2
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>
2007-11-04Clean up usage of extern variablesDan McGee1-2/+0
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>
2007-11-04Fix basename usage in pacman and utilitiesDan McGee1-7/+29
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>
2007-10-27Fix mcheck detection and usageDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-23Ensure all localization stuff is correctly guardedDan McGee1-1/+4
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>
2007-10-20Download delta files if UseDelta is set.Nathan Jones1-0/+3
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>
2007-10-15pacman/pacman.c : put back root check even if -r is specified.Chantry Xavier1-3/+1
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>
2007-10-09pacman/pacman.c : add --logfile option.Chantry Xavier1-0/+10
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-10-09Remove the non-user friendly --ask optionDan McGee1-3/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-04needs_transaction adjustmentsChantry Xavier1-1/+3
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>
2007-09-28Break out transaction test to a separate functionAaron Griffin1-15/+3
Added needs_transaction, putting out "hey do we need root?" tests in one place. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-09-28OMG a space!Aaron Griffin1-1/+1
Yeah, I added a space. It deserves its own commit. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-09-28document the -Qii option.Chantry Xavier1-1/+1
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>
2007-09-17trans.c : reworking of transaction interruptionsChantry Xavier1-3/+8
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>
2007-09-17Remove the DB consistency check from pacman and libalpm.Chantry Xavier1-5/+0
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>
2007-09-12make alpm_strerror binding friendlyStefano Esposito1-10/+10
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>
2007-08-27separate local from sync dbs on filesystemTravis Willard1-8/+2
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>
2007-08-22pacman.c: clarify reason for doing 2 strcmp operationsDan McGee1-0/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-22Various valgrind mem leak fixesDan McGee1-2/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-22Add a default cachedir if one wasn't specifiedDan McGee1-0/+5
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>
2007-08-22Post trial install changes, round oneDan McGee1-53/+46
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>
2007-08-16Fix some errors spit out by -WextraDan McGee1-6/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16pacman.c: Alphabetize listing of query optionsDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16new query options : explicit (-Qe) and deps (-Qd).Chantry Xavier1-8/+17
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>
2007-07-23Cleanup of pacman.c and addition of default paths to frontendDan McGee1-40/+51
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>
2007-07-15Add --asdeps option to pacmanDan McGee1-2/+9
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>
2007-07-10Remove gettext calls from all PM_LOG_DEBUG messagesDan McGee1-22/+22
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>
2007-06-28Remove lockfile configuration from frontend, make it job of libalpmDan McGee1-10/+0
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>
2007-06-28pacman.c: make parseconfig a bit more robustDan McGee1-12/+21
Don't let parseconfig overwrite settings that parseargs already made. Signed-off-by: Dan McGee <dan@archlinux.org>