devnodes-minimal: new recipe to create /dev/console and /dev/null
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0006-pkg_hash_fetch_conflicts-take-into-account-conflicts.patch
1 From 9dc8f09527d10c7edf0c1fd3f1c46d55cb408afc Mon Sep 17 00:00:00 2001
2 From: Andreas Oberritter <obi@opendreambox.org>
3 Date: Thu, 17 May 2012 01:18:42 +0200
4 Subject: [PATCH 06/17] pkg_hash_fetch_conflicts: take into account conflicts
5  of installed packages
6
7 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
8 ---
9  libopkg/pkg_depends.c | 17 +++++++++++++++++
10  1 file changed, 17 insertions(+)
11
12 diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
13 index 3190b16..2422fb5 100644
14 --- a/libopkg/pkg_depends.c
15 +++ b/libopkg/pkg_depends.c
16 @@ -418,6 +418,22 @@ static void __pkg_hash_fetch_conflicts(pkg_t * pkg, pkg_vec_t * installed_confli
17      }
18  }
19  
20 +static void __pkg_hash_fetch_conflictees(pkg_t *pkg, pkg_vec_t *installed_conflicts)
21 +{
22 +    int i;
23 +
24 +    pkg_vec_t *available_pkgs = pkg_vec_alloc();
25 +    pkg_hash_fetch_all_installed(available_pkgs);
26 +
27 +    for (i = 0; i < available_pkgs->len; i++) {
28 +        pkg_t *cpkg = available_pkgs->pkgs[i];
29 +        if (pkg_conflicts(cpkg, pkg) && !is_pkg_in_pkg_vec(installed_conflicts, cpkg))
30 +            pkg_vec_insert(installed_conflicts, cpkg);
31 +    }
32 +
33 +    pkg_vec_free(available_pkgs);
34 +}
35 +
36  pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
37  {
38      pkg_vec_t * installed_conflicts;
39 @@ -435,6 +451,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
40      installed_conflicts = pkg_vec_alloc();
41  
42      __pkg_hash_fetch_conflicts(pkg, installed_conflicts);
43 +    __pkg_hash_fetch_conflictees(pkg, installed_conflicts);
44  
45      if (installed_conflicts->len)
46             return installed_conflicts;
47 -- 
48 1.8.1.2
49