summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* 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>
* Remove final use of the math library from pacmanDan McGee2007-11-04
| | | | | | To round a value, we don't need floorf- we can just cast to an int. Signed-off-by: Dan McGee <dan@archlinux.org>
* When printing size_t, use %zdDan McGee2007-10-29
| | | | | | | | %d was used, which worked for Linux and FreeBSD. Not so for Darwin. The warning was probably spat out when compiling on x68_64 as well, but no developers use this architecture as their primary one. Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman/query.c: add missing free()Dan McGee2007-10-29
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Clean up LDADD usageDan McGee2007-10-26
| | | | | | | | We had a lot of unnecessary overstatements of libraries to include on linking, and autoconf/automake takes care of this for us. This also helps some compilation issues on other platforms. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix mcheck detection and usageDan McGee2007-10-26
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Dependency error/log messages fixNagy Gabor2007-10-26
| | | | | | | | | The old code used only the depend.name in messages, which might have not been informative. The new code uses the whole dependency string in %DEPENDS% format. (Dan: slight English clarification in one of the messages) Signed-off-by: Dan McGee <dan@archlinux.org>
* Add alpm_dep_get_string methodNagy Gabor2007-10-25
| | | | | | | | Public alpm_dep_get_string function is introduced, which converts a pmdepend_t structure to printable string in %DEPENDS% format. This function is now used in pacman to print dependency error messages. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add strndup implemention for environments that are missing itDan McGee2007-10-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* One more added include to help compilation elsewhereDan McGee2007-10-23
| | | | 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>
* Fix broken or missing includesDan McGee2007-10-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add download size to target list.Nathan Jones2007-10-19
| | | | | | | | | | This displays the download size, taking into account delta files and cached files. This closes FS#4182. Signed-off-by: Nathan Jones <nathanj@insightbb.com> 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>
* Remove rounding on package size totalsDan McGee2007-10-16
| | | | | | | | We print the total to two decimal places, so there is no real need for rounding of the values. Remove the rounding and switch all output to two decimal places. 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>
* util/testdb: fix up function namingDan McGee2007-10-10
| | | | | | We shouldn't use the _alpm prefix (copy-paste issue, no big deal). Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman/pacman.c : add --logfile option.Chantry Xavier2007-10-08
| | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Update usage of gcc __attribute__ flagsDan McGee2007-10-08
| | | | | | | | | | | | Change the default visibility of libalpm functions to internal instead of hidden- this allows for slightly better optimization because it tells GCC that the function can never be called outside of the current module (see http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html). Also added some attributes to the pacman print functions so that they check the format strings being passed to them. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove the non-user friendly --ask optionDan McGee2007-10-08
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix -Sy and -Sp operations.Chantry Xavier2007-10-04
| | | | | | | | | | | | | | | | | | When the -Sy operation failed, the lock wasn't removed because alpm_trans_release wasn't called. This is fixed now. Also, after my last change in commit 52e7e6d74733f7a431376a9e528c4fe4d3732068 , Sp didn't do anything anymore. That's because needs_transaction returned false for -Sp, so the sync transaction wasn't run. However, the current implementation of -Sp requires a sync transaction. Also, since a transaction creates the lock file at the beginning, and releases it at the end, this mean that -Sp requires root access anyway.. I think I understand now why Aaron found that the current -Sp implementation is hackish :) Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* 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>
* Allow --refresh specified for most -S optionsAaron Griffin2007-09-28
| | | | | | | | Included options are -g, -i, -s, and -l All of these will sync the DB if -y is specified and permissions are appropriate. 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>
* Support for localized times in metadataAaron Griffin2007-09-28
| | | | | | | | | | | | Packages and DBs now support using the UNIX epoch (seconds since Jan 1, 1970) for use in builddate and installdate. This will only affect newly built packages. Old existing packages with the text format are still supported, but this is deprecated. In the case of removal of text time support, this code will fail gracefully, returning the start of the epoch for broken packages. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* Add 'full' parameter to alpm_pkg_loadDan McGee2007-09-28
| | | | | | | | | | | | | | | | | | | In most cases, we want to fully scan a package when we load it, which serves as a integrity verification check. However, there are times when it is only desired to read the metadata and nothing else, so allow the caller of pkg_load to choose the behavior they need. This pays big dividends in speeding up pacman cache cleaning functionality. Old (729 packages): real 1m43.717s user 1m20.785s sys 0m2.993s New (729 packages): real 0m25.607s user 0m19.389s sys 0m0.543s Signed-off-by: Dan McGee <dan@archlinux.org>
* Update comments dealing with pkgext/dbext strippingDan McGee2007-09-28
| | | | | | | pacman/callback.c already did the work I set out to do with this commit, so update the comments accordingly in the frontend and backend. Signed-off-by: Dan McGee <dan@archlinux.org>
* Reimplement pacman cache cleaning the right wayDan McGee2007-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Partial cache cleaning was eliminated in a previous commit because it relied on package naming conventions. Re-add it the correct way- we actually open up each package in the cache and get a name and version out of it. If the name and version match that of an installed package, keep it. If the package is not installed or the version does not match the locally-installed version, get rid of it. This can easily be modified if some other heuristic of keeping and removing packages is desired, or if we should clean out the cache dir of any files that are not packages, etc. The biggest current problem with this new approach- speed. Here is one run on my local machine, going from 1643 to 729 packages in the cache (753 in the local DB): real 4m25.829s user 3m22.527s sys 0m6.713s This is likely best addressed by the package loading scheme, which may be loading the entirety of each package archive, which is a waste when we only need the .PKGINFO file read. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove package name dependency from libalpmDan McGee2007-09-28
| | | | | | | | | | | | Previously, package names must match a specified scheme or they will cause pacman add operations to fail. This is not a very intelligent or necessary way to act, so remove the dependency on the name of the package to be installed and read all relevant information from the metadata instead. This does have one causality to be addressed later- pacman cache cleaning functionality, which has never been phenomenal, just lost most capability. Signed-off-by: Dan McGee <dan@archlinux.org>
* 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>
* Preliminary support for optdependsDan McGee2007-09-25
| | | | | | | | Add some alpm functions for getting optdepends, have makepkg include them in the PKGINFO file, and have a pacman -Qi operation display the raw string as stored by libalpm. 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>
* Add testdb util for finding inconsistencies in the database.Chantry Xavier2007-09-11
| | | | | 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>
* Make some small changes recommended by splintDan McGee2007-09-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a few missing includes, caught while compiling on cygwinDan McGee2007-09-06
| | | | 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/sync.c : kill extra newline with groups on -Ss operation.Chantry Xavier2007-08-26
| | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* libalpm: add newlines to all strings passed to log callbackDan McGee2007-08-23
| | | | | | | | | This allows us to remove the hack in the frontend where we added a newline to everything coming out of the pm_printf functions, and instead let the developer put newlines where they want them. This should be the last hangover of that auto-newline stuff. 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>
* Remove support for SHA1 from pacman.Andrew Fyfe2007-08-16
| | | | | | | | There's no need for a second hashing algorithm. MD5 serves the purpose of verifying that a package file hasn't been corrupted during download. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> 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>
* libalpm/query.c : makes orphans and foreign options as filters.Chantry Xavier2007-08-15
| | | | | | | | | | The --foreign and --orphans functions now behave as a filter for the other options. This cleans the code a bit, and will make easier the adding of new filter options, like explicit (show only explictly installed packages) or depends (show only packages installed as dependencies). Signed-off-by: Chantry Xavier <shiningxc@gmail.com>