public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Hongxu Jia <hongxu.jia@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] package_manager.py: fix rpm based do_rootfs failed while IMAGE_INSTALL_append = " python3"
Date: Thu, 12 Feb 2015 16:46:31 +0000	[thread overview]
Message-ID: <3627050.lDnyP7JDsZ@peggleto-mobl5.ger.corp.intel.com> (raw)
In-Reply-To: <65b3eb26c24648674ec3deb4da87f4933c2c0f21.1414748681.git.hongxu.jia@windriver.com>

Hi Hongxu,

On Friday 31 October 2014 17:46:24 Hongxu Jia wrote:
> While a pkg name (such as python3) not existed in variable
> PACKAGES, but provided by another pkg (such as python-core),
> in this situation, rpm based do_rootfs could not search it in
> the feeds.
> 
> The fix is to invoke 'smart query --provides' to do the search
> if the feeds search failed. We don't drop the feeds search,
> because the smart query search is too slow, and the feeds
> search is fast and could work well with most pkgs.
> 
> [YOCTO #6918]
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/lib/oe/package_manager.py | 22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
> index ffb83b2..a0ecf3a 100644
> --- a/meta/lib/oe/package_manager.py
> +++ b/meta/lib/oe/package_manager.py
> @@ -671,6 +671,22 @@ class RpmPM(PackageManager):
> 
>          return ""
> 
> +    def _search_pkg_provider_in_smart(self, pkg, feed_archs):
> +        output = self._invoke_smart('query  --provides %s' % pkg) or ''
> +        for provider in output.split('\n'):
> +            # Filter out the line which is empty or start with space
> +            if provider.strip() == '' or provider[0] == ' ':
> +                continue
> +
> +            for arch in feed_archs:
> +                arch = '@' + arch.replace('-', '_')
> +                if arch in provider:
> +                    # First found is best match
> +                    return provider
> +
> +        return ''
> +
> +
>      '''
>      Translate the OE multilib format names to the RPM/Smart format names
>      It searched the RPM/Smart format names in probable multilib feeds
> first, @@ -691,7 +707,8 @@ class RpmPM(PackageManager):
>                  # if the pkg in this multilib feed
>                  if subst != pkg:
>                      feed_archs = self.ml_prefix_list[mlib]
> -                    new_pkg = self._search_pkg_name_in_feeds(subst,
> feed_archs) +                    new_pkg =
> self._search_pkg_name_in_feeds(subst, feed_archs) or \ +                   
>     self._search_pkg_provider_in_smart(subst, feed_archs) if not new_pkg:
>                          # Failed to translate, package not found!
>                          err_msg = '%s not found in the %s feeds (%s).\n' %
> \ @@ -709,7 +726,8 @@ class RpmPM(PackageManager):
>              if pkg == new_pkg:
>                  # Search new_pkg in default archs
>                  default_archs = self.ml_prefix_list['default']
> -                new_pkg = self._search_pkg_name_in_feeds(pkg,
> default_archs) +                new_pkg =
> self._search_pkg_name_in_feeds(pkg, default_archs) or \ +                  
>  self._search_pkg_provider_in_smart(pkg, default_archs) if not new_pkg:
>                      err_msg = '%s not found in the base feeds (%s).\n' % \
>                                (pkg, ' '.join(default_archs))

It took a long time to reply to this, my apologies. This patch looks OK but 
Richard pointed out that it may have an impact on the speed of do_rootfs 
because of the extra calls out to smart. Do you have any performance impact 
figures?

Thanks,
Paul
-- 

Paul Eggleton
Intel Open Source Technology Centre


  reply	other threads:[~2015-02-12 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31  9:46 [PATCH V2 0/1] package_manager.py: fix rpm based do_rootfs failed while IMAGE_INSTALL_append = " python3" Hongxu Jia
2014-10-31  9:46 ` [PATCH 1/1] " Hongxu Jia
2015-02-12 16:46   ` Paul Eggleton [this message]
2015-02-13  1:39     ` Hongxu Jia
2015-02-16 10:01       ` Richard Purdie
2014-12-11  7:42 ` [PATCH V2 0/1] " Hongxu Jia
2014-12-22  1:55 ` Hongxu Jia
2015-01-08  8:55 ` Hongxu Jia
  -- strict thread matches above, loose matches on Subject: below --
2014-10-31  7:05 [PATCH " Hongxu Jia
2014-10-31  7:05 ` [PATCH 1/1] " Hongxu Jia
2014-10-31  8:50   ` Laurentiu Palcu
2014-10-31  9:30     ` Hongxu Jia

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=3627050.lDnyP7JDsZ@peggleto-mobl5.ger.corp.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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