devnodes-minimal: new recipe to create /dev/console and /dev/null
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0013-is_pkg_a_replaces-simplify-code.patch
1 From da64b1edfadbbba8a9d6203d48bd5ec86bd9eae5 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 13/17] is_pkg_a_replaces(): simplify code
5
6 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
7 ---
8  libopkg/pkg_depends.c | 10 +++-------
9  1 file changed, 3 insertions(+), 7 deletions(-)
10
11 diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
12 index e4bac38..cbb77ce 100644
13 --- a/libopkg/pkg_depends.c
14 +++ b/libopkg/pkg_depends.c
15 @@ -350,22 +350,18 @@ pkg_hash_fetch_satisfied_dependencies(pkg_t * pkg)
16    really conflicts
17    returns 0 if conflicts <> replaces or 1 if conflicts == replaces
18  */
19 -static int
20 -is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg)
21 +static int is_pkg_a_replaces(const pkg_t *pkg_scout, const pkg_t *pkg)
22  {
23      int i ;
24 -    int replaces_count = pkg->replaces_count;
25  
26 -    if (pkg->replaces_count==0)    // No replaces, it's surely a conflict
27 -        return 0;
28 -
29 -    for (i = 0; i < replaces_count; i++) {
30 +    for (i = 0; i < pkg->replaces_count; i++) {
31          if (strcmp(pkg_scout->name,pkg->replaces[i]->name)==0) {      // Found
32              opkg_msg(DEBUG2, "Seems I've found a replace %s %s\n",
33                         pkg_scout->name, pkg->replaces[i]->name);
34              return 1;
35          }
36      }
37 +
38      return 0;
39  
40  }
41 -- 
42 1.8.1.2
43