From: Hongxu Jia <hongxu.jia@windriver.com>
To: Paul Barker <paul@paulbarker.me.uk>
Cc: OE Core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/1] opkg: fix remove pkg with --force-removal-of-dependent-packages failed
Date: Sat, 11 Oct 2014 18:33:21 +0800 [thread overview]
Message-ID: <54390771.1040402@windriver.com> (raw)
In-Reply-To: <CANyK_8fkQmOD8=gCkUBG3BSYhF9PCvn2-CYka2Xnk=XBBgWD7w@mail.gmail.com>
On 10/11/2014 06:27 PM, Paul Barker wrote:
> On 11 October 2014 11:17, Hongxu Jia <hongxu.jia@windriver.com> wrote:
>> On 10/11/2014 05:31 PM, Paul Barker wrote:
>>> Your solution looks fine but I'd prefer it to be solved a different
>>> way upstream.
>>>
>>> It should be possible to ensure that duplicates don't enter the
>>> removal queue in the first place by checking the return of
>>> pkg_vec_contains(dependent_pkgs, dep_pkg) before calling
>>> pkg_vec_insert(dependent_pkgs, dep_pkg) in opkg_remove_dependent_pkgs.
>>> This would keep the logic in opkg_remove_pkg clean.
>>
>> The pkg_vec_contains(dependent_pkgs, dep_pkg) could not work here.
>> Because 'dependent_pkgs' is not global which contains all removed pkgs.
>>
>> The checking will filter duplicated pkg.
>>
> I've attached a patch which should apply to opkg v0.2.2 to show what I intended.
>
> Thanks,
>
Here is my patch, and it could not work, I think we are doing
the same thing:
--- a/libopkg/opkg_remove.c
+++ b/libopkg/opkg_remove.c
@@ -118,8 +118,11 @@ opkg_remove_dependent_pkgs(pkg_t *pkg,
abstract_pkg_t **dependents)
for (a = 0; a < dep_ab_pkg->pkgs->len; a++) {
pkg_t *dep_pkg = dep_ab_pkg->pkgs->pkgs[a];
if (dep_pkg->state_status == SS_INSTALLED) {
- pkg_vec_insert(dependent_pkgs, dep_pkg);
- count++;
+ if (!pkg_vec_contains(dependent_pkgs, dep_pkg))
+ {
+ pkg_vec_insert(dependent_pkgs, dep_pkg);
+ count++;
+ }
//Hongxu
next prev parent reply other threads:[~2014-10-11 10:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 12:16 [PATCH 0/1] opkg: fix remove pkg with --force-removal-of-dependent-packages failed Hongxu Jia
2014-10-08 12:16 ` [PATCH 1/1] " Hongxu Jia
2014-10-11 9:31 ` Paul Barker
2014-10-11 9:42 ` Hongxu Jia
2014-10-11 10:17 ` Hongxu Jia
2014-10-11 10:26 ` Hongxu Jia
2014-10-11 10:27 ` Paul Barker
2014-10-11 10:33 ` Hongxu Jia [this message]
2014-10-11 10:37 ` Paul Barker
2014-10-21 16:17 ` Paul Barker
2014-10-22 22:43 ` Burton, Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54390771.1040402@windriver.com \
--to=hongxu.jia@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul@paulbarker.me.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox