summaryrefslogtreecommitdiff
path: root/src/util
Commit message (Collapse)AuthorAge
* testdb : extend the tool to allow checking sync dbs too.Xavier Chantry2008-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | Example usage and output : > src/util/testdb -h usage: testdb [-b <pacman db>] : check the local database testdb [-b <pacman db>] core extra ... : check the listed sync databases > src/util/testdb Checking the integrity of the local database in /var/lib/pacman/ > src/util/testdb core extra testing community Checking the integrity of the sync databases in /var/lib/pacman/ missing dependency for archboot : bcm43xx-fwcutter>=006-2 missing dependency for xvattr : xfree86 missing dependency for eclipse-ve : eclipse<3.3 missing dependency for flumotion : twisted-web missing dependency for gg2 : arts missing dependency for man-pages-cs : groff-utf8 missing dependency for qc-usb : kernel26<2.6.26 Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Rename alpm_db_get{pkg,grp}cache to alpm_db_get_{pkg,grp}cacheXavier Chantry2008-08-25
| | | | | | | | This is more consistent with the private functions : _alpm_db_get_{pkg,grp}cache Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Change checkdeps and checkdbconflicts to be more flexible.Xavier Chantry2008-08-25
| | | | | | | | These two functions now take directly a package list rather than a database. checkdbconflicts was renamed to checkconflicts. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Use access() instead of stat() when possibleDan McGee2008-06-15
| | | | | | | | | | | | | | | | | | | We were using the stat() system call in quite a few places when we didn't actually need anything the stat struct returned- we were simply checking for file existence. access() will be more efficient in those cases. Before (strace pacman -Ss pacman): % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 33.16 0.005987 0 19016 stat64 After: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 34.85 0.003863 0 12633 1 access 7.95 0.000881 0 6391 7 stat64 Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2008-04-07
|\
| * Add *.exe ignores for certain other platformsDan McGee2008-04-07
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm error cleanup, step 1Dan McGee2008-04-06
| | | | | | | | | | | | Remove unused error codes, begin refactoring some of the others. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-03-09
|\| | | | | | | | | | | Conflicts: configure.ac
| * testpkg reworkNagy Gabor2008-03-01
| | | | | | | | | | | | | | | | | | | | * mainly code cosmetics (indent fixes) * remove debug message "spam" * print also user friendly result Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: a few more whitespace/linebreak cleanups added] Signed-off-by: Dan McGee <dan@archlinux.org>
* | testdb : add conflicts checking.Chantry Xavier2008-01-23
|/ | | | | | | | | | | | Testdb will now scan the local database to check there are no conflicts. I'm not sure how it's possible to get this situation. At least pacman doesn't allow installing a package that conflicts with a local one, without removing the local one. But maybe in a very weird situation, or because of a bug, it could be possible. But anyway, this only requires 5 lines of code. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* testdb : fix wrong usage of checkdeps.Chantry Xavier2007-12-21
| | | | | | | | | | During last rebase where the checkdeps prototype changed, I messed up the arguments order (remove list, then upgrade list). That made testdb totally useless. Also remove the newline that was manually added by the log callback. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update GNU GPL boilerplate and copyright datesDan McGee2007-12-10
| | | | | | | 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>
* testdb.c : add vim modeline according to HACKING, and reindent the file.Chantry Xavier2007-12-08
| | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix for sync1003 and sync1004 pactestsNagy Gabor2007-11-25
| | | | | | | | | | | | | | | checkdeps and resolvedeps now take both a remove list and an install list as arguments, allowing dependencies to be calculated correctly. This broke the sync990 pactest, but this pactest used dependencies and provides in an unusual way, so it has been changed. Dan: the sync990 pactest was just plain wrong. It didn't satisfy the dependencies correctly, so should never have succeeded. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> [Dan: some variable renaming, clarification in commit message] Signed-off-by: Dan McGee <dan@archlinux.org>
* War on whitespaceDan McGee2007-11-16
| | | | | | Run the kernel's cleanfile script on all of our source files. Signed-off-by: Dan McGee <dan@archlinux.org>
* testdb: remove requiredby checkingDan McGee2007-11-14
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove REQUIREDBY usage from libalpmDan McGee2007-11-14
| | | | | | | | | | | | Instead of using the often-busted REQUIREDBY entries in the pacman database, compute them each time they are required. This should help many things: 1. Simplify the codebase 2. Prevent future database corruption 3. Ensure when we do use requiredby, it is always correct 4. Shrink the pmpkg_t memory overhead Signed-off-by: Dan McGee <dan@archlinux.org>
* vercmp: add some usage instructionsDan McGee2007-11-04
| | | | 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>
* 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>
* One more added include to help compilation elsewhereDan McGee2007-10-23
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* 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>
* 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>
* 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>
* src/util: Clean up headers and a few fixesDan McGee2007-08-15
| | | | | | | Remove some unnecessary headers in the two utilities as well as fix a possible non-null termination issue in vercmp. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary entries from .gitignore filesDan McGee2007-07-16
| | | | | | | .gitignore works recursively, so we don't need Makefile and Makefile.in in all of the subdirectory .gitignore files. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove logmask stuff from backend; switch logging callback to new pm_printfDan McGee2007-06-09
| | | | | | | | | | Remove the logmask functionality from the backend as it has been moved to the frontend, and change the logging callback function to use pm_printf. In addition, make much better use of va_list- use the args list instead of a arbitrarily chosen string to print to in the logging functions. Signed-off-by: Dan McGee <dan@archlinux.org>
* Autotool clean up.Andrew Fyfe2007-06-04
| | | | | | | | | * Add vim modeline to Makefile.am and configure.ac * Fix white space in Makefile.am and configure.ac * Add contrib/wget-xdelta.sh to EXTRA_DIST in Makefile.am Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
* Set the correct type on the log callback functionDan McGee2007-04-26
| | | | | | | Somehow missed this earlier when changing everything to types. unsigned short -> pmloglevel_t wherever necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add -pedantic flag to pacman (frontend) CFLAGSDan McGee2007-04-26
| | | | | | | Now that we got rid of the ERR and WARN macros, compilation with -pedantic turned on works with only minor changes. Signed-off-by: Dan McGee <dan@archlinux.org>
* Move .cvsignore -> .gitignoreDan McGee2007-03-27
| | | | | | | | * Move all .cvsignore files to .gitignore for switch in VCS. In addition, delete ones that were unnecessary because they only contained Makefile and Makefile.am. Signed-off-by: Dan McGee <dan@archlinux.org>
* * Removed ${CFLAGS} from Makefile.am(s) as it was causing all CFLAGS to beDan McGee2007-03-12
| | | | | | | | duplicated. * Updated the util Makefile.am to link with the proper libalpm.la. * Fixed bitmasking issues in be_files.c and db.h. * Rankmirrors updates from James Rosten (with some cleaning up of my own). KeyboardInterrupts are now handled gracefully.
* This commit looks much more monumental than it is. Almost all just #includeDan McGee2007-03-05
| | | | | | | | 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.
* * handle changes: callbacks should check handle first, as there's a fewAaron Griffin2007-03-04
| | | | | | | | | occasions where some alpm stuff could be used without initializing the library (vercmp is one). TODO make these functions (handle accessors) better by returning "library not initialized" instead of failing. * Removed NoUpgrade lines from pacman.conf - we need to test this! * Re-corrected the lib targets for src/util/* * make dist seems to have updated the po files
* * libtool fixes for building against the right libsAaron Griffin2007-03-04
|
* * A lot of Makefile.am updates to try to get 'make dist' and 'make distcheck'Dan McGee2007-02-22
| | | | to work as expected.
* TODO update and .cvsignore additionDan McGee2007-02-12
|
* Added 'testpkg' binary to test for validity of a package:Aaron Griffin2007-02-12
| | | | | testpkg <package file>, returns 0 on success, 1 on failure failure will also output error messages to stdout
* * Fix compile errors/warnings.Dan McGee2007-02-09
| | | | * Update .cvsignore files a bit.
* * I made "alpm_versioncmp" public a while back, without noticing this was ↵Aaron Griffin2007-02-09
| | | | | | already done (alpm_pkg_vercmp). I dropped this change, making versioncmp "private" again. (alpm_versioncmp -> _alpm_versioncmp, hidden symbol) * Make alpm_get_upgrades use the same version check that -Su and -S use.
* K. Piche <kpiche@rogers.com>Aaron Griffin2007-01-30
| | | | | | | * gcc visiblity changes Also modified _alpm_versioncmp -> alpm_versioncmp (public function) as per K. Piche's suggestions
* * Fix building outside $(srcdir).Jürgen Hötzel2007-01-29
| | | | | * Removed ./gen-mirrorlist.sh invocation from configure script: Mirror-files are generated by make, not configure.
* -std=c99 seems to undefine PATH_MAX in this case. I don't care enough to fix itAaron Griffin2006-11-23
| | | | at the moment, so this workaround works.
* * Whoops util MakefileAaron Griffin2006-11-22
| | | | * Slight modification to depcmp debug output
* * Completed getinfo api changes (pmmissing_t, pmtrans_t, etc)Aaron Griffin2006-11-22
| | | | | | | | * 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
* Whoops, actually remove convertdb this timeAaron Griffin2006-10-15
|
* Removed convertdbAaron Griffin2006-10-15
|