tzdata: update bbappend for 2013i
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0012-is_pkg_a_replaces-simplify-code.patch
1 From 8b5564f0ff75bd65b480ac37809868df7892cda3 Mon Sep 17 00:00:00 2001
2 From: Andreas Oberritter <obi@opendreambox.org>
3 Date: Sun, 17 Mar 2013 22:51:13 +0100
4 Subject: [PATCH 12/19] is_pkg_a_replaces(): simplify code
5 To: opkg-devel@googlegroups.com
6 Cc: paul@paulbarker.me.uk
7
8 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
9 ---
10  libopkg/pkg_depends.c | 10 +++-------
11  1 file changed, 3 insertions(+), 7 deletions(-)
12
13 diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
14 index 2422fb5..6b5a1a5 100644
15 --- a/libopkg/pkg_depends.c
16 +++ b/libopkg/pkg_depends.c
17 @@ -345,22 +345,18 @@ pkg_hash_fetch_satisfied_dependencies(pkg_t * pkg)
18    really conflicts
19    returns 0 if conflicts <> replaces or 1 if conflicts == replaces
20  */
21 -static int
22 -is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg)
23 +static int is_pkg_a_replaces(const pkg_t *pkg_scout, const pkg_t *pkg)
24  {
25      int i ;
26 -    int replaces_count = pkg->replaces_count;
27  
28 -    if (pkg->replaces_count==0)    // No replaces, it's surely a conflict
29 -        return 0;
30 -
31 -    for (i = 0; i < replaces_count; i++) {
32 +    for (i = 0; i < pkg->replaces_count; i++) {
33          if (strcmp(pkg_scout->name,pkg->replaces[i]->name)==0) {      // Found
34              opkg_msg(DEBUG2, "Seems I've found a replace %s %s\n",
35                         pkg_scout->name, pkg->replaces[i]->name);
36              return 1;
37          }
38      }
39 +
40      return 0;
41  
42  }
43 -- 
44 1.9.1
45