diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2014-10-08 20:16:36 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-04 10:19:54 +0000 |
commit | 476f864b1564265469b5c9074c1f262bce21f119 (patch) | |
tree | da7c3f6c6ee96765cd319c9edcd6b1611b2c6690 | |
parent | 00ca64c98615c95343e05017caa6da4720e37be2 (diff) | |
download | openembedded-core-476f864b1564265469b5c9074c1f262bce21f119.tar.gz openembedded-core-476f864b1564265469b5c9074c1f262bce21f119.tar.bz2 openembedded-core-476f864b1564265469b5c9074c1f262bce21f119.zip |
opkg: fix remove pkg with --force-removal-of-dependent-packages failed
opkg remove perl --force-removal-of-dependent-packages
...
Removing package perl-module-extutils-mm-dos from root...
...
Removing package perl-module-extutils-mm-dos from root...
You can force removal of packages with failed prerm scripts with the option:
--force-remove
No packages removed.
Collected errors:
* pkg_run_script: Internal error: perl-module-extutils-mm-dos has a
NULL tmp_unpack_dir.
* opkg_remove_pkg: not removing package "perl-module-extutils-mm-dos",
prerm script failed
...
While remove pkg with '--force-removal-of-dependent-packages',
pkg may be added to remove list multiple times, add status
check to make sure pkg only be removed once.
[YOCTO #6819]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta/recipes-devtools/opkg/opkg/libopkg-opkg_remove.c-avoid-remove-pkg-repeatly-with.patch | 39 | ||||
-rw-r--r-- | meta/recipes-devtools/opkg/opkg_0.2.2.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/libopkg-opkg_remove.c-avoid-remove-pkg-repeatly-with.patch b/meta/recipes-devtools/opkg/opkg/libopkg-opkg_remove.c-avoid-remove-pkg-repeatly-with.patch new file mode 100644 index 0000000000..5e5eafcd97 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/libopkg-opkg_remove.c-avoid-remove-pkg-repeatly-with.patch @@ -0,0 +1,39 @@ +From 41425d67d3589b1912416a17f740d6407c7834f2 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Wed, 8 Oct 2014 19:53:13 +0800 +Subject: [PATCH] libopkg/opkg_remove.c: avoid remove pkg repeatly with option + --force-removal-of-dependent-packages + +While remove pkg with '--force-removal-of-dependent-packages', +pkg may be added to pkgs remove list multiple times, add status +check to make sure pkg only be removed once. + +Upstream-Status: Backport +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +--- + libopkg/opkg_remove.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c +index 34f9154..a225e41 100644 +--- a/libopkg/opkg_remove.c ++++ b/libopkg/opkg_remove.c +@@ -250,6 +250,14 @@ opkg_remove_pkg(pkg_t *pkg, int from_upgrade) + if ((parent_pkg = pkg->parent) == NULL) + return 0; + ++ /* While remove pkg with '--force-removal-of-dependent-packages', ++ pkg may be added to remove list multiple times, add status ++ check to make sure pkg only be removed once. */ ++ if (conf->force_removal_of_dependent_packages && ++ pkg->state_flag & SF_FILELIST_CHANGED && ++ pkg->state_status == SS_NOT_INSTALLED) ++ return 0; ++ + /* only attempt to remove dependent installed packages if + * force_depends is not specified or the package is being + * replaced. +-- +1.9.1 + diff --git a/meta/recipes-devtools/opkg/opkg_0.2.2.bb b/meta/recipes-devtools/opkg/opkg_0.2.2.bb index 3dd74898b3..867ff7a8ee 100644 --- a/meta/recipes-devtools/opkg/opkg_0.2.2.bb +++ b/meta/recipes-devtools/opkg/opkg_0.2.2.bb @@ -4,6 +4,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz file://no-install-recommends.patch \ file://add-exclude.patch \ file://opkg-configure.service \ + file://libopkg-opkg_remove.c-avoid-remove-pkg-repeatly-with.patch \ " S = "${WORKDIR}/${BPN}-${PV}" |