summaryrefslogtreecommitdiffstats
path: root/libopkg/pkg_depends.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix: RRECOMMENDS and RDEPENDS being basically the samepixdamix@gmail.com2012-11-221-2/+1
| | | | | | | | | | | | | | | While removing a package with opkg, the process shouldn't be blocked if another package RECOMMENDS the package wanted to be removed. This is because, while generating the dependencies, opkg adds dependencies to depended_upon_by even if dependency's type is RECOMMEND. The fix is to skip dependencies of type RECOMMEND while constructing depended_upon_by. Bug info: https://bugzilla.yoctoproject.org/show_bug.cgi?id=2431 Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> git-svn-id: http://opkg.googlecode.com/svn/trunk@646 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* pkg_depends: fix version_constraints_satisfiedpixdamix@gmail.com2012-11-221-1/+2
| | | | | | | | | | | | | * with Package: a Version: 1 and Conflicts: a (<< 1) we have comparison == 0, but constraint EARLIER is not satisfied! Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@645 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* pkg_depends: fix version constraintspixdamix@gmail.com2012-11-221-31/+42
| | | | | | | | | | | | * factor parsing version constraint to str_to_constraint and use that from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) * fix constraint_to_str(), for EARLIER and LATER it was using '<' and '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL * show notice when deprecated '<' or '>' is used Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@644 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* detect circular dependenciespixdamix@gmail.com2012-11-221-2/+1
| | | | | | | | | | | Add logic to detect circular dependencies. If we see any dependency from any given parent twice, ignore it the second time and print a notice message that we did so. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@641 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix dependency issues for preinst scriptspixdamix@gmail.com2012-11-221-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a problem with dependency order when installing packages. The key problem revolves around the satisfy_dependencies_for() function which is called from opkg_install_pkg just before the installation (and preinst) happens. The satisfy_dependencies_for() function calls pkg_hash_fetch_unsatisfied_dependencies() which will only return packages which were previously not marked as *going* to be installed at some point. For the purposes of opkg_install_pkg() we really need to know which dependencies haven't been installed yet. This patch adds pkg_hash_fetch_satisfied_dependencies() which returns a list of package dependencies. We can then directly check the status of these and ensure any hard dependencies (not suggestions or recommendations) are installed before returning. Consider the situation (where -> means 'depends on'): X -> A,E A -> B,E E -> B B -> C Currently X would install A and E. When installing A the packages B, E and C would be marked as "to install". When the package B is considered the second time (as a dependency of E rather than A), it would install straight away even though C was not currently installed, just marked as needing to be installed. The patch changes the behaviour so B can't install until C really is installed. This change is required to run the postinst scripts in the correct order. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@638 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add Recommended packages to the depended_upon_by field.graham.gower2010-08-181-32/+38
| | | | | | | This ensures recommended packages are not orphaned prematurely. Minor code clean up while here. git-svn-id: http://opkg.googlecode.com/svn/trunk@556 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove trailing whitespace. Sorry if this breaks your patches.graham.gower2010-08-171-41/+41
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@552 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* s/dependences/dependencies/ Pointed out by klemmster in Issue 40.graham.gower2010-01-111-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@515 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Initial stab at untangling the #include maze. Probably needs a second pass.graham.gower2009-12-201-3/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@504 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Merge commit 'grg' into HEADgraham.gower2009-12-081-61/+65
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@471 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Free memory when there are unresolved dependencies.graham.gower2009-12-021-0/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@437 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove unused parameter from pkg_hash_fetch_best_installation_candidate().graham.gower2009-11-271-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@397 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Do the right thing if we have a version but no constraint.graham.gower2009-11-241-2/+2
| | | | | | The package maintainer shouldn't do this, but it happens ocassionally. git-svn-id: http://opkg.googlecode.com/svn/trunk@362 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove remaining uses of pkg->*_str arrays and free() them after parsing.graham.gower2009-11-231-0/+12
| | | | | | Saves about 800kb in peak memory usage for my package list (6000 packages). git-svn-id: http://opkg.googlecode.com/svn/trunk@356 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix pkg_depend_str() to not use pkg->depends_str.graham.gower2009-11-231-26/+67
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@353 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Rename loop iterater, so that it doesn't clash with a variable of greater scope.graham.gower2009-11-191-3/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@344 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Free some strings as soon as they are parsed to save memory.graham.gower2009-11-181-0/+10
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@337 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix depended_upon_by to only contain pre_depends and depends.graham.gower2009-11-171-9/+14
| | | | | | Partially fixes Issue 23. Allows removal of suggested/recommended packages. git-svn-id: http://opkg.googlecode.com/svn/trunk@328 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Cleanup the rest of pkg_parse.c. Give some functions more appropriate names too.graham.gower2009-11-121-3/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@289 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove opkg_internal_use_only and fix associated assumptions RE pkg->provides.graham.gower2009-11-101-54/+8
| | | | | | | | | | | | | | | It appears that the opkg_internal_use_only provides string was introduced to bandaid over problems with assuming that the pkg->provides, pkg->provides_str and pkg->provides_count are all the same length. As each pkg provides itself, the pkg->provides array was one longer than the str and count fields. Most of the uses of pkg->provides did not take this into account. This behaviour has been changed. pkg->provides is now pkg->provides_count long and it is pkg->provides_str which is shorter by one. Associated dead code has also been removed. git-svn-id: http://opkg.googlecode.com/svn/trunk@277 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove if (0 && ...) ... statements.graham.gower2009-11-051-5/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@270 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove more unused code.graham.gower2009-11-051-61/+12
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@269 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove unused function.graham.gower2009-11-051-26/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@268 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* s/malloc/xmalloc/ s/calloc/xcalloc/ s/realloc/realloc/graham.gower2009-11-041-51/+15
| | | | | | | And redundant error checking removed from the places where allocation failures were actually checked. git-svn-id: http://opkg.googlecode.com/svn/trunk@259 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* s/strdup/xstrdup/ - check memory allocations for failure.graham.gower2009-11-031-1/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@255 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* The compiler almost certainly knows better.graham.gower2009-10-301-12/+12
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@228 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: adding the hash_table_remove API, not using yet.ticktock352008-12-151-7/+6
| | | | | | | | | | Just complete the API for future usage. Clean all the entry at initial time. This reduces planty of unnecessary check. In order to prevent this kind of bug, using calloc to replace most malloc git-svn-id: http://opkg.googlecode.com/svn/trunk@160 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: trivial, clean up obsolete code, and some typoticktock352008-12-151-22/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@157 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: consolidate error enums and add an error for when no package matchesticktock352008-12-151-2/+2
| | | | | | | | current architecture git-svn-id: http://opkg.googlecode.com/svn/trunk@128 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: (leak fixing, day 3) fixed final memory leaks fixed reported fromticktock352008-12-151-0/+3
| | | | | | | | running libopkg_test git-svn-id: http://opkg.googlecode.com/svn/trunk@116 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: 's/itsy/opkg/'ticktock352008-12-151-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@67 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: remove opkg.h in preperation for new APIticktock352008-12-151-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@65 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: re-arrange source code into sub-directoriesticktock352008-12-141-0/+1033
git-svn-id: http://opkg.googlecode.com/svn/trunk@33 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358