summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2017-01-18 15:40:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-13 09:43:21 +0000
commita5cc38481be3c5e6ccbecf951f9fdc049e5101d5 (patch)
treeeedc538574c2ec348bf3ff41883d410298b10e1a /meta
parent341810aff923ace6b1cc1e15e19383c4f8773b51 (diff)
downloadopenembedded-core-a5cc38481be3c5e6ccbecf951f9fdc049e5101d5.tar.gz
openembedded-core-a5cc38481be3c5e6ccbecf951f9fdc049e5101d5.tar.bz2
openembedded-core-a5cc38481be3c5e6ccbecf951f9fdc049e5101d5.zip
package_manager.py: improve the API for insert_feed_uris()
No need to store the configuration as class members, just pass it directly into the method. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager.py41
-rw-r--r--meta/lib/oe/rootfs.py5
2 files changed, 26 insertions, 20 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 79f0a8b9f1..725997ce33 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -513,9 +513,6 @@ class PackageManager(object, metaclass=ABCMeta):
self.d = d
self.deploy_dir = None
self.deploy_lock = None
- self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS') or ""
- self.feed_base_paths = self.d.getVar('PACKAGE_FEED_BASE_PATHS') or ""
- self.feed_archs = self.d.getVar('PACKAGE_FEED_ARCHS')
"""
Update the package manager package database.
@@ -555,8 +552,14 @@ class PackageManager(object, metaclass=ABCMeta):
def list_installed(self):
pass
+ """
+ Add remote package feeds into repository manager configuration. The parameters
+ for the feeds are set by feed_uris, feed_base_paths and feed_archs.
+ See http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-PACKAGE_FEED_URIS
+ for their description.
+ """
@abstractmethod
- def insert_feeds_uris(self):
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
pass
"""
@@ -691,14 +694,14 @@ class RpmPM(PackageManager):
self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
- def insert_feeds_uris(self):
- if self.feed_uris == "":
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ if feed_uris == "":
return
arch_list = []
- if self.feed_archs is not None:
+ if feed_archs is not None:
# User define feed architectures
- arch_list = self.feed_archs.split()
+ arch_list = feed_archs.split()
else:
# List must be prefered to least preferred order
default_platform_extra = list()
@@ -721,7 +724,7 @@ class RpmPM(PackageManager):
continue
arch_list.append(arch)
- feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
+ feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
uri_iterator = 0
channel_priority = 10 + 5 * len(feed_uris) * (len(arch_list) if arch_list else 1)
@@ -1707,22 +1710,22 @@ class OpkgPM(OpkgDpkgPM):
config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
- def insert_feeds_uris(self):
- if self.feed_uris == "":
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ if feed_uris == "":
return
rootfs_config = os.path.join('%s/etc/opkg/base-feeds.conf'
% self.target_rootfs)
- feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
- archs = self.pkg_archs.split() if self.feed_archs is None else self.feed_archs.split()
+ feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+ archs = self.pkg_archs.split() if feed_archs is None else feed_archs.split()
with open(rootfs_config, "w+") as config_file:
uri_iterator = 0
for uri in feed_uris:
if archs:
for arch in archs:
- if (self.feed_archs is None) and (not os.path.exists(os.path.join(self.deploy_dir, arch))):
+ if (feed_archs is None) and (not os.path.exists(os.path.join(self.deploy_dir, arch))):
continue
bb.note('Adding opkg feed url-%s-%d (%s)' %
(arch, uri_iterator, uri))
@@ -2111,23 +2114,23 @@ class DpkgPM(OpkgDpkgPM):
if result is not None:
bb.fatal(result)
- def insert_feeds_uris(self):
- if self.feed_uris == "":
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ if feed_uris == "":
return
sources_conf = os.path.join("%s/etc/apt/sources.list"
% self.target_rootfs)
arch_list = []
- if self.feed_archs is None:
+ if feed_archs is None:
for arch in self.all_arch_list:
if not os.path.exists(os.path.join(self.deploy_dir, arch)):
continue
arch_list.append(arch)
else:
- arch_list = self.feed_archs.split()
+ arch_list = feed_archs.split()
- feed_uris = self.construct_uris(self.feed_uris.split(), self.feed_base_paths.split())
+ feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
with open(sources_conf, "w+") as sources_file:
for uri in feed_uris:
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index cc111ff3c8..74c643b3b9 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -87,7 +87,10 @@ class Rootfs(object, metaclass=ABCMeta):
def _insert_feed_uris(self):
if bb.utils.contains("IMAGE_FEATURES", "package-management",
True, False, self.d):
- self.pm.insert_feeds_uris()
+ self.pm.insert_feeds_uris(self.d.getVar('PACKAGE_FEED_URIS') or "",
+ self.d.getVar('PACKAGE_FEED_BASE_PATHS') or "",
+ self.d.getVar('PACKAGE_FEED_ARCHS'))
+
@abstractmethod
def _handle_intercept_failure(self, failed_script):