summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-09-30 01:19:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-01 15:07:49 +0100
commite788961cd8a507184c89489b988e94a85155590d (patch)
treeb571e7193e4116c8c3ad123758d39bd70a15392b /meta
parentf3e57baa3a4f465ad13638c2d8211f890a237208 (diff)
downloadpoky-e788961cd8a507184c89489b988e94a85155590d.tar.gz
smart:cache.py: getPackages() matches name + arch
It only matched name ony in the past, for example: smart install busybox (matched) but: smart install busybox@core2_64 (didn't match) The installation is very slow when no match since it would seach all the packages in the repo, and what we use mostly in oe-core is the second case, so the installation is very slow when install COMPLEMENTARY packages such as the task do_populate_sdk. This patch makes it match both. * Speed up MACHINE = "qemux86-64" - When multilib enabled: $ bitbake core-image-sato -cpopulate_sdk time: 6m5s -> 2m34s (Reduce 57% ) $ bitbake core-image-minimal -cpopulate_sdk time: 2m1s -> 1m26s (Reduce 28% ) $ bitbake core-image-sato-sdk time: 10m15s -> 7m12s (Reduce 29% ) - When multilib NOT enabled: $ bitbake core-image-sato -cpopulate_sdk time: 4m25s -> 2m28s (Reduce 44% ) [YOCTO #8389] (From OE-Core rev: dae4149009be722943cc7deec7f03e87b77ea59b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch43
-rw-r--r--meta/recipes-devtools/python/python-smartpm_git.bb1
2 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch b/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
new file mode 100644
index 0000000000..225b02f964
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-cache.py-getPackages-matches-name-version.patch
@@ -0,0 +1,43 @@
1From ee05e55e84b53f4bb0d0baba13ca47a8f84b7cb4 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Wed, 30 Sep 2015 01:12:52 -0700
4Subject: [PATCH] smart:cache.py: getPackages() matches name + arch
5
6It only matched name ony in the past, for example:
7smart install busybox (matched)
8but:
9smart install busybox@core2_64 (didn't match)
10
11The installation is very slow when no match since it would seach all the
12packages in the repo
13This patch makes it match both.
14
15Upstream-Status: Pending
16
17Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
18---
19 smart/cache.py | 3 ++-
20 smart/ccache.c | 9 ++++++++-
21 2 files changed, 10 insertions(+), 2 deletions(-)
22
23diff --git a/smart/control.py b/smart/control.py
24index d44abe7..f23a604 100644
25--- a/smart/control.py
26+++ b/smart/control.py
27@@ -876,9 +876,13 @@ class Control(object):
28 objects = []
29
30 # If we find packages with exactly the given
31- # name or name-version, use them.
32- for pkg in self._cache.getPackages(s):
33- if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s:
34+ # name, name-version, or name@arch, use them.
35+ s_name = s
36+ if "@" in s:
37+ s_name = s.split("@")[0]
38+ for pkg in self._cache.getPackages(s_name):
39+ if pkg.name == s or "%s-%s" % (pkg.name, pkg.version) == s \
40+ or "%s@%s" % (pkg.name, pkg.version.split('@')[1]) == s:
41 objects.append((1.0, pkg))
42
43 if not objects:
diff --git a/meta/recipes-devtools/python/python-smartpm_git.bb b/meta/recipes-devtools/python/python-smartpm_git.bb
index 8b974b0c33..d6c378bcfd 100644
--- a/meta/recipes-devtools/python/python-smartpm_git.bb
+++ b/meta/recipes-devtools/python/python-smartpm_git.bb
@@ -23,6 +23,7 @@ SRC_URI = "\
23 file://smart-add-for-rpm-ignoresize-check.patch \ 23 file://smart-add-for-rpm-ignoresize-check.patch \
24 file://smart-already-installed-message.patch \ 24 file://smart-already-installed-message.patch \
25 file://smart-set-noprogress-for-pycurl.patch \ 25 file://smart-set-noprogress-for-pycurl.patch \
26 file://smart-cache.py-getPackages-matches-name-version.patch \
26 " 27 "
27 28
28SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0" 29SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"