diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2012-11-22 21:10:23 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-24 15:12:05 +0000 |
| commit | 5fd1d515db5966f45a3b2f936f3c4225f59186e2 (patch) | |
| tree | 35ff44041bc34c57aea1ab6937ae81a579d34286 /meta/recipes-devtools | |
| parent | d991393207af90fe73de76f89ac6949ef291904e (diff) | |
| download | openembedded-core-5fd1d515db5966f45a3b2f936f3c4225f59186e2.tar.gz openembedded-core-5fd1d515db5966f45a3b2f936f3c4225f59186e2.tar.bz2 openembedded-core-5fd1d515db5966f45a3b2f936f3c4225f59186e2.zip | |
opkg: bump SRCREV and drop applied patches
* only change upstream which wasn't in oe-core is
http://code.google.com/p/opkg/source/detail?r=635
and added testcase for that
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
15 files changed, 2 insertions, 1137 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 deleted file mode 100644 index 5dc76d4004..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0001-add-opkg_compare_versions-function.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 029cf99fd44645b5fe1b6491355c631da3096e09 Mon Sep 17 00:00:00 2001 -From: Martin Jansa <Martin.Jansa@gmail.com> -Date: Sat, 17 Dec 2011 12:51:07 +0100 -Subject: [PATCH 1/7] add opkg_compare_versions function - -* not used in opkg but can be usefull, e.g. instead of - opkg-utils/opkg-compare-versions.c - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libopkg/opkg.c | 15 +++++++++++++++ - libopkg/opkg.h | 2 ++ - 2 files changed, 17 insertions(+) - -diff --git a/libopkg/opkg.c b/libopkg/opkg.c -index 92f61f4..eaea529 100644 ---- a/libopkg/opkg.c -+++ b/libopkg/opkg.c -@@ -870,3 +870,18 @@ opkg_repository_accessibility_check(void) - - return ret; - } -+ -+int -+opkg_compare_versions (const char *ver1, const char *ver2) -+{ -+ pkg_t *pkg1, *pkg2; -+ -+ pkg1 = pkg_new(); -+ pkg2 = pkg_new(); -+ -+ parse_version(pkg1, ver1); -+ parse_version(pkg2, ver2); -+ -+ return pkg_compare_versions(pkg1, pkg2); -+} -+ -diff --git a/libopkg/opkg.h b/libopkg/opkg.h -index 4fbd404..7aa86eb 100644 ---- a/libopkg/opkg.h -+++ b/libopkg/opkg.h -@@ -58,4 +58,6 @@ pkg_t* opkg_find_package (const char *name, const char *version, const char *arc - - int opkg_repository_accessibility_check(void); - -+int opkg_compare_versions (const char *ver1, const char *ver2); -+ - #endif /* OPKG_H */ --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch b/meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch deleted file mode 100644 index f51cf587ca..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 254780ab3b0db398447150251332916598d3b9f4 Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Fri, 11 Nov 2011 17:17:01 +0000 -Subject: [PATCH 2/7] Ensure we use the uname/gname fields when extracting - tarballs - -When updating packages on the target device we ideally want to match -user and group numbers from the existing file system. This patch encourages -opkg to lookup the uname/gname fields first and only use the hardcoded -numerical values if that fails. - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libbb/unarchive.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 47 insertions(+), 2 deletions(-) - -diff --git a/libbb/unarchive.c b/libbb/unarchive.c -index 5d4464f..d583767 100644 ---- a/libbb/unarchive.c -+++ b/libbb/unarchive.c -@@ -22,10 +22,13 @@ - #include <stdio.h> - #include <errno.h> - #include <stdlib.h> -+#include <stdbool.h> - #include <string.h> - #include <unistd.h> - #include <utime.h> - #include <libgen.h> -+#include <grp.h> -+#include <pwd.h> - - #include "libbb.h" - -@@ -436,6 +439,42 @@ free_header_ar(file_header_t *ar_entry) - free(ar_entry); - } - -+static char uname_cache[32] = ""; -+static uid_t uid_cache; -+ -+static bool update_unamecache(char *uname) { -+ struct passwd *passwd; -+ if (!uname) -+ return FALSE; -+ if (!uname_cache[0] && strcmp(uname_cache, uname) == 0) -+ return TRUE; -+ passwd = getpwnam(uname); -+ if (passwd) { -+ uid_cache = passwd->pw_uid; -+ strncpy(uname, uname_cache, 32); -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+static char gname_cache[32] = ""; -+static gid_t gid_cache; -+ -+static bool update_gnamecache(char *gname) { -+ struct group *group; -+ if (!gname) -+ return FALSE; -+ if (!gname_cache[0] && strcmp(gname_cache, gname) == 0) -+ return TRUE; -+ group = getgrnam(gname); -+ if (group) { -+ gid_cache = group->gr_gid; -+ strncpy(gname, gname_cache, 32); -+ return TRUE; -+ } -+ return FALSE; -+} -+ - - static file_header_t * - get_header_tar(FILE *tar_stream) -@@ -515,8 +554,14 @@ get_header_tar(FILE *tar_stream) - */ - tar_entry->mode = 07777 & strtol(tar.formated.mode, NULL, 8); - -- tar_entry->uid = strtol(tar.formated.uid, NULL, 8); -- tar_entry->gid = strtol(tar.formated.gid, NULL, 8); -+ if (update_unamecache(tar.formated.uname)) -+ tar_entry->uid = uid_cache; -+ else -+ tar_entry->uid = strtol(tar.formated.uid, NULL, 8); -+ if (update_gnamecache(tar.formated.gname)) -+ tar_entry->gid = gid_cache; -+ else -+ tar_entry->gid = strtol(tar.formated.gid, NULL, 8); - tar_entry->size = strtol(tar.formated.size, NULL, 8); - tar_entry->mtime = strtol(tar.formated.mtime, NULL, 8); - --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch b/meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch deleted file mode 100644 index 195598f287..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 6a294b6dad681b0e95aa061bc368d801d2ddc781 Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Thu, 15 Dec 2011 21:08:49 +0000 -Subject: [PATCH 3/7] Fix dependency issues for preinst scripts - -There is a problem with dependency order when installing packages. The key -problem revolves around the satisfy_dependencies_for() function which is -called from opkg_install_pkg just before the installation (and preinst) -happens. - -The satisfy_dependencies_for() function calls pkg_hash_fetch_unsatisfied_dependencies() -which will only return packages which were previously not marked as -*going* to be installed at some point. For the purposes of -opkg_install_pkg() we really need to know which dependencies haven't been -installed yet. - -This patch adds pkg_hash_fetch_satisfied_dependencies() which returns a -list of package dependencies. We can then directly check the status of -these and ensure any hard dependencies (not suggestions or recommendations) -are installed before returning. - -Consider the situation (where -> means 'depends on'): - -X -> A,E -A -> B,E -E -> B -B -> C - -Currently X would install A and E. When installing A the packages B, E -and C would be marked as "to install". When the package B is considered -the second time (as a dependency of E rather than A), it would install -straight away even though C was not currently installed, just marked -as needing to be installed. - -The patch changes the behaviour so B can't install until C really is installed. - -This change is required to run the postinst scripts in the correct order. - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libopkg/opkg_install.c | 21 +++++++++++++ - libopkg/pkg_depends.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ - libopkg/pkg_depends.h | 1 + - 3 files changed, 104 insertions(+) - -diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c -index 3925f58..1632066 100644 ---- a/libopkg/opkg_install.c -+++ b/libopkg/opkg_install.c -@@ -76,6 +76,27 @@ satisfy_dependencies_for(pkg_t *pkg) - } - - if (ndepends <= 0) { -+ pkg_vec_free(depends); -+ depends = pkg_hash_fetch_satisfied_dependencies(pkg); -+ -+ for (i = 0; i < depends->len; i++) { -+ dep = depends->pkgs[i]; -+ /* The package was uninstalled when we started, but another -+ dep earlier in this loop may have depended on it and pulled -+ it in, so check first. */ -+ if ((dep->state_status != SS_INSTALLED) && (dep->state_status != SS_UNPACKED)) { -+ opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n"); -+ err = opkg_install_pkg(dep, 0); -+ /* mark this package as having been automatically installed to -+ * satisfy a dependency */ -+ dep->auto_installed = 1; -+ if (err) { -+ pkg_vec_free(depends); -+ return err; -+ } -+ } -+ } -+ - pkg_vec_free(depends); - return 0; - } -diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c -index 1e14d1f..36c76aa 100644 ---- a/libopkg/pkg_depends.c -+++ b/libopkg/pkg_depends.c -@@ -259,6 +259,88 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied, - return unsatisfied->len; - } - -+ -+pkg_vec_t * -+pkg_hash_fetch_satisfied_dependencies(pkg_t * pkg) -+{ -+ pkg_vec_t *satisfiers; -+ int i, j, k; -+ int count; -+ abstract_pkg_t * ab_pkg; -+ -+ satisfiers = pkg_vec_alloc(); -+ -+ /* -+ * this is a setup to check for redundant/cyclic dependency checks, -+ * which are marked at the abstract_pkg level -+ */ -+ if (!(ab_pkg = pkg->parent)) { -+ opkg_msg(ERROR, "Internal error, with pkg %s.\n", pkg->name); -+ return satisfiers; -+ } -+ -+ count = pkg->pre_depends_count + pkg->depends_count + pkg->recommends_count + pkg->suggests_count; -+ if (!count) -+ return satisfiers; -+ -+ /* foreach dependency */ -+ for (i = 0; i < count; i++) { -+ compound_depend_t * compound_depend = &pkg->depends[i]; -+ depend_t ** possible_satisfiers = compound_depend->possibilities;; -+ -+ if (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST) -+ continue; -+ -+ if (compound_depend->type == GREEDY_DEPEND) { -+ /* foreach possible satisfier */ -+ for (j = 0; j < compound_depend->possibility_count; j++) { -+ /* foreach provided_by, which includes the abstract_pkg itself */ -+ abstract_pkg_t *abpkg = possible_satisfiers[j]->pkg; -+ abstract_pkg_vec_t *ab_provider_vec = abpkg->provided_by; -+ int nposs = ab_provider_vec->len; -+ abstract_pkg_t **ab_providers = ab_provider_vec->pkgs; -+ int l; -+ for (l = 0; l < nposs; l++) { -+ pkg_vec_t *test_vec = ab_providers[l]->pkgs; -+ /* if no depends on this one, try the first package that Provides this one */ -+ if (!test_vec){ /* no pkg_vec hooked up to the abstract_pkg! (need another feed?) */ -+ continue; -+ } -+ -+ /* cruise this possiblity's pkg_vec looking for an installed version */ -+ for (k = 0; k < test_vec->len; k++) { -+ pkg_t *pkg_scout = test_vec->pkgs[k]; -+ /* not installed, and not already known about? */ -+ if (pkg_scout->state_want == SW_INSTALL && pkg_scout != pkg) -+ pkg_vec_insert(satisfiers, pkg_scout); -+ } -+ } -+ } -+ -+ continue; -+ } -+ -+ /* foreach possible satisfier, look for installed package */ -+ for (j = 0; j < compound_depend->possibility_count; j++) { -+ /* foreach provided_by, which includes the abstract_pkg itself */ -+ depend_t *dependence_to_satisfy = possible_satisfiers[j]; -+ abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg; -+ pkg_t *satisfying_pkg = -+ pkg_hash_fetch_best_installation_candidate(satisfying_apkg, -+ pkg_installed_and_constraint_satisfied, -+ dependence_to_satisfy, 0); -+ /* Being that I can't test constraing in pkg_hash, I will test it here */ -+ if (satisfying_pkg != NULL && satisfying_pkg != pkg) { -+ if (pkg_constraint_satisfied(satisfying_pkg, dependence_to_satisfy) && (satisfying_pkg->state_want == SW_INSTALL || satisfying_pkg->state_want == SW_UNKNOWN)) -+ pkg_vec_insert(satisfiers, satisfying_pkg); -+ } -+ -+ } -+ } -+ return satisfiers; -+} -+ -+ - /*checking for conflicts !in replaces - If a packages conflicts with another but is also replacing it, I should not consider it a - really conflicts -diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h -index 5d1f074..b8072e2 100644 ---- a/libopkg/pkg_depends.h -+++ b/libopkg/pkg_depends.h -@@ -82,6 +82,7 @@ char *pkg_depend_str(pkg_t *pkg, int index); - void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg); - int version_constraints_satisfied(depend_t * depends, pkg_t * pkg); - int pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *depends, char *** unresolved); -+pkg_vec_t * pkg_hash_fetch_satisfied_dependencies(pkg_t * pkg); - pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); - int pkg_dependence_satisfiable(depend_t *depend); - int pkg_dependence_satisfied(depend_t *depend); --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch b/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch deleted file mode 100644 index 900c150471..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 1f709b4540e12cf7e08592aae0ad7e3e35322cab Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Thu, 15 Dec 2011 21:08:49 +0000 -Subject: [PATCH 4/7] Failed postinst script is not fatal with - conf->offline_root - -When we have an offline root and have specified force-postinstall, -attempt to run the postinstall but if it fails, just leave it in the -status file as needing to run. We can issue a NOTICE this is happened -but supress errors. This means the OE class doesn't have to do any -further post processing of the postinstalls itself. - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libopkg/opkg_cmd.c | 3 ++- - libopkg/opkg_configure.c | 5 ++++- - libopkg/pkg.c | 5 +++-- - 3 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c -index 11e7867..36ff8eb 100644 ---- a/libopkg/opkg_cmd.c -+++ b/libopkg/opkg_cmd.c -@@ -453,7 +453,8 @@ opkg_configure_packages(char *pkg_name) - pkg->state_flag &= ~SF_PREFER; - opkg_state_changed++; - } else { -- err = -1; -+ if (!conf->offline_root) -+ err = -1; - } - } - } -diff --git a/libopkg/opkg_configure.c b/libopkg/opkg_configure.c -index 719da5a..169828d 100644 ---- a/libopkg/opkg_configure.c -+++ b/libopkg/opkg_configure.c -@@ -35,7 +35,10 @@ opkg_configure(pkg_t *pkg) - - err = pkg_run_script(pkg, "postinst", "configure"); - if (err) { -- opkg_msg(ERROR, "%s.postinst returned %d.\n", pkg->name, err); -+ if (!conf->offline_root) -+ opkg_msg(ERROR, "%s.postinst returned %d.\n", pkg->name, err); -+ else -+ opkg_msg(NOTICE, "%s.postinst returned %d, marking as unpacked only, configuration required on target.\n", pkg->name, err); - return err; - } - -diff --git a/libopkg/pkg.c b/libopkg/pkg.c -index d8c3984..6ccbde2 100644 ---- a/libopkg/pkg.c -+++ b/libopkg/pkg.c -@@ -1297,8 +1297,9 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args) - free(cmd); - - if (err) { -- opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n", -- pkg->name, script, err); -+ if (!conf->offline_root) -+ opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n", -+ pkg->name, script, err); - return err; - } - --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch b/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch deleted file mode 100644 index 3313bf7687..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 541b6b7bd80dc321493e42955d93b277af0c9221 Mon Sep 17 00:00:00 2001 -From: Paul Eggleton <paul.eggleton@linux.intel.com> -Date: Mon, 9 Jul 2012 11:01:15 +0100 -Subject: [PATCH 5/7] Do not read /etc/opkg/*.conf if -f is specified - -If a configuration file is specified on the command line, we should -assume it contains all of the configuration and not try to read the -configuration in /etc/opkg. - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libopkg/opkg_conf.c | 55 +++++++++++++++++++++++++++-------------------------- - 1 file changed, 28 insertions(+), 27 deletions(-) - -diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c -index 4711ce7..1e65bad 100644 ---- a/libopkg/opkg_conf.c -+++ b/libopkg/opkg_conf.c -@@ -473,39 +473,40 @@ opkg_conf_load(void) - &conf->pkg_src_list, &conf->dist_src_list)) - goto err1; - } -- -- if (conf->offline_root) -- sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", conf->offline_root); - else { -- const char *conf_file_dir = getenv("OPKG_CONF_DIR"); -- if (conf_file_dir == NULL) -- conf_file_dir = OPKG_CONF_DEFAULT_CONF_FILE_DIR; -- sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir); -- } -- -- memset(&globbuf, 0, sizeof(globbuf)); -- glob_ret = glob(etc_opkg_conf_pattern, 0, glob_errfunc, &globbuf); -- if (glob_ret && glob_ret != GLOB_NOMATCH) { -- free(etc_opkg_conf_pattern); -- globfree(&globbuf); -- goto err1; -- } -- -- free(etc_opkg_conf_pattern); -+ if (conf->offline_root) -+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/etc/opkg/*.conf", conf->offline_root); -+ else { -+ const char *conf_file_dir = getenv("OPKG_CONF_DIR"); -+ if (conf_file_dir == NULL) -+ conf_file_dir = OPKG_CONF_DEFAULT_CONF_FILE_DIR; -+ sprintf_alloc(&etc_opkg_conf_pattern, "%s/*.conf", conf_file_dir); -+ } - -- for (i = 0; i < globbuf.gl_pathc; i++) { -- if (globbuf.gl_pathv[i]) -- if (conf->conf_file && -- !strcmp(conf->conf_file, globbuf.gl_pathv[i])) -- continue; -- if ( opkg_conf_parse_file(globbuf.gl_pathv[i], -- &conf->pkg_src_list, &conf->dist_src_list)<0) { -+ memset(&globbuf, 0, sizeof(globbuf)); -+ glob_ret = glob(etc_opkg_conf_pattern, 0, glob_errfunc, &globbuf); -+ if (glob_ret && glob_ret != GLOB_NOMATCH) { -+ free(etc_opkg_conf_pattern); - globfree(&globbuf); - goto err1; - } -- } - -- globfree(&globbuf); -+ free(etc_opkg_conf_pattern); -+ -+ for (i = 0; i < globbuf.gl_pathc; i++) { -+ if (globbuf.gl_pathv[i]) -+ if (conf->conf_file && -+ !strcmp(conf->conf_file, globbuf.gl_pathv[i])) -+ continue; -+ if ( opkg_conf_parse_file(globbuf.gl_pathv[i], -+ &conf->pkg_src_list, &conf->dist_src_list)<0) { -+ globfree(&globbuf); -+ goto err1; -+ } -+ } -+ -+ globfree(&globbuf); -+ } - - if (conf->offline_root) - sprintf_alloc (&lock_file, "%s/%s", conf->offline_root, OPKGLOCKFILE); --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch b/meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch deleted file mode 100644 index 5cf8618170..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch +++ /dev/null @@ -1,117 +0,0 @@ -From f434078a342435ae8a666b599d989c30d4c6a7f5 Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Sun, 18 Dec 2011 23:54:30 +0000 -Subject: [PATCH 6/7] detect circular dependencies - -Add logic to detect circular dependencies. If we see any dependency from -any given parent twice, ignore it the second time and print a notice message -that we did so. - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libopkg/opkg_install.c | 8 ++++++++ - libopkg/pkg.c | 2 ++ - libopkg/pkg.h | 1 + - libopkg/pkg_depends.c | 3 +-- - libopkg/pkg_depends.h | 1 + - 5 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c -index 1632066..0216914 100644 ---- a/libopkg/opkg_install.c -+++ b/libopkg/opkg_install.c -@@ -84,8 +84,14 @@ satisfy_dependencies_for(pkg_t *pkg) - /* The package was uninstalled when we started, but another - dep earlier in this loop may have depended on it and pulled - it in, so check first. */ -+ if (is_pkg_in_pkg_vec(dep->wanted_by, pkg)) { -+ opkg_msg(NOTICE,"Breaking cicular dependency on %s for %s.\n", pkg->name, dep->name); -+ continue; -+ } - if ((dep->state_status != SS_INSTALLED) && (dep->state_status != SS_UNPACKED)) { - opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n"); -+ if (!is_pkg_in_pkg_vec(dep->wanted_by, pkg)) -+ pkg_vec_insert(dep->wanted_by, pkg); - err = opkg_install_pkg(dep, 0); - /* mark this package as having been automatically installed to - * satisfy a dependency */ -@@ -115,6 +121,8 @@ satisfy_dependencies_for(pkg_t *pkg) - /* The package was uninstalled when we started, but another - dep earlier in this loop may have depended on it and pulled - it in, so check first. */ -+ if (!is_pkg_in_pkg_vec(dep->wanted_by, pkg)) -+ pkg_vec_insert(dep->wanted_by, pkg); - if ((dep->state_status != SS_INSTALLED) - && (dep->state_status != SS_UNPACKED)) { - opkg_msg(DEBUG2,"Calling opkg_install_pkg.\n"); -diff --git a/libopkg/pkg.c b/libopkg/pkg.c -index 6ccbde2..be486ee 100644 ---- a/libopkg/pkg.c -+++ b/libopkg/pkg.c -@@ -86,6 +86,7 @@ pkg_init(pkg_t *pkg) - pkg->section = NULL; - pkg->description = NULL; - pkg->state_want = SW_UNKNOWN; -+ pkg->wanted_by = pkg_vec_alloc(); - pkg->state_flag = SF_OK; - pkg->state_status = SS_NOT_INSTALLED; - pkg->depends_str = NULL; -@@ -191,6 +192,7 @@ pkg_deinit(pkg_t *pkg) - pkg->description = NULL; - - pkg->state_want = SW_UNKNOWN; -+ pkg_vec_free(pkg->wanted_by); - pkg->state_flag = SF_OK; - pkg->state_status = SS_NOT_INSTALLED; - -diff --git a/libopkg/pkg.h b/libopkg/pkg.h -index 775b656..5d468cb 100644 ---- a/libopkg/pkg.h -+++ b/libopkg/pkg.h -@@ -129,6 +129,7 @@ struct pkg - char *description; - char *tags; - pkg_state_want_t state_want; -+ pkg_vec_t *wanted_by; - pkg_state_flag_t state_flag; - pkg_state_status_t state_status; - char **depends_str; -diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c -index 36c76aa..a72eed7 100644 ---- a/libopkg/pkg_depends.c -+++ b/libopkg/pkg_depends.c -@@ -30,7 +30,6 @@ static int parseDepends(compound_depend_t *compound_depend, char * depend_str); - static depend_t * depend_init(void); - static char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx); - static char ** merge_unresolved(char ** oldstuff, char ** newstuff); --static int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); - - static int pkg_installed_and_constraint_satisfied(pkg_t *pkg, void *cdata) - { -@@ -531,7 +530,7 @@ int pkg_dependence_satisfied(depend_t *depend) - return 0; - } - --static int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg) -+int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg) - { - int i; - pkg_t ** pkgs = vec->pkgs; -diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h -index b8072e2..ca0801f 100644 ---- a/libopkg/pkg_depends.h -+++ b/libopkg/pkg_depends.h -@@ -87,5 +87,6 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); - int pkg_dependence_satisfiable(depend_t *depend); - int pkg_dependence_satisfied(depend_t *depend); - const char* constraint_to_str(enum version_constraint c); -+int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); - - #endif --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch b/meta/recipes-devtools/opkg/opkg/0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch deleted file mode 100644 index f1be7b89ae..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3340b120909ea353440cfffe01fed43c55387a00 Mon Sep 17 00:00:00 2001 -From: Martin Jansa <Martin.Jansa@gmail.com> -Date: Wed, 19 Sep 2012 17:31:45 +0200 -Subject: [PATCH 7/7] merge newpkg->provides even when oldpkg->provides - existed - -* introduced in http://code.google.com/p/opkg/source/diff?spec=svn277&r=277&format=side&path=/trunk/libopkg/pkg.c -* the problem happens when oldpkg provide 1 and newpkg provide 2 - provides_count is merged to 2, but oldpkg->provides has only 1 entry - causing SIGSEGV: - pkg_formatted_field (fp=fp@entry=0x1444ce0, pkg=pkg@entry=0x120c620, field=<optimized out>, field@entry=0x7ffff7bd2abe "Provides") at pkg.c:739 - 739 fprintf(fp, "%s %s", i == 1 ? "" : ",", - (gdb) bt - #0 pkg_formatted_field (fp=fp@entry=0x1444ce0, pkg=pkg@entry=0x120c620, field=<optimized out>, field@entry=0x7ffff7bd2abe "Provides") at pkg.c:739 - #1 0x00007ffff7bc32fc in pkg_print_status (pkg=0x120c620, file=0x1444ce0) at pkg.c:887 - #2 0x00007ffff7bbff59 in opkg_conf_write_status_files () at opkg_conf.c:400 - #3 0x00007ffff7bbad8a in write_status_files_if_changed () at opkg_cmd.c:65 - #4 0x00007ffff7bbb73e in opkg_upgrade_cmd (argc=<optimized out>, argv=<optimized out>) at opkg_cmd.c:577 - #5 0x00007ffff7bbbcc2 in opkg_cmd_exec (cmd=cmd@entry=0x7ffff7dda080, argc=argc@entry=1, argv=argv@entry=0x7fffffffe768) at opkg_cmd.c:1319 - #6 0x000000000040165f in main (argc=3, argv=0x7fffffffe758) at opkg-cl.c:377 - -Upstream-Status: Submitted -http://code.google.com/p/opkg/issues/detail?id=93 - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> ---- - libopkg/pkg.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/libopkg/pkg.c b/libopkg/pkg.c -index be486ee..255c673 100644 ---- a/libopkg/pkg.c -+++ b/libopkg/pkg.c -@@ -377,10 +377,8 @@ pkg_merge(pkg_t *oldpkg, pkg_t *newpkg) - oldpkg->provides_count = newpkg->provides_count; - newpkg->provides_count = 0; - -- if (!oldpkg->provides) { -- oldpkg->provides = newpkg->provides; -- newpkg->provides = NULL; -- } -+ oldpkg->provides = newpkg->provides; -+ newpkg->provides = NULL; - } - - if (!oldpkg->conflicts_count) { --- -1.7.12 - diff --git a/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch b/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch deleted file mode 100644 index a9b039c5a0..0000000000 --- a/meta/recipes-devtools/opkg/opkg/0008-select_higher_version.patch +++ /dev/null @@ -1,99 +0,0 @@ -Add the --prefer-arch-to-version option - -If there were more than one candidate which had the same pkg name in the -candidate list, for example, the same pkg with different versions, then -it would use the last one which was the highest version one in the past, -but it will use the higher arch priority when this option is specified. - -Upstream-Status: Pending - -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> ---- - libopkg/opkg_conf.h | 1 + - libopkg/pkg_hash.c | 18 +++++++++++++++--- - src/opkg-cl.c | 9 +++++++++ - 3 files changed, 25 insertions(+), 3 deletions(-) - -diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h ---- a/libopkg/opkg_conf.h -+++ b/libopkg/opkg_conf.h -@@ -77,6 +77,7 @@ struct opkg_conf - int force_removal_of_essential_packages; - int force_postinstall; - int force_remove; -+ int prefer_arch_to_version; - int check_signature; - int nodeps; /* do not follow dependencies */ - char *offline_root; -diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c ---- a/libopkg/pkg_hash.c -+++ b/libopkg/pkg_hash.c -@@ -376,10 +376,22 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg, - if (constraint_fcn(matching, cdata)) { - opkg_msg(DEBUG, "Candidate: %s %s.\n", - matching->name, matching->version) ; -- good_pkg_by_name = matching; - /* It has been provided by hand, so it is what user want */ -- if (matching->provided_by_hand == 1) -- break; -+ if (matching->provided_by_hand == 1) { -+ good_pkg_by_name = matching; -+ break; -+ } -+ /* Respect to the arch priorities when given alternatives */ -+ if (good_pkg_by_name && conf->prefer_arch_to_version) { -+ if (matching->arch_priority >= good_pkg_by_name->arch_priority) { -+ good_pkg_by_name = matching; -+ opkg_msg(DEBUG, "%s %s wins by priority.\n", -+ matching->name, matching->version) ; -+ } else -+ opkg_msg(DEBUG, "%s %s wins by priority.\n", -+ good_pkg_by_name->name, good_pkg_by_name->version) ; -+ } else -+ good_pkg_by_name = matching; - } - } - -diff --git a/src/opkg-cl.c b/src/opkg-cl.c ---- a/src/opkg-cl.c -+++ b/src/opkg-cl.c -@@ -42,6 +42,7 @@ enum { - ARGS_OPT_FORCE_SPACE, - ARGS_OPT_FORCE_POSTINSTALL, - ARGS_OPT_FORCE_REMOVE, -+ ARGS_OPT_PREFER_ARCH_TO_VERSION, - ARGS_OPT_ADD_ARCH, - ARGS_OPT_ADD_DEST, - ARGS_OPT_NOACTION, -@@ -83,6 +84,8 @@ static struct option long_options[] = { - {"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL}, - {"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE}, - {"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE}, -+ {"prefer-arch-to-version", 0, 0, ARGS_OPT_PREFER_ARCH_TO_VERSION}, -+ {"prefer-arch-to-version", 0, 0, ARGS_OPT_PREFER_ARCH_TO_VERSION}, - {"noaction", 0, 0, ARGS_OPT_NOACTION}, - {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY}, - {"nodeps", 0, 0, ARGS_OPT_NODEPS}, -@@ -173,6 +176,9 @@ args_parse(int argc, char *argv[]) - case ARGS_OPT_FORCE_REMOVE: - conf->force_remove = 1; - break; -+ case ARGS_OPT_PREFER_ARCH_TO_VERSION: -+ conf->prefer_arch_to_version = 1; -+ break; - case ARGS_OPT_NODEPS: - conf->nodeps = 1; - break; -@@ -271,6 +277,9 @@ usage() - printf("\t--offline-root <dir> offline installation of p |
