diff options
Diffstat (limited to 'meta/recipes-devtools/opkg')
| -rw-r--r-- | meta/recipes-devtools/opkg/opkg/0001-pkg_get_provider_replacees-do-not-add-installed-pkg-.patch | 112 | ||||
| -rw-r--r-- | meta/recipes-devtools/opkg/opkg_0.3.0.bb | 1 |
2 files changed, 113 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/0001-pkg_get_provider_replacees-do-not-add-installed-pkg-.patch b/meta/recipes-devtools/opkg/opkg/0001-pkg_get_provider_replacees-do-not-add-installed-pkg-.patch new file mode 100644 index 0000000000..29a9f5901d --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0001-pkg_get_provider_replacees-do-not-add-installed-pkg-.patch | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | From c5acac4ca0633088ea3f2d92dc236a43593e13b7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alejandro del Castillo <alejandro.delcastillo@ni.com> | ||
| 3 | Date: Tue, 12 Jan 2016 17:12:18 -0600 | ||
| 4 | Subject: [PATCH] pkg_get_provider_replacees: do not add installed pkg to | ||
| 5 | replacee list | ||
| 6 | |||
| 7 | If package A replaces provider B, and B is provided by A, | ||
| 8 | pkg_get_provider_replacees incorrectly adds A to the list of B replacees | ||
| 9 | when A is installed. During an upgrade, pacakge A is removed during | ||
| 10 | pkg_remove_installed_replacees, then once more during the package | ||
| 11 | upgrade. | ||
| 12 | |||
| 13 | Add check to skip the insertion of package A into the replacees vector | ||
| 14 | in pkg_get_provider_replacees. | ||
| 15 | |||
| 16 | Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> | ||
| 17 | --- | ||
| 18 | libopkg/opkg_install.c | 13 +++++++++---- | ||
| 19 | tests/Makefile | 1 + | ||
| 20 | tests/regress/issue8913.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ | ||
| 21 | 3 files changed, 54 insertions(+), 4 deletions(-) | ||
| 22 | create mode 100755 tests/regress/issue8913.py | ||
| 23 | |||
| 24 | diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c | ||
| 25 | index dbfafa5..c2db870 100644 | ||
| 26 | --- a/libopkg/opkg_install.c | ||
| 27 | +++ b/libopkg/opkg_install.c | ||
| 28 | @@ -427,10 +427,15 @@ static void pkg_get_provider_replacees(pkg_t * pkg, | ||
| 29 | continue; | ||
| 30 | for (j = 0; j < ap->pkgs->len; j++) { | ||
| 31 | pkg_t *replacee = ap->pkgs->pkgs[j]; | ||
| 32 | - int installed = (replacee->state_status == SS_INSTALLED) | ||
| 33 | - || (replacee->state_status == SS_UNPACKED); | ||
| 34 | - if (installed) | ||
| 35 | - pkg_vec_insert(replacees, replacee); | ||
| 36 | + pkg_t *old = pkg_hash_fetch_installed_by_name(pkg->name); | ||
| 37 | + /* skip pkg if installed: it will be removed during upgrade | ||
| 38 | + * issue 8913 */ | ||
| 39 | + if (old != replacee) { | ||
| 40 | + int installed = (replacee->state_status == SS_INSTALLED) | ||
| 41 | + || (replacee->state_status == SS_UNPACKED); | ||
| 42 | + if (installed) | ||
| 43 | + pkg_vec_insert(replacees, replacee); | ||
| 44 | + } | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | diff --git a/tests/Makefile b/tests/Makefile | ||
| 49 | index 707434f..d01e97b 100644 | ||
| 50 | --- a/tests/Makefile | ||
| 51 | +++ b/tests/Makefile | ||
| 52 | @@ -39,6 +39,7 @@ REGRESSION_TESTS := core/01_install.py \ | ||
| 53 | regress/issue127.py \ | ||
| 54 | regress/issue152.py \ | ||
| 55 | regress/issue154.py \ | ||
| 56 | + regress/issue8913.py \ | ||
| 57 | misc/filehash.py \ | ||
| 58 | misc/update_loses_autoinstalled_flag.py | ||
| 59 | RUN_TESTS := $(REGRESSION_TESTS:%.py=run-%.py) | ||
| 60 | diff --git a/tests/regress/issue8913.py b/tests/regress/issue8913.py | ||
| 61 | new file mode 100755 | ||
| 62 | index 0000000..aaa940f | ||
| 63 | --- /dev/null | ||
| 64 | +++ b/tests/regress/issue8913.py | ||
| 65 | @@ -0,0 +1,44 @@ | ||
| 66 | +#! /usr/bin/env python3 | ||
| 67 | +# | ||
| 68 | +# Reporter: alejandro.delcastillo@ni.com | ||
| 69 | +# | ||
| 70 | +# What steps will reproduce the problem? | ||
| 71 | +# ====================================== | ||
| 72 | +# | ||
| 73 | +# 1.- Create package a (v 1.0) that Provides b and c, Replaces b, Conflicts with b. | ||
| 74 | +# install it | ||
| 75 | +# 2.- Create package a (v 2.0) that Provides b and c, Replaces b, Conflicts with b. | ||
| 76 | +# upgrade | ||
| 77 | +# | ||
| 78 | +# What is the expected output? What do you see instead? | ||
| 79 | +# ===================================================== | ||
| 80 | +# | ||
| 81 | +# Upgrade fails | ||
| 82 | +# | ||
| 83 | + | ||
| 84 | +import os | ||
| 85 | +import opk, cfg, opkgcl | ||
| 86 | + | ||
| 87 | +opk.regress_init() | ||
| 88 | + | ||
| 89 | +o = opk.OpkGroup() | ||
| 90 | +o.add(Package="a", Version="1.0", Provides="b, c", Replaces="b", Conflicts="b") | ||
| 91 | +o.write_opk() | ||
| 92 | +o.write_list() | ||
| 93 | + | ||
| 94 | +opkgcl.update() | ||
| 95 | + | ||
| 96 | +opkgcl.install("a", "--force-postinstall") | ||
| 97 | + | ||
| 98 | +o = opk.OpkGroup() | ||
| 99 | +o.add(Package="a", Version="2.0", Provides="b, c", Replaces="b", Conflicts="b") | ||
| 100 | +o.write_opk() | ||
| 101 | +o.write_list() | ||
| 102 | + | ||
| 103 | +opkgcl.update() | ||
| 104 | +status = opkgcl.upgrade("--force-postinstall") | ||
| 105 | + | ||
| 106 | +if not opkgcl.is_installed("a", "2.0"): | ||
| 107 | + opk.fail("New version of package 'a' available during upgrade but was not installed") | ||
| 108 | + | ||
| 109 | +opkgcl.remove("a") | ||
| 110 | -- | ||
| 111 | 2.8.0 | ||
| 112 | |||
diff --git a/meta/recipes-devtools/opkg/opkg_0.3.0.bb b/meta/recipes-devtools/opkg/opkg_0.3.0.bb index 5ad3e92cff..70110d597e 100644 --- a/meta/recipes-devtools/opkg/opkg_0.3.0.bb +++ b/meta/recipes-devtools/opkg/opkg_0.3.0.bb | |||
| @@ -21,6 +21,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz | |||
| 21 | file://0002-md5-Add-md5_to_string-function.patch \ | 21 | file://0002-md5-Add-md5_to_string-function.patch \ |
| 22 | file://0003-sha256-Add-sha256_to_string-function.patch \ | 22 | file://0003-sha256-Add-sha256_to_string-function.patch \ |
| 23 | file://0004-opkg_download-Use-short-cache-file-name.patch \ | 23 | file://0004-opkg_download-Use-short-cache-file-name.patch \ |
| 24 | file://0001-pkg_get_provider_replacees-do-not-add-installed-pkg-.patch \ | ||
| 24 | " | 25 | " |
| 25 | 26 | ||
| 26 | SRC_URI[md5sum] = "3412cdc71d78b98facc84b19331ec64e" | 27 | SRC_URI[md5sum] = "3412cdc71d78b98facc84b19331ec64e" |
