summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2012-09-19 19:41:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-21 11:10:20 +0100
commit305993d818d5f64f40172093b1ca3f3ec0d530d7 (patch)
tree254e407e788d018a0d999b18e24eb9c5d7a29b64
parent3e774a63e3426f07433af4955ddc0fd8c6999605 (diff)
downloadpoky-305993d818d5f64f40172093b1ca3f3ec0d530d7.tar.gz
opkg: replace local patches with git patches submitted upstream
(From OE-Core rev: 1f1ae93d8cd5140028e86d92483e349868b4f3f6) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/opkg/opkg/0001-add-opkg_compare_versions-function.patch54
-rw-r--r--meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch (renamed from meta/recipes-devtools/opkg/opkg/add_uname_support.patch)31
-rw-r--r--meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch (renamed from meta/recipes-devtools/opkg/opkg/fix_installorder.patch)66
-rw-r--r--meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch (renamed from meta/recipes-devtools/opkg/opkg/offline_postinstall.patch)76
-rw-r--r--meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch (renamed from meta/recipes-devtools/opkg/opkg/conf_override.patch)12
-rw-r--r--meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch (renamed from meta/recipes-devtools/opkg/opkg/track_parents.patch)82
-rw-r--r--meta/recipes-devtools/opkg/opkg/add_vercmp.patch36
-rw-r--r--meta/recipes-devtools/opkg/opkg_svn.bb12
8 files changed, 224 insertions, 145 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0001-add-opkg_compare_versions-function.patch b/meta/recipes-devtools/opkg/opkg/0001-add-opkg_compare_versions-function.patch
new file mode 100644
index 0000000000..5dc76d4004
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0001-add-opkg_compare_versions-function.patch
@@ -0,0 +1,54 @@
1From 029cf99fd44645b5fe1b6491355c631da3096e09 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sat, 17 Dec 2011 12:51:07 +0100
4Subject: [PATCH 1/7] add opkg_compare_versions function
5
6* not used in opkg but can be usefull, e.g. instead of
7 opkg-utils/opkg-compare-versions.c
8
9Upstream-Status: Submitted
10http://code.google.com/p/opkg/issues/detail?id=93
11
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 libopkg/opkg.c | 15 +++++++++++++++
15 libopkg/opkg.h | 2 ++
16 2 files changed, 17 insertions(+)
17
18diff --git a/libopkg/opkg.c b/libopkg/opkg.c
19index 92f61f4..eaea529 100644
20--- a/libopkg/opkg.c
21+++ b/libopkg/opkg.c
22@@ -870,3 +870,18 @@ opkg_repository_accessibility_check(void)
23
24 return ret;
25 }
26+
27+int
28+opkg_compare_versions (const char *ver1, const char *ver2)
29+{
30+ pkg_t *pkg1, *pkg2;
31+
32+ pkg1 = pkg_new();
33+ pkg2 = pkg_new();
34+
35+ parse_version(pkg1, ver1);
36+ parse_version(pkg2, ver2);
37+
38+ return pkg_compare_versions(pkg1, pkg2);
39+}
40+
41diff --git a/libopkg/opkg.h b/libopkg/opkg.h
42index 4fbd404..7aa86eb 100644
43--- a/libopkg/opkg.h
44+++ b/libopkg/opkg.h
45@@ -58,4 +58,6 @@ pkg_t* opkg_find_package (const char *name, const char *version, const char *arc
46
47 int opkg_repository_accessibility_check(void);
48
49+int opkg_compare_versions (const char *ver1, const char *ver2);
50+
51 #endif /* OPKG_H */
52--
531.7.12
54
diff --git a/meta/recipes-devtools/opkg/opkg/add_uname_support.patch b/meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch
index 0f627f1178..f51cf587ca 100644
--- a/meta/recipes-devtools/opkg/opkg/add_uname_support.patch
+++ b/meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch
@@ -1,17 +1,27 @@
1From 254780ab3b0db398447150251332916598d3b9f4 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Fri, 11 Nov 2011 17:17:01 +0000
4Subject: [PATCH 2/7] Ensure we use the uname/gname fields when extracting
5 tarballs
1 6
2When updating packages on the target device we ideally want to match 7When updating packages on the target device we ideally want to match
3user and group numbers from the existing file system. This patch encourages 8user and group numbers from the existing file system. This patch encourages
4opkg to lookup the uname/gname fields first and only use the hardcoded 9opkg to lookup the uname/gname fields first and only use the hardcoded
5numerical values if that fails. 10numerical values if that fails.
6 11
7Upstream-Status: Pending 12Upstream-Status: Submitted
13http://code.google.com/p/opkg/issues/detail?id=93
8 14
9RP 11/11/11 15Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
16Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
17---
18 libbb/unarchive.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
19 1 file changed, 47 insertions(+), 2 deletions(-)
10 20
11Index: trunk/libbb/unarchive.c 21diff --git a/libbb/unarchive.c b/libbb/unarchive.c
12=================================================================== 22index 5d4464f..d583767 100644
13--- trunk.orig/libbb/unarchive.c 2011-11-11 15:52:59.761674091 +0000 23--- a/libbb/unarchive.c
14+++ trunk/libbb/unarchive.c 2011-11-11 17:04:56.501574419 +0000 24+++ b/libbb/unarchive.c
15@@ -22,10 +22,13 @@ 25@@ -22,10 +22,13 @@
16 #include <stdio.h> 26 #include <stdio.h>
17 #include <errno.h> 27 #include <errno.h>
@@ -26,7 +36,7 @@ Index: trunk/libbb/unarchive.c
26 36
27 #include "libbb.h" 37 #include "libbb.h"
28 38
29@@ -436,6 +439,42 @@ 39@@ -436,6 +439,42 @@ free_header_ar(file_header_t *ar_entry)
30 free(ar_entry); 40 free(ar_entry);
31 } 41 }
32 42
@@ -69,7 +79,7 @@ Index: trunk/libbb/unarchive.c
69 79
70 static file_header_t * 80 static file_header_t *
71 get_header_tar(FILE *tar_stream) 81 get_header_tar(FILE *tar_stream)
72@@ -515,8 +554,14 @@ 82@@ -515,8 +554,14 @@ get_header_tar(FILE *tar_stream)
73 */ 83 */
74 tar_entry->mode = 07777 & strtol(tar.formated.mode, NULL, 8); 84 tar_entry->mode = 07777 & strtol(tar.formated.mode, NULL, 8);
75 85
@@ -86,3 +96,6 @@ Index: trunk/libbb/unarchive.c
86 tar_entry->size = strtol(tar.formated.size, NULL, 8); 96 tar_entry->size = strtol(tar.formated.size, NULL, 8);
87 tar_entry->mtime = strtol(tar.formated.mtime, NULL, 8); 97 tar_entry->mtime = strtol(tar.formated.mtime, NULL, 8);
88 98
99--
1001.7.12
101
diff --git a/meta/recipes-devtools/opkg/opkg/fix_installorder.patch b/meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch
index 6a7e6dbb4b..195598f287 100644
--- a/meta/recipes-devtools/opkg/opkg/fix_installorder.patch
+++ b/meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch
@@ -1,16 +1,21 @@
1There is a problem with dependency order when installing packages. The key 1From 6a294b6dad681b0e95aa061bc368d801d2ddc781 Mon Sep 17 00:00:00 2001
2problem revolves around the satisfy_dependencies_for() function which is 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 15 Dec 2011 21:08:49 +0000
4Subject: [PATCH 3/7] Fix dependency issues for preinst scripts
5
6There is a problem with dependency order when installing packages. The key
7problem revolves around the satisfy_dependencies_for() function which is
3called from opkg_install_pkg just before the installation (and preinst) 8called from opkg_install_pkg just before the installation (and preinst)
4happens. 9happens.
5 10
6The satisfy_dependencies_for() function calls pkg_hash_fetch_unsatisfied_dependencies() 11The satisfy_dependencies_for() function calls pkg_hash_fetch_unsatisfied_dependencies()
7which will only return packages which were previously not marked as 12which will only return packages which were previously not marked as
8*going* to be installed at some point. For the purposes of 13*going* to be installed at some point. For the purposes of
9opkg_install_pkg() we really need to know which dependencies haven't been 14opkg_install_pkg() we really need to know which dependencies haven't been
10installed yet. 15installed yet.
11 16
12This patch adds pkg_hash_fetch_satisfied_dependencies() which returns a 17This patch adds pkg_hash_fetch_satisfied_dependencies() which returns a
13list of package dependencies. We can then directly check the status of 18list of package dependencies. We can then directly check the status of
14these and ensure any hard dependencies (not suggestions or recommendations) 19these and ensure any hard dependencies (not suggestions or recommendations)
15are installed before returning. 20are installed before returning.
16 21
@@ -21,9 +26,9 @@ A -> B,E
21E -> B 26E -> B
22B -> C 27B -> C
23 28
24Currently X would install A and E. When installing A the packages B, E 29Currently X would install A and E. When installing A the packages B, E
25and C would be marked as "to install". When the package B is considered 30and C would be marked as "to install". When the package B is considered
26the second time (as a dependency of E rather than A), it would install 31the second time (as a dependency of E rather than A), it would install
27straight away even though C was not currently installed, just marked 32straight away even though C was not currently installed, just marked
28as needing to be installed. 33as needing to be installed.
29 34
@@ -31,15 +36,21 @@ The patch changes the behaviour so B can't install until C really is installed.
31 36
32This change is required to run the postinst scripts in the correct order. 37This change is required to run the postinst scripts in the correct order.
33 38
34Upstream-Status: Pending 39Upstream-Status: Submitted
40http://code.google.com/p/opkg/issues/detail?id=93
35 41
36RP 2011/12/15 42Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
43---
44 libopkg/opkg_install.c | 21 +++++++++++++
45 libopkg/pkg_depends.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++
46 libopkg/pkg_depends.h | 1 +
47 3 files changed, 104 insertions(+)
37 48
38Index: trunk/libopkg/opkg_install.c 49diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
39=================================================================== 50index 3925f58..1632066 100644
40--- trunk.orig/libopkg/opkg_install.c 2011-12-15 15:58:39.000000000 +0000 51--- a/libopkg/opkg_install.c
41+++ trunk/libopkg/opkg_install.c 2011-12-15 15:58:41.838334788 +0000 52+++ b/libopkg/opkg_install.c
42@@ -76,6 +77,27 @@ 53@@ -76,6 +76,27 @@ satisfy_dependencies_for(pkg_t *pkg)
43 } 54 }
44 55
45 if (ndepends <= 0) { 56 if (ndepends <= 0) {
@@ -67,11 +78,11 @@ Index: trunk/libopkg/opkg_install.c
67 pkg_vec_free(depends); 78 pkg_vec_free(depends);
68 return 0; 79 return 0;
69 } 80 }
70Index: trunk/libopkg/pkg_depends.c 81diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
71=================================================================== 82index 1e14d1f..36c76aa 100644
72--- trunk.orig/libopkg/pkg_depends.c 2010-12-22 16:04:43.000000000 +0000 83--- a/libopkg/pkg_depends.c
73+++ trunk/libopkg/pkg_depends.c 2011-12-15 15:58:41.838334788 +0000 84+++ b/libopkg/pkg_depends.c
74@@ -259,6 +259,88 @@ 85@@ -259,6 +259,88 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
75 return unsatisfied->len; 86 return unsatisfied->len;
76 } 87 }
77 88
@@ -160,11 +171,11 @@ Index: trunk/libopkg/pkg_depends.c
160 /*checking for conflicts !in replaces 171 /*checking for conflicts !in replaces
161 If a packages conflicts with another but is also replacing it, I should not consider it a 172 If a packages conflicts with another but is also replacing it, I should not consider it a
162 really conflicts 173 really conflicts
163Index: trunk/libopkg/pkg_depends.h 174diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h
164=================================================================== 175index 5d1f074..b8072e2 100644
165--- trunk.orig/libopkg/pkg_depends.h 2010-12-22 16:04:43.000000000 +0000 176--- a/libopkg/pkg_depends.h
166+++ trunk/libopkg/pkg_depends.h 2011-12-15 15:58:41.838334788 +0000 177+++ b/libopkg/pkg_depends.h
167@@ -82,6 +82,7 @@ 178@@ -82,6 +82,7 @@ char *pkg_depend_str(pkg_t *pkg, int index);
168 void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg); 179 void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg);
169 int version_constraints_satisfied(depend_t * depends, pkg_t * pkg); 180 int version_constraints_satisfied(depend_t * depends, pkg_t * pkg);
170 int pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *depends, char *** unresolved); 181 int pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *depends, char *** unresolved);
@@ -172,3 +183,6 @@ Index: trunk/libopkg/pkg_depends.h
172 pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); 183 pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg);
173 int pkg_dependence_satisfiable(depend_t *depend); 184 int pkg_dependence_satisfiable(depend_t *depend);
174 int pkg_dependence_satisfied(depend_t *depend); 185 int pkg_dependence_satisfied(depend_t *depend);
186--
1871.7.12
188
diff --git a/meta/recipes-devtools/opkg/opkg/offline_postinstall.patch b/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch
index b197f6b731..900c150471 100644
--- a/meta/recipes-devtools/opkg/opkg/offline_postinstall.patch
+++ b/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch
@@ -1,35 +1,30 @@
1When we have an offline root and have specified force-postinstall, 1From 1f709b4540e12cf7e08592aae0ad7e3e35322cab Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Thu, 15 Dec 2011 21:08:49 +0000
4Subject: [PATCH 4/7] Failed postinst script is not fatal with
5 conf->offline_root
6
7When we have an offline root and have specified force-postinstall,
2attempt to run the postinstall but if it fails, just leave it in the 8attempt to run the postinstall but if it fails, just leave it in the
3status file as neeing to run. We can issue a NOTICE this is happened 9status file as needing to run. We can issue a NOTICE this is happened
4but supress errors. This means the OE class doesn't have to do any 10but supress errors. This means the OE class doesn't have to do any
5further post processing of the postinstalls itself. 11further post processing of the postinstalls itself.
6 12
7Upstream-Status: Pending 13Upstream-Status: Submitted
8 14http://code.google.com/p/opkg/issues/detail?id=93
9RP 2011/12/15
10 15
16Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
17---
18 libopkg/opkg_cmd.c | 3 ++-
19 libopkg/opkg_configure.c | 5 ++++-
20 libopkg/pkg.c | 5 +++--
21 3 files changed, 9 insertions(+), 4 deletions(-)
11 22
12Index: trunk/libopkg/pkg.c 23diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
13=================================================================== 24index 11e7867..36ff8eb 100644
14--- trunk.orig/libopkg/pkg.c 2011-12-15 15:58:39.000000000 +0000 25--- a/libopkg/opkg_cmd.c
15+++ trunk/libopkg/pkg.c 2011-12-15 20:04:50.109992736 +0000 26+++ b/libopkg/opkg_cmd.c
16@@ -1297,8 +1297,9 @@ 27@@ -453,7 +453,8 @@ opkg_configure_packages(char *pkg_name)
17 free(cmd);
18
19 if (err) {
20- opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
21- pkg->name, script, err);
22+ if (!conf->offline_root)
23+ opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
24+ pkg->name, script, err);
25 return err;
26 }
27
28Index: trunk/libopkg/opkg_cmd.c
29===================================================================
30--- trunk.orig/libopkg/opkg_cmd.c 2011-12-15 19:49:25.826014150 +0000
31+++ trunk/libopkg/opkg_cmd.c 2011-12-15 19:50:52.346012148 +0000
32@@ -453,7 +453,8 @@
33 pkg->state_flag &= ~SF_PREFER; 28 pkg->state_flag &= ~SF_PREFER;
34 opkg_state_changed++; 29 opkg_state_changed++;
35 } else { 30 } else {
@@ -39,11 +34,11 @@ Index: trunk/libopkg/opkg_cmd.c
39 } 34 }
40 } 35 }
41 } 36 }
42Index: trunk/libopkg/opkg_configure.c 37diff --git a/libopkg/opkg_configure.c b/libopkg/opkg_configure.c
43=================================================================== 38index 719da5a..169828d 100644
44--- trunk.orig/libopkg/opkg_configure.c 2011-12-15 19:50:11.586013081 +0000 39--- a/libopkg/opkg_configure.c
45+++ trunk/libopkg/opkg_configure.c 2011-12-15 19:52:15.082010347 +0000 40+++ b/libopkg/opkg_configure.c
46@@ -35,7 +35,10 @@ 41@@ -35,7 +35,10 @@ opkg_configure(pkg_t *pkg)
47 42
48 err = pkg_run_script(pkg, "postinst", "configure"); 43 err = pkg_run_script(pkg, "postinst", "configure");
49 if (err) { 44 if (err) {
@@ -55,3 +50,22 @@ Index: trunk/libopkg/opkg_configure.c
55 return err; 50 return err;
56 } 51 }
57 52
53diff --git a/libopkg/pkg.c b/libopkg/pkg.c
54index d8c3984..6ccbde2 100644
55--- a/libopkg/pkg.c
56+++ b/libopkg/pkg.c
57@@ -1297,8 +1297,9 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
58 free(cmd);
59
60 if (err) {
61- opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
62- pkg->name, script, err);
63+ if (!conf->offline_root)
64+ opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n",
65+ pkg->name, script, err);
66 return err;
67 }
68
69--
701.7.12
71
diff --git a/meta/recipes-devtools/opkg/opkg/conf_override.patch b/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch
index b1698d8774..3313bf7687 100644
--- a/meta/recipes-devtools/opkg/opkg/conf_override.patch
+++ b/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch
@@ -1,17 +1,19 @@
1From 45d0468f7f9e9be633b2819aa43ab9b6287b8e6a Mon Sep 17 00:00:00 2001 1From 541b6b7bd80dc321493e42955d93b277af0c9221 Mon Sep 17 00:00:00 2001
2From: Paul Eggleton <paul.eggleton@linux.intel.com> 2From: Paul Eggleton <paul.eggleton@linux.intel.com>
3Date: Mon, 9 Jul 2012 11:01:15 +0100 3Date: Mon, 9 Jul 2012 11:01:15 +0100
4Subject: [PATCH] Do not read /etc/opkg/*.conf if -f is specified 4Subject: [PATCH 5/7] Do not read /etc/opkg/*.conf if -f is specified
5 5
6If a configuration file is specified on the command line, we should 6If a configuration file is specified on the command line, we should
7assume it contains all of the configuration and not try to read the 7assume it contains all of the configuration and not try to read the
8configuration in /etc/opkg. 8configuration in /etc/opkg.
9 9
10Upstream-Status: Pending 10Upstream-Status: Submitted
11http://code.google.com/p/opkg/issues/detail?id=93
11 12
12Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> 13Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13--- 15---
14 libopkg/opkg_conf.c | 55 ++++++++++++++++++++++++++------------------------- 16 libopkg/opkg_conf.c | 55 +++++++++++++++++++++++++++--------------------------
15 1 file changed, 28 insertions(+), 27 deletions(-) 17 1 file changed, 28 insertions(+), 27 deletions(-)
16 18
17diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c 19diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
@@ -87,5 +89,5 @@ index 4711ce7..1e65bad 100644
87 if (conf->offline_root) 89 if (conf->offline_root)
88 sprintf_alloc (&lock_file, "%s/%s", conf->offline_root, OPKGLOCKFILE); 90 sprintf_alloc (&lock_file, "%s/%s", conf->offline_root, OPKGLOCKFILE);
89-- 91--
901.7.9.5 921.7.12
91 93
diff --git a/meta/recipes-devtools/opkg/opkg/track_parents.patch b/meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch
index ef327e3ef0..5cf8618170 100644
--- a/meta/recipes-devtools/opkg/opkg/track_parents.patch
+++ b/meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch
@@ -1,15 +1,30 @@
1Add logic to detect circular dependencies. If we see any dependency from any 1From f434078a342435ae8a666b599d989c30d4c6a7f5 Mon Sep 17 00:00:00 2001
2given parent twice, ignore it the second time and print a notice message 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Sun, 18 Dec 2011 23:54:30 +0000
4Subject: [PATCH 6/7] detect circular dependencies
5
6Add logic to detect circular dependencies. If we see any dependency from
7any given parent twice, ignore it the second time and print a notice message
3that we did so. 8that we did so.
4 9
5Upstream-Status: Pending 10Upstream-Status: Submitted
6RP 2011/12/18 11http://code.google.com/p/opkg/issues/detail?id=93
12
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15---
16 libopkg/opkg_install.c | 8 ++++++++
17 libopkg/pkg.c | 2 ++
18 libopkg/pkg.h | 1 +
19 libopkg/pkg_depends.c | 3 +--
20 libopkg/pkg_depends.h | 1 +
21 5 files changed, 13 insertions(+), 2 deletions(-)
7 22
8Index: trunk/libopkg/opkg_install.c 23diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
9=================================================================== 24index 1632066..0216914 100644
10--- trunk.orig/libopkg/opkg_install.c 2011-12-18 11:15:17.320725365 +0000 25--- a/libopkg/opkg_install.c
11+++ trunk/libopkg/opkg_install.c 2011-12-18 12:38:54.980609225 +0000 26+++ b/libopkg/opkg_install.c
12@@ -84,8 +84,14 @@ 27@@ -84,8 +84,14 @@ satisfy_dependencies_for(pkg_t *pkg)
13 /* The package was uninstalled when we started, but another 28 /* The package was uninstalled when we started, but another
14 dep earlier in this loop may have depended on it and pulled 29 dep earlier in this loop may have depended on it and pulled
15 it in, so check first. */ 30 it in, so check first. */
@@ -24,7 +39,7 @@ Index: trunk/libopkg/opkg_install.c
24 err = opkg_install_pkg(dep, 0); 39 err = opkg_install_pkg(dep, 0);
25 /* mark this package as having been automatically installed to 40 /* mark this package as having been automatically installed to
26 * satisfy a dependency */ 41 * satisfy a dependency */
27@@ -115,6 +121,8 @@ 42@@ -115,6 +121,8 @@ satisfy_dependencies_for(pkg_t *pkg)
28 /* The package was uninstalled when we started, but another 43 /* The package was uninstalled when we started, but another
29 dep earlier in this loop may have depended on it and pulled 44 dep earlier in this loop may have depended on it and pulled
30 it in, so check first. */ 45 it in, so check first. */
@@ -33,11 +48,11 @@ Index: trunk/libopkg/opkg_install.c
33 if ((dep->state_status != SS_INSTALLED) 48 if ((dep->state_status != SS_INSTALLED)
34 && (dep->state_status != SS_UNPACKED)) { 49 && (dep->state_status != SS_UNPACKED)) {
35 opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n"); 50 opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n");
36Index: trunk/libopkg/pkg.c 51diff --git a/libopkg/pkg.c b/libopkg/pkg.c
37=================================================================== 52index 6ccbde2..be486ee 100644
38--- trunk.orig/libopkg/pkg.c 2011-12-18 11:12:39.976729002 +0000 53--- a/libopkg/pkg.c
39+++ trunk/libopkg/pkg.c 2011-12-18 11:22:34.528715535 +0000 54+++ b/libopkg/pkg.c
40@@ -86,6 +86,7 @@ 55@@ -86,6 +86,7 @@ pkg_init(pkg_t *pkg)
41 pkg->section = NULL; 56 pkg->section = NULL;
42 pkg->description = NULL; 57 pkg->description = NULL;
43 pkg->state_want = SW_UNKNOWN; 58 pkg->state_want = SW_UNKNOWN;
@@ -45,7 +60,7 @@ Index: trunk/libopkg/pkg.c
45 pkg->state_flag = SF_OK; 60 pkg->state_flag = SF_OK;
46 pkg->state_status = SS_NOT_INSTALLED; 61 pkg->state_status = SS_NOT_INSTALLED;
47 pkg->depends_str = NULL; 62 pkg->depends_str = NULL;
48@@ -191,6 +192,7 @@ 63@@ -191,6 +192,7 @@ pkg_deinit(pkg_t *pkg)
49 pkg->description = NULL; 64 pkg->description = NULL;
50 65
51 pkg->state_want = SW_UNKNOWN; 66 pkg->state_want = SW_UNKNOWN;
@@ -53,11 +68,11 @@ Index: trunk/libopkg/pkg.c
53 pkg->state_flag = SF_OK; 68 pkg->state_flag = SF_OK;
54 pkg->state_status = SS_NOT_INSTALLED; 69 pkg->state_status = SS_NOT_INSTALLED;
55 70
56Index: trunk/libopkg/pkg.h 71diff --git a/libopkg/pkg.h b/libopkg/pkg.h
57=================================================================== 72index 775b656..5d468cb 100644
58--- trunk.orig/libopkg/pkg.h 2011-12-18 11:12:37.120728742 +0000 73--- a/libopkg/pkg.h
59+++ trunk/libopkg/pkg.h 2011-12-18 11:15:39.080725150 +0000 74+++ b/libopkg/pkg.h
60@@ -129,6 +129,7 @@ 75@@ -129,6 +129,7 @@ struct pkg
61 char *description; 76 char *description;
62 char *tags; 77 char *tags;
63 pkg_state_want_t state_want; 78 pkg_state_want_t state_want;
@@ -65,11 +80,11 @@ Index: trunk/libopkg/pkg.h
65 pkg_state_flag_t state_flag; 80 pkg_state_flag_t state_flag;
66 pkg_state_status_t state_status; 81 pkg_state_status_t state_status;
67 char **depends_str; 82 char **depends_str;
68Index: trunk/libopkg/pkg_depends.c 83diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
69=================================================================== 84index 36c76aa..a72eed7 100644
70--- trunk.orig/libopkg/pkg_depends.c 2011-12-18 11:14:24.464726569 +0000 85--- a/libopkg/pkg_depends.c
71+++ trunk/libopkg/pkg_depends.c 2011-12-18 11:30:32.516704127 +0000 86+++ b/libopkg/pkg_depends.c
72@@ -30,7 +30,6 @@ 87@@ -30,7 +30,6 @@ static int parseDepends(compound_depend_t *compound_depend, char * depend_str);
73 static depend_t * depend_init(void); 88 static depend_t * depend_init(void);
74 static char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx); 89 static char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx);
75 static char ** merge_unresolved(char ** oldstuff, char ** newstuff); 90 static char ** merge_unresolved(char ** oldstuff, char ** newstuff);
@@ -77,7 +92,7 @@ Index: trunk/libopkg/pkg_depends.c
77 92
78 static int pkg_installed_and_constraint_satisfied(pkg_t *pkg, void *cdata) 93 static int pkg_installed_and_constraint_satisfied(pkg_t *pkg, void *cdata)
79 { 94 {
80@@ -531,7 +530,7 @@ 95@@ -531,7 +530,7 @@ int pkg_dependence_satisfied(depend_t *depend)
81 return 0; 96 return 0;
82 } 97 }
83 98
@@ -86,14 +101,17 @@ Index: trunk/libopkg/pkg_depends.c
86 { 101 {
87 int i; 102 int i;
88 pkg_t ** pkgs = vec->pkgs; 103 pkg_t ** pkgs = vec->pkgs;
89Index: trunk/libopkg/pkg_depends.h 104diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h
90=================================================================== 105index b8072e2..ca0801f 100644
91--- trunk.orig/libopkg/pkg_depends.h 2011-12-18 11:28:51.960706484 +0000 106--- a/libopkg/pkg_depends.h
92+++ trunk/libopkg/pkg_depends.h 2011-12-18 11:29:19.400705862 +0000 107+++ b/libopkg/pkg_depends.h
93@@ -87,5 +87,6 @@ 108@@ -87,5 +87,6 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg);
94 int pkg_dependence_satisfiable(depend_t *depend); 109 int pkg_dependence_satisfiable(depend_t *depend);
95 int pkg_dependence_satisfied(depend_t *depend); 110 int pkg_dependence_satisfied(depend_t *depend);
96 const char* constraint_to_str(enum version_constraint c); 111 const char* constraint_to_str(enum version_constraint c);
97+int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); 112+int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg);
98 113
99 #endif 114 #endif
115--
1161.7.12
117
diff --git a/meta/recipes-devtools/opkg/opkg/add_vercmp.patch b/meta/recipes-devtools/opkg/opkg/add_vercmp.patch
deleted file mode 100644
index 1203c54874..0000000000
--- a/meta/recipes-devtools/opkg/opkg/add_vercmp.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1Upstream-Status: Inappropriate [function not used]
2
3Index: trunk/libopkg/opkg.c
4===================================================================
5--- trunk.orig/libopkg/opkg.c 2010-01-26 20:32:19.000000000 +0000
6+++ trunk/libopkg/opkg.c 2010-01-26 20:40:34.000000000 +0000
7@@ -876,3 +876,18 @@
8
9 return ret;
10 }
11+
12+int
13+opkg_compare_versions (const char *ver1, const char *ver2)
14+{
15+ pkg_t *pkg1, *pkg2;
16+
17+ pkg1 = pkg_new();
18+ pkg2 = pkg_new();
19+
20+ parse_version(pkg1, ver1);
21+ parse_version(pkg2, ver2);
22+
23+ return pkg_compare_versions(pkg1, pkg2);
24+}
25+
26Index: trunk/libopkg/opkg.h
27===================================================================
28--- trunk.orig/libopkg/opkg.h 2010-01-26 20:32:19.000000000 +0000
29+++ trunk/libopkg/opkg.h 2010-01-26 20:35:19.000000000 +0000
30@@ -58,4 +58,6 @@
31
32 int opkg_repository_accessibility_check(void);
33
34+int opkg_compare_versions (const char *ver1, const char *ver2);
35+
36 #endif /* OPKG_H */
diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb
index 4146b7e018..03ed103744 100644
--- a/meta/recipes-devtools/opkg/opkg_svn.bb
+++ b/meta/recipes-devtools/opkg/opkg_svn.bb
@@ -1,12 +1,12 @@
1require opkg.inc 1require opkg.inc
2 2
3SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ 3SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
4 file://add_vercmp.patch \ 4 file://0001-add-opkg_compare_versions-function.patch \
5 file://add_uname_support.patch \ 5 file://0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch \
6 file://fix_installorder.patch \ 6 file://0003-Fix-dependency-issues-for-preinst-scripts.patch \
7 file://offline_postinstall.patch\ 7 file://0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch \
8 file://track_parents.patch \ 8 file://0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch \
9 file://conf_override.patch \ 9 file://0006-detect-circular-dependencies.patch \
10" 10"
11 11
12S = "${WORKDIR}/trunk" 12S = "${WORKDIR}/trunk"