tzdata: update bbappend for 2013i
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0006-pkg_hash_fetch_conflicts-take-into-account-conflicts.patch
1 From 22b7fdae38d08cf3677ff4964f3d78b9267a4889 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/19] pkg_hash_fetch_conflicts: take into account conflicts
5  of installed packages
6 To: opkg-devel@googlegroups.com
7 Cc: paul@paulbarker.me.uk
8
9 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
10 ---
11  libopkg/pkg_depends.c | 17 +++++++++++++++++
12  1 file changed, 17 insertions(+)
13
14 diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
15 index 3190b16..2422fb5 100644
16 --- a/libopkg/pkg_depends.c
17 +++ b/libopkg/pkg_depends.c
18 @@ -418,6 +418,22 @@ static void __pkg_hash_fetch_conflicts(pkg_t * pkg, pkg_vec_t * installed_confli
19      }
20  }
21  
22 +static void __pkg_hash_fetch_conflictees(pkg_t *pkg, pkg_vec_t *installed_conflicts)
23 +{
24 +    int i;
25 +
26 +    pkg_vec_t *available_pkgs = pkg_vec_alloc();
27 +    pkg_hash_fetch_all_installed(available_pkgs);
28 +
29 +    for (i = 0; i < available_pkgs->len; i++) {
30 +        pkg_t *cpkg = available_pkgs->pkgs[i];
31 +        if (pkg_conflicts(cpkg, pkg) && !is_pkg_in_pkg_vec(installed_conflicts, cpkg))
32 +            pkg_vec_insert(installed_conflicts, cpkg);
33 +    }
34 +
35 +    pkg_vec_free(available_pkgs);
36 +}
37 +
38  pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
39  {
40      pkg_vec_t * installed_conflicts;
41 @@ -435,6 +451,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
42      installed_conflicts = pkg_vec_alloc();
43  
44      __pkg_hash_fetch_conflicts(pkg, installed_conflicts);
45 +    __pkg_hash_fetch_conflictees(pkg, installed_conflicts);
46  
47      if (installed_conflicts->len)
48             return installed_conflicts;
49 -- 
50 1.9.1
51