summaryrefslogtreecommitdiff
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2017-03-16 15:19:04 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-17 11:55:24 +0000
commit3a9e2fdef9316e24b52ce99ac355fc2b09786c72 (patch)
treebfb86956a9cf5b2f57277b695d162062fef1d477 /meta/lib/oe
parent4d9fb8414300c0adc003f2d77041713a17b49bd4 (diff)
downloadopenembedded-core-3a9e2fdef9316e24b52ce99ac355fc2b09786c72.tar.gz
openembedded-core-3a9e2fdef9316e24b52ce99ac355fc2b09786c72.tar.bz2
openembedded-core-3a9e2fdef9316e24b52ce99ac355fc2b09786c72.zip
rpm: add support for remote package feeds via PACKAGE_FEED_URIS variable
I've used a previous patch (which was never merged) by Humberto Ibarra <humberto.ibarra.lopez@intel.com> as a model for how to do runtime testing of this feature (e.g. we need to boot an image, run dnf on it, and check that it is indeed able to access the remote repo over http). Here's his original commit message: ===== Testing that feeds specified with PACKAGE_FEED_URIS var are set correctly has two parts. First a build with this var set is required, and then smart update needs to be issued in the running taget. The previous is not a common selftest practice because this is a simple test, but requires building and running a specific image, which takes a lot of time. testimage is not a good fit either, since the images tested there do not have the PACKAGE_FEED_URIS var set. For this test, the runtime-test module is being used, which is a selftest module but runs a testimage command. The var and test environment were set in runtime-perf.py and the actual test is done in a new testcase added to meta-selftest layer. ===== [YOCTO #10872] Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package_manager.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index d51609189d..b016bc32dc 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -533,10 +533,20 @@ class RpmPM(PackageManager):
bb.utils.unlockfile(lf)
def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ from urllib.parse import urlparse
+
if feed_uris == "":
return
- raise NotImplementedError("Adding remote dnf feeds not yet supported.")
+ bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d"))
+ remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+ for uri in remote_uris:
+ repo_name = "oe-remote-repo" + "-".join(urlparse(uri).path.split("/"))
+ if feed_archs is not None:
+ repo_uris = [uri + "/" + arch for arch in feed_archs]
+ else:
+ repo_uris = [uri]
+ open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_name + ".repo"), 'w').write("[%s]\nbaseurl=%s\n" % (repo_name, " ".join(repo_uris)))
def _prepare_pkg_transaction(self):
os.environ['D'] = self.target_rootfs