opkg: some fixes/changes for handling packet recommends
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-devtools / opkg / opkg / 0011-opkg-allow-package-move-from-depends-to-recommends.patch
diff --git a/meta-openvuplus/recipes-devtools/opkg/opkg/0011-opkg-allow-package-move-from-depends-to-recommends.patch b/meta-openvuplus/recipes-devtools/opkg/opkg/0011-opkg-allow-package-move-from-depends-to-recommends.patch
new file mode 100644 (file)
index 0000000..5b5bc56
--- /dev/null
@@ -0,0 +1,19 @@
+diff -Naur trunk.org/libopkg/opkg_install.c trunk/libopkg/opkg_install.c
+--- trunk.org/libopkg/opkg_install.c   2013-02-17 12:40:51.000000000 +0100
++++ trunk/libopkg/opkg_install.c       2013-02-17 01:17:37.000000000 +0100
+@@ -366,11 +366,12 @@
+                       for (k=0; k<count1; k++) {
+                               cd1 = &pkg->depends[k];
+-                              if (cd1->type != DEPEND)
++                              if (cd1->type != DEPEND && cd1->type != RECOMMEND)
+                                       continue;
+                               for (l=0; l<cd1->possibility_count; l++) {
+-                                      if (cd0->possibilities[j]
+-                                       == cd1->possibilities[l]) {
++                                      if ( (cd0->type == cd1->type && cd0->possibilities[j] == cd1->possibilities[l]) ||
++                                           (cd0->type != cd1->type && !strcmp(cd0->possibilities[j]->pkg->name, cd1->possibilities[l]->pkg->name) )
++                                         ) {
+                                               found = 1;
+                                               break;
+                                       }