tzdata: update bbappend for 2013i
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0013-__pkg_hash_fetch_conflicts-ignore-virtual-conflicts.patch
1 From 7edff2f79241c86fa34be7f70733a1b70856fb75 Mon Sep 17 00:00:00 2001
2 From: Andreas Oberritter <obi@opendreambox.org>
3 Date: Sun, 17 Mar 2013 22:52:07 +0100
4 Subject: [PATCH 13/19] __pkg_hash_fetch_conflicts: ignore virtual conflicts
5 To: opkg-devel@googlegroups.com
6 Cc: paul@paulbarker.me.uk
7
8 * If a package a both provides and conflicts the same package b,
9   then it's a virtual package. Ignore it!
10
11 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
12 ---
13  libopkg/pkg_depends.c | 18 ++++++++++++++++--
14  1 file changed, 16 insertions(+), 2 deletions(-)
15
16 diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
17 index 6b5a1a5..ce48127 100644
18 --- a/libopkg/pkg_depends.c
19 +++ b/libopkg/pkg_depends.c
20 @@ -358,7 +358,21 @@ static int is_pkg_a_replaces(const pkg_t *pkg_scout, const pkg_t *pkg)
21      }
22  
23      return 0;
24 +}
25  
26 +static int is_pkg_a_provides(const pkg_t *pkg_scout, const pkg_t *pkg)
27 +{
28 +    int i ;
29 +
30 +    for (i = 0; i < pkg->provides_count; i++) {
31 +        if (strcmp(pkg_scout->name,pkg->provides[i]->name)==0) {      // Found
32 +            opkg_msg(DEBUG2, "Seems I've found a provide %s %s\n",
33 +                       pkg_scout->name, pkg->provides[i]->name);
34 +            return 1;
35 +        }
36 +    }
37 +
38 +    return 0;
39  }
40  
41  static void __pkg_hash_fetch_conflicts(pkg_t * pkg, pkg_vec_t * installed_conflicts)
42 @@ -402,7 +416,7 @@ static void __pkg_hash_fetch_conflicts(pkg_t * pkg, pkg_vec_t * installed_confli
43                          continue;
44                      }
45                     if ((pkg_scout->state_status == SS_INSTALLED || pkg_scout->state_want == SW_INSTALL) &&
46 -                      version_constraints_satisfied(possible_satisfier, pkg_scout) && !is_pkg_a_replaces(pkg_scout,pkg)){
47 +                      version_constraints_satisfied(possible_satisfier, pkg_scout) && !is_pkg_a_replaces(pkg_scout,pkg) && !is_pkg_a_provides(pkg_scout,pkg)){
48                         if (!is_pkg_in_pkg_vec(installed_conflicts, pkg_scout)){
49                             pkg_vec_insert(installed_conflicts, pkg_scout);
50                         }
51 @@ -423,7 +437,7 @@ static void __pkg_hash_fetch_conflictees(pkg_t *pkg, pkg_vec_t *installed_confli
52  
53      for (i = 0; i < available_pkgs->len; i++) {
54          pkg_t *cpkg = available_pkgs->pkgs[i];
55 -        if (pkg_conflicts(cpkg, pkg) && !is_pkg_in_pkg_vec(installed_conflicts, cpkg))
56 +        if (pkg_conflicts(cpkg, pkg) && !is_pkg_a_provides(cpkg, pkg) && !is_pkg_in_pkg_vec(installed_conflicts, cpkg))
57              pkg_vec_insert(installed_conflicts, cpkg);
58      }
59  
60 -- 
61 1.9.1
62