aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-02-05 11:08:34 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-11 11:50:32 +0000
commit19c538f57c8fa7c566e88a6dbe13ea4826d4f26c (patch)
treeb5a7c1fbb2883c1517f61302c9f97c8f2c7681f6 /meta/lib/oe/package_manager.py
parent7e518e399da51de3b159bd6804735b2f14c39357 (diff)
downloadopenembedded-core-contrib-19c538f57c8fa7c566e88a6dbe13ea4826d4f26c.tar.gz
rootfs.py, package_manager.py, sdk.py: Fix building from feeds feature for opkg
When using opkg as the PM backend, one has the option to provide custom feeds to create the rootfs from. This commit: * fixes this in the refactored code; * moves the custom config creation code to python; * clean up the package-ipk.bbclass; Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Diffstat (limited to 'meta/lib/oe/package_manager.py')
-rw-r--r--meta/lib/oe/package_manager.py47
1 files changed, 45 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 969292c093..d3e8a0885b 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -805,7 +805,10 @@ class OpkgPM(PackageManager):
bb.utils.mkdirhier(self.opkg_dir)
- self._create_config()
+ if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+ self._create_config()
+ else:
+ self._create_custom_config()
"""
This function will change a package's status in /var/lib/opkg/status file.
@@ -835,6 +838,45 @@ class OpkgPM(PackageManager):
os.rename(status_file + ".tmp", status_file)
+ def _create_custom_config(self):
+ bb.note("Building from feeds activated!")
+
+ with open(self.config_file, "w+") as config_file:
+ priority = 1
+ for arch in self.pkg_archs.split():
+ config_file.write("arch %s %d\n" % (arch, priority))
+ priority += 5
+
+ for line in (self.d.getVar('IPK_FEED_URIS', True) or "").split():
+ feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line)
+
+ if feed_match is not None:
+ feed_name = feed_match.group(1)
+ feed_uri = feed_match.group(2)
+
+ bb.note("Add %s feed with URL %s" % (feed_name, feed_uri))
+
+ config_file.write("src/gz %s %s\n" % (feed_name, feed_uri))
+
+ """
+ Allow to use package deploy directory contents as quick devel-testing
+ feed. This creates individual feed configs for each arch subdir of those
+ specified as compatible for the current machine.
+ NOTE: Development-helper feature, NOT a full-fledged feed.
+ """
+ if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True) or "") != "":
+ for arch in self.pkg_archs.split():
+ cfg_file_name = os.path.join(self.target_rootfs,
+ self.d.getVar("sysconfdir", True),
+ "opkg",
+ "local-%s-feed.conf" % arch)
+
+ with open(cfg_file_name, "w+") as cfg_file:
+ cfg_file.write("src/gz local-%s %s/%s" %
+ arch,
+ self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True),
+ arch)
+
def _create_config(self):
with open(self.config_file, "w+") as config_file:
priority = 1
@@ -847,7 +889,8 @@ class OpkgPM(PackageManager):
for arch in self.pkg_archs.split():
pkgs_dir = os.path.join(self.deploy_dir, arch)
if os.path.isdir(pkgs_dir):
- config_file.write("src oe-%s file:%s\n" % (arch, pkgs_dir))
+ config_file.write("src oe-%s file:%s\n" %
+ (arch, pkgs_dir))
def update(self):
self.deploy_dir_lock()