summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.h
Commit message (Collapse)AuthorAge
* Kill PM_TRANS_TYPE_ADD.Chantry Xavier2008-03-17
| | | | | | | This was totally useless. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Move pmgraph_t struct and functions to their own header fileDan McGee2008-02-16
| | | | | | | | This will allow us to utilize this helpful type and functions in places besides dependency calculations. In addition, remove the public declaration of pmgraph_t in alpm.h- there is zero need to expose this internal type. Signed-off-by: Dan McGee <dan@archlinux.org>
* New remove option : -u / --unneeded (FS#6505).Nagy Gabor2008-02-06
| | | | | | | | | | | | | | | | | With --unneeded option 'pacman -R' doesn't stop in case of dependency error; it removes the needed-dependency targets from the target-list instead. See also: http://archlinux.org/pipermail/pacman-dev/2007-October/009653.html . The patch also adds a new causingpkg field to pmdepmissing_t which indicates the to-be-removed package which would cause a dependency break. This is needed, because miss->depend.name may be a provision. miss->causingpkg will be useful in -R dependency error messages too. [Xavier: renamed inducer to causingpkg, removed the _alpm_pkgname_pkg_cmp helper function as requested by Aaron. This might be added by a further commit. Other small cleanups, updated manpage and bash completion.] Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Move the deptest code from frontend to backend.Chantry Xavier2008-01-21
| | | | | | | | | | | | | | | | | | The deptest code (pacman -T) used by makepkg was mostly in the frontend. There were 2 drawbacks: 1) the public splitdep function returns a pmdepend_t struct, but the _alpm_dep_free function for freeing it is private. So there was a memleak. 2) there is a helper in the backend (satisfycmp in deps.c) which makes this function much easier. So this adds a new public alpm_deptest in libalpm/deps.c, which cleans pacman_deptest in pacman/deptest.c a lot. Besides, alpm_splitdep was made private, because the frontend no longer requires it, and _alpm_dep_free is also private. Finally the deptest001 pactest was extended. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add functions to manipulate pmdepend_t objectsDan McGee2008-01-11
| | | | | | | | | | | We didn't have a free function before, causing some memory leaks. We also need a dup function now that strings are not in the structure but are dynamically allocated. Also adapt pmdepmissing_t to use a pointer to a depend struct instead of an inclusive one so we can use the functions we created here. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use dynamic string allocation in package structuresDan McGee2008-01-11
| | | | | | | | | | | | | | This also affects all structures with static strings, such as depmiss, conflict, etc. This should help a lot with memory usage, and hopefully make things a bit more "idiot proof". Currently our pactest pass/fail rate is identical before and after this patch. This is not to say it is a perfect patch- I have yet to pull valgrind out. However, this should be quite safe to use in all situations from here on out, and we can start plugging the memleaks. Original-work-by: Aaron Griffin <aaronmgriffin@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>
* Remove _alpm_depmiss_isinDan McGee2007-12-02
| | | | | | | This is unneeded now that commit 2ed6b482d2fce916466e44e37930f0b0c0d928bb has eliminated the last user of this function. 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>
* Add the pmconflict_t type.Nagy Gabor2007-11-18
| | | | | | | | | | | | | | | | | | pmdepmissing_t was used for two totally different things : missing dependencies, and dependency conflicts. So this patch simply adds a type for dep conflicts, and convert the code to use it. This fix the TODO in conflict.c : /* TODO WTF is a 'depmissing' doing indicating a conflict? */ Additionally, the code in conflict.c now eliminates the duplicated conflicts. If pkg1 conflicts with pkg2, and pkg2 conflicts with pkg1, only one of them will be stored. However the conflict handling in sync_prepare (sync.c) is still very asymetrical, and very ugly too. This should be improved in the future (there is already a pending patch from Nagy that cleans it a lot). Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* 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>
* alpm_list_add == alpm_list_add_lastNagy Gabor2007-11-14
| | | | | | | | | | | | | | It's time to define that alpm_list_add(list, foo) adds 'foo' to the end of 'list' and returns with 'list', because: 1. list is a list, not a set. 2. sortbydeps _needs_ an alpm_list_add definition to work properly. As a first step, I used this definition in recursedeps. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: punctuation cleanup in commit message and code comments, added comment to alpm_list_add] 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>
* 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>
* * 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
* * 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.
* * Forgot the int->enum header checkinAaron Griffin2007-01-31
| | | | | * Removed the dep-sorting TODO item - switch the sorting to a topological sort later (I'll let Dan do the CS stuff, heh)
* 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
* * 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
* * repo-add script - to add entries to a db file directly from package data ↵Aaron Griffin2006-11-20
| | | | | | | | | | (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
* A handful of minor changes:Aaron Griffin2006-10-20
| | | | | | | | * Removed the PMList typedef, in favor of the same naming scheme other structs use 'pmlist_t' * Added a time stamp on debug output, to make it more informational * Moved alpm_db_register to _alpm_db_register, making the public function not take a callback parameter
* Merged frugalware changes (too many to list). Also added some config fileAaron Griffin2006-10-15
| | | | | handling changes (support [sections] to carry over to included files - this helps with backwards compatibility with existing pacman config files)
* prepend library function names with _alpm (helped with the patch from ↵Aurelien Foret2006-02-17
| | | | | | VMiklos <vmiklos@frugalware.org>) added log and event callbacks to sync_commit internal transactions
* resolvedeps: return the depmiss info to the frontend in case of failureAurelien Foret2006-01-21
|
* more code cleanup yetAurelien Foret2006-01-18
|
* fixed detection for duplicate entries in list of deps/conflictsAurelien Foret2006-01-17
|
* patch from VMiklos - use PACKAGE_VERSION instead of PACMAN_VERSIONJudd Vinet2006-01-02
|
* added conversation callback support for transactionsJudd Vinet2005-10-09
|
* started the work on "pacman_sync"Aurelien Foret2005-03-30
|
* Turned pmdepmissing_t into an opaque structureAurelien Foret2005-03-29
|
* backport from pacman 2.9.5 (splitdep returns an int)Aurelien Foret2005-03-26
|
* Backport from pacman 2.9.5Aurelien Foret2005-03-25
| | | | | - list_remove, list_check and list_reverse - sortbydeps(mode)
* Initial revisionJudd Vinet2005-03-15