From 305993d818d5f64f40172093b1ca3f3ec0d530d7 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Wed, 19 Sep 2012 19:41:13 +0200 Subject: opkg: replace local patches with git patches submitted upstream (From OE-Core rev: 1f1ae93d8cd5140028e86d92483e349868b4f3f6) Signed-off-by: Martin Jansa Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- .../0001-add-opkg_compare_versions-function.patch | 54 ++++++ ...se-the-uname-gname-fields-when-extracting.patch | 101 +++++++++++ ...Fix-dependency-issues-for-preinst-scripts.patch | 188 +++++++++++++++++++++ ...inst-script-is-not-fatal-with-conf-offlin.patch | 71 ++++++++ ...not-read-etc-opkg-.conf-if-f-is-specified.patch | 93 ++++++++++ .../opkg/0006-detect-circular-dependencies.patch | 117 +++++++++++++ .../opkg/opkg/add_uname_support.patch | 88 ---------- meta/recipes-devtools/opkg/opkg/add_vercmp.patch | 36 ---- .../recipes-devtools/opkg/opkg/conf_override.patch | 91 ---------- .../opkg/opkg/fix_installorder.patch | 174 ------------------- .../opkg/opkg/offline_postinstall.patch | 57 ------- .../recipes-devtools/opkg/opkg/track_parents.patch | 99 ----------- meta/recipes-devtools/opkg/opkg_svn.bb | 12 +- 13 files changed, 630 insertions(+), 551 deletions(-) create mode 100644 meta/recipes-devtools/opkg/opkg/0001-add-opkg_compare_versions-function.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch delete mode 100644 meta/recipes-devtools/opkg/opkg/add_uname_support.patch delete mode 100644 meta/recipes-devtools/opkg/opkg/add_vercmp.patch delete mode 100644 meta/recipes-devtools/opkg/opkg/conf_override.patch delete mode 100644 meta/recipes-devtools/opkg/opkg/fix_installorder.patch delete mode 100644 meta/recipes-devtools/opkg/opkg/offline_postinstall.patch delete mode 100644 meta/recipes-devtools/opkg/opkg/track_parents.patch 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 @@ +From 029cf99fd44645b5fe1b6491355c631da3096e09 Mon Sep 17 00:00:00 2001 +From: Martin Jansa +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 +--- + 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 new file mode 100644 index 0000000000..f51cf587ca --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch @@ -0,0 +1,101 @@ +From 254780ab3b0db398447150251332916598d3b9f4 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +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 +Signed-off-by: Martin Jansa +--- + 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 + #include + #include ++#include + #include + #include + #include + #include ++#include ++#include + + #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 new file mode 100644 index 0000000000..195598f287 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0003-Fix-dependency-issues-for-preinst-scripts.patch @@ -0,0 +1,188 @@ +From 6a294b6dad681b0e95aa061bc368d801d2ddc781 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +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 +--- + 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 new file mode 100644 index 0000000000..900c150471 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch @@ -0,0 +1,71 @@ +From 1f709b4540e12cf7e08592aae0ad7e3e35322cab Mon Sep 17 00:00:00 2001 +From: Richard Purdie +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 +--- + 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 new file mode 100644 index 0000000000..3313bf7687 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch @@ -0,0 +1,93 @@ +From 541b6b7bd80dc321493e42955d93b277af0c9221 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton +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 +Signed-off-by: Martin Jansa +--- + 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 new file mode 100644 index 0000000000..5cf8618170 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0006-detect-circular-dependencies.patch @@ -0,0 +1,117 @@ +From f434078a342435ae8a666b599d989c30d4c6a7f5 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +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 +Signed-off-by: Martin Jansa +--- + 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/add_uname_support.patch b/meta/recipes-devtools/opkg/opkg/add_uname_support.patch deleted file mode 100644 index 0f627f1178..0000000000 --- a/meta/recipes-devtools/opkg/opkg/add_uname_support.patch +++ /dev/null @@ -1,88 +0,0 @@ - -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: Pending - -RP 11/11/11 - -Index: trunk/libbb/unarchive.c -=================================================================== ---- trunk.orig/libbb/unarchive.c 2011-11-11 15:52:59.761674091 +0000 -+++ trunk/libbb/unarchive.c 2011-11-11 17:04:56.501574419 +0000 -@@ -22,10 +22,13 @@ - #include - #include - #include -+#include - #include - #include - #include - #include -+#include -+#include - - #include "libbb.h" - -@@ -436,6 +439,42 @@ - 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 @@ - */ - 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); - 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 @@ -Upstream-Status: Inappropriate [function not used] - -Index: trunk/libopkg/opkg.c -=================================================================== ---- trunk.orig/libopkg/opkg.c 2010-01-26 20:32:19.000000000 +0000 -+++ trunk/libopkg/opkg.c 2010-01-26 20:40:34.000000000 +0000 -@@ -876,3 +876,18 @@ - - 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); -+} -+ -Index: trunk/libopkg/opkg.h -=================================================================== ---- trunk.orig/libopkg/opkg.h 2010-01-26 20:32:19.000000000 +0000 -+++ trunk/libopkg/opkg.h 2010-01-26 20:35:19.000000000 +0000 -@@ -58,4 +58,6 @@ - - int opkg_repository_accessibility_check(void); - -+int opkg_compare_versions (const char *ver1, const char *ver2); -+ - #endif /* OPKG_H */ diff --git a/meta/recipes-devtools/opkg/opkg/conf_override.patch b/meta/recipes-devtools/opkg/opkg/conf_override.patch deleted file mode 100644 index b1698d8774..0000000000 --- a/meta/recipes-devtools/opkg/opkg/conf_override.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 45d0468f7f9e9be633b2819aa43ab9b6287b8e6a Mon Sep 17 00:00:00 2001 -From: Paul Eggleton -Date: Mon, 9 Jul 2012 11:01:15 +0100 -Subject: [PATCH] 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: Pending - -Signed-off-by: Paul Eggleton ---- - 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.9.5 - diff --git a/meta/recipes-devtools/opkg/opkg/fix_installorder.patch b/meta/recipes-devtools/opkg/opkg/fix_installorder.patch deleted file mode 100644 index 6a7e6dbb4b..0000000000 --- a/meta/recipes-devtools/opkg/opkg/fix_installorder.patch +++ /dev/null @@ -1,174 +0,0 @@ -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: Pending - -RP 2011/12/15 - -Index: trunk/libopkg/opkg_install.c -=================================================================== ---- trunk.orig/libopkg/opkg_install.c 2011-12-15 15:58:39.000000000 +0000 -+++ trunk/libopkg/opkg_install.c 2011-12-15 15:58:41.838334788 +0000 -@@ -76,6 +77,27 @@ - } - - 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; - } -Index: trunk/libopkg/pkg_depends.c -=================================================================== ---- trunk.orig/libopkg/pkg_depends.c 2010-12-22 16:04:43.000000000 +0000 -+++ trunk/libopkg/pkg_depends.c 2011-12-15 15:58:41.838334788 +0000 -@@ -259,6 +259,88 @@ - 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 -Index: trunk/libopkg/pkg_depends.h -=================================================================== ---- trunk.orig/libopkg/pkg_depends.h 2010-12-22 16:04:43.000000000 +0000 -+++ trunk/libopkg/pkg_depends.h 2011-12-15 15:58:41.838334788 +0000 -@@ -82,6 +82,7 @@ - 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); diff --git a/meta/recipes-devtools/opkg/opkg/offline_postinstall.patch b/meta/recipes-devtools/opkg/opkg/offline_postinstall.patch deleted file mode 100644 index b197f6b731..0000000000 --- a/meta/recipes-devtools/opkg/opkg/offline_postinstall.patch +++ /dev/null @@ -1,57 +0,0 @@ -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 neeing 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: Pending - -RP 2011/12/15 - - -Index: trunk/libopkg/pkg.c -=================================================================== ---- trunk.orig/libopkg/pkg.c 2011-12-15 15:58:39.000000000 +0000 -+++ trunk/libopkg/pkg.c 2011-12-15 20:04:50.109992736 +0000 -@@ -1297,8 +1297,9 @@ - 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; - } - -Index: trunk/libopkg/opkg_cmd.c -=================================================================== ---- trunk.orig/libopkg/opkg_cmd.c 2011-12-15 19:49:25.826014150 +0000 -+++ trunk/libopkg/opkg_cmd.c 2011-12-15 19:50:52.346012148 +0000 -@@ -453,7 +453,8 @@ - pkg->state_flag &= ~SF_PREFER; - opkg_state_changed++; - } else { -- err = -1; -+ if (!conf->offline_root) -+ err = -1; - } - } - } -Index: trunk/libopkg/opkg_configure.c -=================================================================== ---- trunk.orig/libopkg/opkg_configure.c 2011-12-15 19:50:11.586013081 +0000 -+++ trunk/libopkg/opkg_configure.c 2011-12-15 19:52:15.082010347 +0000 -@@ -35,7 +35,10 @@ - - 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/meta/recipes-devtools/opkg/opkg/track_parents.patch b/meta/recipes-devtools/opkg/opkg/track_parents.patch deleted file mode 100644 index ef327e3ef0..0000000000 --- a/meta/recipes-devtools/opkg/opkg/track_parents.patch +++ /dev/null @@ -1,99 +0,0 @@ -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: Pending -RP 2011/12/18 - -Index: trunk/libopkg/opkg_install.c -=================================================================== ---- trunk.orig/libopkg/opkg_install.c 2011-12-18 11:15:17.320725365 +0000 -+++ trunk/libopkg/opkg_install.c 2011-12-18 12:38:54.980609225 +0000 -@@ -84,8 +84,14 @@ - /* 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 @@ - /* 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"); -Index: trunk/libopkg/pkg.c -=================================================================== ---- trunk.orig/libopkg/pkg.c 2011-12-18 11:12:39.976729002 +0000 -+++ trunk/libopkg/pkg.c 2011-12-18 11:22:34.528715535 +0000 -@@ -86,6 +86,7 @@ - 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->description = NULL; - - pkg->state_want = SW_UNKNOWN; -+ pkg_vec_free(pkg->wanted_by); - pkg->state_flag = SF_OK; - pkg->state_status = SS_NOT_INSTALLED; - -Index: trunk/libopkg/pkg.h -=================================================================== ---- trunk.orig/libopkg/pkg.h 2011-12-18 11:12:37.120728742 +0000 -+++ trunk/libopkg/pkg.h 2011-12-18 11:15:39.080725150 +0000 -@@ -129,6 +129,7 @@ - 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; -Index: trunk/libopkg/pkg_depends.c -=================================================================== ---- trunk.orig/libopkg/pkg_depends.c 2011-12-18 11:14:24.464726569 +0000 -+++ trunk/libopkg/pkg_depends.c 2011-12-18 11:30:32.516704127 +0000 -@@ -30,7 +30,6 @@ - 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 @@ - 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; -Index: trunk/libopkg/pkg_depends.h -=================================================================== ---- trunk.orig/libopkg/pkg_depends.h 2011-12-18 11:28:51.960706484 +0000 -+++ trunk/libopkg/pkg_depends.h 2011-12-18 11:29:19.400705862 +0000 -@@ -87,5 +87,6 @@ - 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 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 @@ require opkg.inc SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ - file://add_vercmp.patch \ - file://add_uname_support.patch \ - file://fix_installorder.patch \ - file://offline_postinstall.patch\ - file://track_parents.patch \ - file://conf_override.patch \ + file://0001-add-opkg_compare_versions-function.patch \ + file://0002-Ensure-we-use-the-uname-gname-fields-when-extracting.patch \ + file://0003-Fix-dependency-issues-for-preinst-scripts.patch \ + file://0004-Failed-postinst-script-is-not-fatal-with-conf-offlin.patch \ + file://0005-Do-not-read-etc-opkg-.conf-if-f-is-specified.patch \ + file://0006-detect-circular-dependencies.patch \ " S = "${WORKDIR}/trunk" -- cgit v1.2.3-54-g00ecf