summaryrefslogtreecommitdiffstats
path: root/src/pacman/query.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-20Add download size to target list.Nathan Jones1-1/+1
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>
2007-09-28Add 'full' parameter to alpm_pkg_loadDan McGee1-1/+1
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>
2007-09-17Remove the DB consistency check from pacman and libalpm.Chantry Xavier1-29/+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 some small changes recommended by splintDan McGee1-9/+11
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16new query options : explicit (-Qe) and deps (-Qd).Chantry Xavier1-0/+10
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-08-16libalpm/query.c : makes orphans and foreign options as filters.Chantry Xavier1-129/+76
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>
2007-07-12Fix previous makepkg patch, and some pacman output.Andrew Fyfe1-3/+3
makepkg: We still need the source files in $srcdir because PKGBUILDS need access to noextract() files and other file not handled by by extract_source(). (eg config files) query.c: Fix some output formating. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-07-02pacman/query.c : return after a query on all packages.Chantry Xavier1-0/+1
Previously, the following error was displayed even after a valid and successful query operation on all packages, like -Q , -Ql, -Qi, -Qil : no targets specified (use -h for help) Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-06-13Clean up pacman/sync.c and organize it a bitDan McGee1-1/+2
Re-add some checks for a valid target list. In addition, move variable declarations to the most local scope possible, which should help in finding errors that were previously uncaught. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-13Functionalize query.c and pacman_queryDan McGee1-111/+168
Move a lot of the operations that pacman query performs into their own functions for ease of following the flow and for possible later merges with their sync counterparts. We need to think less in terms of operations and more in term of overall concepts. Also (re)introduced checks for the target list on a -Q operation, ensuring that we only call certain query operations when it is sane to do so. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09Implement a -Qt operation in frontend to test the databaseDan McGee1-0/+20
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>
2007-06-05Const correctness!Dan McGee1-2/+2
Add some 'const' keywords all over the code to make it a bit more strict on what you can and can't do with data. This is especially important when we return pointers to the pacman frontend- ideally this would always be untouchable data. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-05Merge branch 'alpm.c_cleanup' into frontend_configDan McGee1-1/+1
Conflicts: lib/libalpm/alpm.c
2007-06-05Rip alpm_parse_config out of libalpmDan McGee1-1/+1
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>
2007-06-05Move functions out of alpm.c to where they belongDan McGee1-1/+1
alpm.h is the only "publically viewable" file, so there is no reason to have functions in alpm.c that belong in package.c, db.c, etc. Move the functions where they belong and leave only the library init functions in alpm.c. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-02Move parts of pacman_query into subfunctions (query_search, query_group, ↵Chantry Xavier1-179/+235
query_isfile) Clean up pacman_query so functionality is actually in functions, similar to how sync.c is organized. After doing this, it is easy to see similarity in the code between sync.c and query.c, so we should be able to consolidate some of this. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-01Change -z|--showsize flag to ShowSize pacman.conf optionNathan Jones1-7/+5
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>
2007-05-31Move DB and cache dirs away from there dependence on ROOTDIRDan McGee1-2/+3
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>
2007-05-31Set an error exit status on -Qi or -Si failureDan McGee1-17/+11
Regression from 2.9.8 where a failed -Qi lookup did not return an error on exit. The exit status is now incremented for each error encountered. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-05-20Add -Qee option for the original behavior of -QeChantry Xavier1-2/+3
-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>
2007-05-18Fix broken resolve_path functionAaron Griffin1-21/+7
Removed some unneeded path munging so that our relative paths resolve properly. This closes FS#7068 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-05-14Display size for packagesNathan Jones1-1/+11
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>
2007-05-07Clean up query_fileownerDan McGee1-8/+8
* gotcha -> found * line wrap changes Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-27Remove output.c and output.hDan McGee1-1/+0
One function was left in this set of files after the earlier cleansing, so I moved yesno to util.c. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26Remove ERR calls from the codeDan McGee1-11/+14
All ERR() calls have been replaced with fprintf(stderr, ...). Still to be done- fix all the newline issues that are sure to pop up. What fun! Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26Remove MSG output macro (#define and in code)Dan McGee1-11/+11
This is the first step of converting output to standard functions such as printf, and eventually allowing compiliation with the -pedantic flag as is done on the libalpm side. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26Move log.c/h -> output.c/h to properly reflect what is containedDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-26More pacman side cleanupDan McGee1-1/+2
* Cleaned up more of the header #includes, and got rid of a lot of stuff that was due to trying to make it compile on BSD/Darwin/CYGWIN. We can add it later but lets keep it simple for now and do it in seperate files if possible later. * Removed a lot of #define MACROS. Some were not even used, and others were only used a few times. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25Remove more unnecessary stuffDan McGee1-1/+0
* Remove libintl.h from most files, as we only need to include it once in util.h where _() is defined. * Remove other unnecessary header inclusions. * Remove a macro that was only used once and replaced it with actual code. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-04-25Merge single-function header files on pacman sideDan McGee1-2/+1
Having a seperate header file for add, remove, query, etc. seemed overkill. Merge them all into a common pacman.h and fix the necessary #includes. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-03-22* -Qo now properly resolves paths when finding an ownerAaron Griffin1-8/+45
NOTE that we do NOT want symlinked *files* resolved, only paths (i.e. /usr/lib/perl5/site_perl/*)
2007-03-21* Typo fix.Dan McGee1-1/+1
2007-03-21* Fix asking the user to upgrade when using -SpAaron Griffin1-2/+13
* More significant error messages when -Qo fails * Potential fix for reported error that pacman indicates corrupt packages when space is full on the cache dir
2007-03-12* Fixed -Qil regression, now both flags are honored. (FS #1355)Dan McGee1-12/+11
2007-03-06* -Qs was returning an error if no package found, which is not the same ↵Dan McGee1-1/+1
behavior as -Ss.
2007-03-05This commit looks much more monumental than it is. Almost all just #includeDan McGee1-1/+4
reordering and adding ones that were forgotten (noticed when trying to compile after reordering). * Updated the HACKING file to include information on #include usage. * print -> vprint in "making dir" function in pactest.
2007-02-26* pacman hidden arguments: removed -Y and -D. -T is the only hidden arg now, toAaron Griffin1-4/+4
be used in place of -Y. Also, -D was rather silly, as it does mostly what -S does. * Cleaned up pacman_deptest - removed the goofy faketarget stuff (NEEDS testing still) * libalpm function renames
2007-02-12* Updated the README fileAaron Griffin1-4/+1
* Removed the handle->needles param. It's not needed not that alpm_list_t is public
2007-02-07* Fix total transfered size on download barAaron Griffin1-45/+34
* Fix -Qm segfault * Minor query cleanup
2007-02-06* Makepkg updates, and small bugfix on man page compression.Dan McGee1-1/+1
* Change libtool default to makepkg2 behavior. * Other small changes.
2007-02-04Implemented a crappy version of -Qu (query upgrades). This simply outputs theAaron Griffin1-0/+13
packages to be upgraded in a -Su operation. Much of the code is duplicated from sync.c. TODO: move the implementation to upgrades.c, and reimplement the sync_sysupgrade function in terms of this: trans->packages = alpm_get_upgrades();
2007-01-31* Make -Qo work on multiple files againAaron Griffin1-9/+7
* no real sense in query_fileowner returning an int
2007-01-31Debug logging changes:Aaron Griffin1-1/+1
* The --debug params were goofy. New setup allows --debug without params, --debug=<level> where level 1=debug output, 2=debug and download output, 3=debug, download, and function tracing output. This seems more sane to me. * Removed PM_LOG_FLOW1 and PM_LOG_FLOW2. They were just confusing. When adding new functions, it is near impossible to determin if your output should be "flow1" or "flow2" without tracking all the way up the call chain. Rarely would one ever say "ok, lets just show "flow2" output. These have both been replaced with PM_LOG_DEBUG * Removed the need for the root parameter on alpm_initialize. it is now defaulted to PM_ROOT just like dbpath and cachedir. This allows alpm to be initialized BEFORE option parsing in the front end, saving us some duplicate variables in the frontend. * Cleaned up front end variables due to early alpm_initialize call.
2007-01-24* Shuffled some of the alpm_list free funtions - still not perfect, but betterAaron Griffin1-5/+12
* Added alpm_list_remove_node for single list node removal * Proper error checking/output for failed db_read/db_write (missing files) * Invalid packages (missing files) are now removed from the package cache * -Qs and -Ss output now look the same * config.rpath causes errors on one machine I had, so I added it to CVS * Fixed a "clobbered memory" issue when installing groups - only the outer list should be free'd, not the contained data
2007-01-19Preliminary checkin for alpm_list conversionAaron Griffin1-61/+40
* renamed pmlist_t -> alpm_list_t * made alpm_list_t a public type (alpm_list.h header) * removed additional storage for registered DBs in pacman source * some code cleanup * removed duplicate (pm)list_display functions from pacman source * misc code cleanup
2006-11-22* Completed getinfo api changes (pmmissing_t, pmtrans_t, etc)Aaron Griffin1-3/+8
* Modified some dependancy checking * Changed "performing local database upgrade" message to be more clear * Change 'usize' to 'isize' in database files * Scriptlet output is now sent to pacman's log file * Limited some debugging output to be more clear
2006-11-20* repo-add script - to add entries to a db file directly from package data ↵Aaron Griffin1-53/+50
(no PKGBUILD) * libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm
2006-11-14* Numerous mini valgrind fixes.Aaron Griffin1-0/+1
* Addition of hacky architecture check in the _splitname function * Removal of libfetch from the archlinux proper - it has been renamed to libdownload and can be found at http://phraktured.net/libdownload * Merge of _some_ of the Frugalware makepkg change - this may still be incomplete * Removal of libftp from cvs proper * PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he)
2006-11-02* Fixed some alpm_get_option calls (long params were used for C99 compliance,Aaron Griffin1-4/+5
but were used in error) * Cleaned up some output newlines * Added "local database is up to date" when no packages are upgraded
2006-10-31Numerous changes:Aaron Griffin1-3/+7
* Added 'ILoveCandy' support to all progress bars * Changed download callback with regards to libfetch libalpm changes * libfetch error output on failed sync * Misc others I may have forgot to name (check the diff, heh)