summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
Commit message (Collapse)AuthorAge
* libalpm/deps.c : split alpm_depcmp.Chantry Xavier2007-07-17
| | | | | | | | That function wasn't big, but this might be useful for later refactoring of the search for satisfier code. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/deps.c : split sortbydeps function.Chantry Xavier2007-07-17
| | | | | | | | | | | The _alpm_sortbydeps function has two main part : 1) initialization of the graph structure 2) the sorting itself So it didn't seem bad to move the first part to a second function. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* new pmdepend_t / pmdepmissing_t accessors.Chantry Xavier2007-07-16
| | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/deps.c : cleanup + little fix for resolvedeps.Nagy Gabor2007-07-15
| | | | | | | | The resolvedeps function was a bit negligent, as showed by the sync011 pactest. Reference : http://www.archlinux.org/pipermail/pacman-dev/2007-July/008782.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* libalpm/deps.c : fix for remove044 pactest.Chantry Xavier2007-07-13
| | | | | | | | | | | | | | Patch from Nagy that makes removedeps use alpm_depcmp. I also renamed removedeps to recursedeps, as it can have a more general usage, and added an include_explicit argument, so we can control if packages explictly installed are added or not. Note: Small changes made by me (Dan) as well- mostly some English grammar correction and a few other cleanups. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Some doxygen comments.Andrew Fyfe2007-07-12
| | | | Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
* Remove some more conditional include stuffDan McGee2007-07-12
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove versioncmp.{c,h}, clean up selective #ifdefsDan McGee2007-07-12
| | | | | | | | | Remove versioncmp.c by moving all functions to locations that make sense. Move replacement functions (for building without glibc) into util.c where they belong, and do proper checks for them instead of using __sun__, etc. 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>
* Cleanup of pacman_deptest()Andrew Fyfe2007-07-10
| | | | | | | | Clean up some left over code from http://projects.archlinux.org/git/gitweb.cgi?p=pacman.git;a=commitdiff;h=7653bb93997f52848b54ab80868cd6da52808a75 Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
* Make alpm_splitdep immutableNagy Gabor2007-06-26
| | | | | | | | The alpm_splitdep function formerly overwrote the input string, causing a few issues. Fix this. Signed-off-by: Nagy Gabor <ngaba@petra.hos.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary trans parameter from _alpm_checkdepsNagy Gabor2007-06-26
| | | | | | | The trans parameter was never used, so remove it. Signed-off-by: Nagy Gabor <ngaba@petra.hos.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Implement simple topological sort algorithm for sortbydepsNagy Gabor2007-06-10
| | | | | | | | | | | | | | | | Based on the "depth first search" algorithm, for more infos visit: http://en.wikipedia.org/wiki/Topological_sorting The previous algorithm used by sortbydeps was too slow, and to work around it the number of steps needed to get correct result was reduced greatly. So it produced wrong results in several cases : 1) smoke001.py 2) http://bugs.archlinux.org/task/7229 More here: http://archlinux.org/pipermail/pacman-dev/2007-April/008057.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure correct and consistent usage of depmissChantry Xavier2007-06-10
| | | | | | | | | See comment from Nagy here : http://www.archlinux.org/pipermail/pacman-dev/2007-April/008134.html This also makes easier correct usage of checkdeps in sync.c, which fixes sync901 pactest (and so bug 6057). Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix for removing a package that is no longer neededChantry Xavier2007-06-10
| | | | | | | | | | | | Fix for remove041 pactest. You could not remove a package before that was provided by something else already installed on the system. This fixes this problem. Reference: http://archlinux.org/pipermail/pacman-dev/2007-April/008131.html http://archlinux.org/pipermail/pacman-dev/2007-April/008134.html Signed-off-by: Dan McGee <dan@archlinux.org>
* Small speed-tuning to upgrade-checkdepNagy Gabor2007-06-10
| | | | | | | Posted on the ML here: http://archlinux.org/pipermail/pacman-dev/2007-April/008131.html Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix issue when upgrading two packages that would break depsNagy Gabor2007-06-10
| | | | | | | Fixes for pactest upgrade060. Posted on the ML here: http://archlinux.org/pipermail/pacman-dev/2007-April/008130.html Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix breakage in checkdeps when upgrading a multiple-dependNagy Gabor2007-06-10
| | | | | | | | Fixes pactest upgrade059. Posted on the ML in the following messages: http://archlinux.org/pipermail/pacman-dev/2007-April/008127.html http://archlinux.org/pipermail/pacman-dev/2007-April/008129.html Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary casts on malloc and elsewhereDan McGee2007-05-14
| | | | | | | | | We had many unnecessary casts, most of them dealing with malloc and other memory allocations. The variable type should take care of it; no need to do it explicitly. In addition, I caught a const error while removing the casts. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove STRNCPY macro from libalpmDan McGee2007-04-29
| | | | | | | Replaced calls to the STRNCPY macro with the actual strncpy function, and pacman passes all pactests. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREELISTPTR macroDan McGee2007-04-28
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove FREEPKG macro and correctly type _alpm_pkg_freeDan McGee2007-04-28
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Clean up gettext on the libalpm sideDan McGee2007-04-26
| | | | | | | Remove inclusion of libintl.h from all files, because we can do it once in util.c where the _() macro is defined. Signed-off-by: Dan McGee <dan@archlinux.org>
* Using wrong variable for depend lookup in sortbydepsNagy Gabor2007-04-22
| | | | Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
* James Rosten <seinfeld90@gmail.com>Aaron Griffin2007-03-19
| | | | | | * Two new pactest test cases * Fix some "required by" / "requires" output by unifying all "dependency types" to a single value (PM_DEP_TYPE_DEPEND)
* * Fixed an error with 'cascade' removal due to creation of a new pmpkg_t structAaron Griffin2007-03-12
| | | | (and thus not copying pertinent data w.r.t. reading package files)
* * Fix group comparison issue and associated compilation warnings by usingDan McGee2007-03-11
| | | | | | | the alpm strcmp operation which takes void* references. * We had this great visibility patch, but never actually took advantage of it. Added the right compile flag to make it work and added some more SYMEXPORTs where necessary to have a successful compile.
* * Bug fix for makepkg dependency testing. This requires that weAaron Griffin2007-03-07
| | | | | expose alpm_splitdep and alpm_depcmp as public symbols * Removed a duplicate strtrim for question responses
* 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.
* * A little more hacking with wchar_t output, but nothing really changed inDan McGee2007-03-03
| | | | | | | it. Eventually we'll make progress. * Rewrote the _alpm_splitdep function to behave more like all our other function calls. Use heap instead of stack allocation for the depend struct, so now it needs to be freed by the caller.
* Big commit this time:Aaron Griffin2007-03-03
| | | | | | | | | | | | | | | | | | | | | | | * Moved entirely to alpm_pkg_get_* accessors, to read data on demand * Mostly removed the INFRQ_ parameters from outside the be_files backend (making the backend more extensible in the long run) * packages created from _alpm_db_scan now have the db and origin set (making accessors actually work for these packages) * removed _alpm_db_ensure_pkgcache * totally revamped the _alpm_checkconflicts function, making it cleaner and easier to read (and thus fix in the long run) - maintainable code ftw NOTE: feel free to rename the functions... I couldn't think of anything better * removed an extra loop in sync.c:find_replacements - no sense in looping over an entire DB while strcmp'ing the name, when we have get_pkgfromcache Other: * package struct "license" -> "licenses" * Created _alpm_sync_find (duplicate code in some places, find_pkginsync * Minor const correctness changes along the way * fixed a couple extra '/' pathing issues (non-issues really) * removed a duplicate pkg_cmp function
* * Comment clarificationAaron Griffin2007-03-01
|
* * Switched some functions to alpm_pkg_get_* usage as I came across themAaron Griffin2007-03-01
| | | | | | | | | | | * Added some provision switching hackery. This could probably use some refactoring,.. it solves the following case: pkg1 and pkg2 provide 'foo' and are both installed pkg3 depends on 'foo' and so lists 'pkg1' in the REQUIREDBY db section pkg1 is upgraded and no longer provides 'foo' ** This code ensures that the REQUIREDBY of pkg3 is updated to require pkg2 now instead of pkg1
* * Added another test as suggested by Nagy on the ML- a package both providesDan McGee2007-02-28
| | | | | | | | | | | | for and is a dependency of another package. (upgrade057) * Removed man2html stuff from doc/Makefile.am. * Patch: improved depends checking in _alpm_checkdeps Nagy Gabor <ngaba@petra.hos.u-szeged.hu> * Slight revisions to pmrule.py to allow for a PKG_PROVIDES test. * Very quick updates to the pactest README. * Added rules to some of the newer upgrade tests. Note: upgrade055 now fails due to requiredby entries not being written packages that are dependencies in a provides role.
* * Enforce const char* params when using stringsAaron Griffin2007-02-26
| | | | | | | * Unified some functions names "package" -> "pkg" for consistency * Removed the goofy 'faketarget' stuff used for dep testing * Renamed alpm_pkg_isin -> alpm_pkg_find * Renamed alpm_db_readpkg -> alpm_db_get_pkg
* * Fixed inconsistency of args- _alpm_db_read, _alpm_db_write.Dan McGee2007-02-21
|
* * Some cascade removal changes. Mainly code cleanup, but this is an attempt toAaron Griffin2007-02-20
| | | | | track down the great "Codemac Segfault" * Fixed sortdeps - use the alpm_pkg_get functions to ensure data
* * Fix version comparisons when one pkgrel doesn't exist (this ony fails on an ==Aaron Griffin2007-02-18
| | | | operation, technically, as 1.1.2-1 >= 1.1.2 is true.
* * Removed unnecessary #defineDan McGee2007-02-16
| | | | * Added comment for something I noticed while looking through code
* Switched an int to an enumAaron Griffin2007-01-31
|
* Debug logging changes:Aaron Griffin2007-01-31
| | | | | | | | | | | | | | | | * 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.
* K. Piche <kevin.piche@cgi.com>Aaron Griffin2007-01-30
| | | | * ALPM_LOG_FUNCTION macro and all the great work to add this macro everywhere
* 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
* * Remove -fno-strict-aliasing as it is now unnecessary to compile.Dan McGee2007-01-30
| | | | | | * Fix up add.c a bit better than it was in regards to FS #3492. * Optimized the sqrt call in dependency cycle checking to a single call. * Removal of an outdated comment.
* Discussed on IRC for a bit, this makes the following changes for clarity:Dan McGee2007-01-30
| | | | | | | | * alpm_list_is_in --> alpm_list_find * alpm_list_is_strin --> alpm_list_find_str * Flip parameters of both functions to be inline with rest of alpm_list. First commit, woohoo.
* Dan McGee <dpmcgee@gmail.com>Aaron Griffin2007-01-26
| | | | | | * Lots of code cleanup, and type fixes * Make 'makeworld' a bit more in-line with the other stuff * Make -Si and -Qi operations appear the same
* This mainly deals with code clarity- removing currently unneededAaron Griffin2007-01-24
| | | | | | | | | | optimizations in order to make the code much more readable and type-checkable. Every enum in the library now has it's own type that should be used instead of the generic 'unsigned char'. In addition, several #define statements dealing with constants were converted to enums. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* Preliminary checkin for alpm_list conversionAaron Griffin2007-01-19
| | | | | | | | | * 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
* Dan McGee <dpmcgee@gmail.com>Aaron Griffin2007-01-18
| | | | | | | | | | | | | | * Removed some unnecessary headers and library links * Made things static if possible * Cleaned up makefiles a bit * Fixed some old comments in the code * Fixed some errors the static code checker splint pointed out * Backwards arguments in a memset call in _alpm_db_read (could have been worse) * Other various small fixes Other: * Default to 80 columns when getcols cannot determine display width * Removal of ._install as a valid install file in packages
* Corrected -Rsc operation - dependancy info was not being read from the DBAaron Griffin2006-12-05
|