summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
diff options
context:
space:
mode:
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):
805 805
806 bb.utils.mkdirhier(self.opkg_dir) 806 bb.utils.mkdirhier(self.opkg_dir)
807 807
808 self._create_config() 808 if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
809 self._create_config()
810 else:
811 self._create_custom_config()
809 812
810 """ 813 """
811 This function will change a package's status in /var/lib/opkg/status file. 814 This function will change a package's status in /var/lib/opkg/status file.
@@ -835,6 +838,45 @@ class OpkgPM(PackageManager):
835 838
836 os.rename(status_file + ".tmp", status_file) 839 os.rename(status_file + ".tmp", status_file)
837 840
841 def _create_custom_config(self):
842 bb.note("Building from feeds activated!")
843
844 with open(self.config_file, "w+") as config_file:
845 priority = 1
846 for arch in self.pkg_archs.split():
847 config_file.write("arch %s %d\n" % (arch, priority))
848 priority += 5
849
850 for line in (self.d.getVar('IPK_FEED_URIS', True) or "").split():
851 feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line)
852
853 if feed_match is not None:
854 feed_name = feed_match.group(1)
855 feed_uri = feed_match.group(2)
856
857 bb.note("Add %s feed with URL %s" % (feed_name, feed_uri))
858
859 config_file.write("src/gz %s %s\n" % (feed_name, feed_uri))
860
861 """
862 Allow to use package deploy directory contents as quick devel-testing
863 feed. This creates individual feed configs for each arch subdir of those
864 specified as compatible for the current machine.
865 NOTE: Development-helper feature, NOT a full-fledged feed.
866 """
867 if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True) or "") != "":
868 for arch in self.pkg_archs.split():
869 cfg_file_name = os.path.join(self.target_rootfs,
870 self.d.getVar("sysconfdir", True),
871 "opkg",
872 "local-%s-feed.conf" % arch)
873
874 with open(cfg_file_name, "w+") as cfg_file:
875 cfg_file.write("src/gz local-%s %s/%s" %
876 arch,
877 self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True),
878 arch)
879
838 def _create_config(self): 880 def _create_config(self):
839 with open(self.config_file, "w+") as config_file: 881 with open(self.config_file, "w+") as config_file:
840 priority = 1 882 priority = 1
@@ -847,7 +889,8 @@ class OpkgPM(PackageManager):
847 for arch in self.pkg_archs.split(): 889 for arch in self.pkg_archs.split():
848 pkgs_dir = os.path.join(self.deploy_dir, arch) 890 pkgs_dir = os.path.join(self.deploy_dir, arch)
849 if os.path.isdir(pkgs_dir): 891 if os.path.isdir(pkgs_dir):
850 config_file.write("src oe-%s file:%s\n" % (arch, pkgs_dir)) 892 config_file.write("src oe-%s file:%s\n" %
893 (arch, pkgs_dir))
851 894
852 def update(self): 895 def update(self):
853 self.deploy_dir_lock() 896 self.deploy_dir_lock()