[oe] [PATCH] package_manager.py: Restore FEED_DEPLOYDIR_BASE_URI functionality

Reinhard Tartler rtartler.desres at gmail.com
Tue Aug 30 15:31:26 UTC 2016


According to the documentation, setting FEED_DEPLOYDIR_BASE_URI should
be sufficient for setting up local feeds. This commit fixes the
implementation to actually do that, even if BUILD_IMAGES_FROM_FEEDS is
not set.

Also fix some bugs in the old implementation:
 - Fetch uncompressed Packages files, because
   'bitbake package-index' does not appear to create Packages.gz files.
 - Add missing newline after the URI so that the options don't end up on
   the same line.
 - Fix the check when local options are necessary.

Signed-off-by: Reinhard Tartler <tartler at deshaw.com>
---
 meta/lib/oe/package_manager.py | 59 +++++++++++++++++++++++-------
------------
 1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2802254..e92bbbd 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1649,33 +1649,36 @@ class OpkgPM(OpkgDpkgPM):

                     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))
-
-                        if self.opkg_dir != '/var/lib/opkg':
-                            # There is no command line option for this
anymore, we need to add
-                            # info_dir and status_file to config file, if
OPKGLIBDIR doesn't have
-                            # the default value of "/var/lib" as defined
in opkg:
-                            # libopkg/opkg_conf.h:#define
OPKG_CONF_DEFAULT_INFO_DIR      "/var/lib/opkg/info"
-                            # libopkg/opkg_conf.h:#define
OPKG_CONF_DEFAULT_STATUS_FILE   "/var/lib/opkg/status"
-                            cfg_file.write("option info_dir     %s\n" %
os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
-                            cfg_file.write("option status_file  %s\n" %
os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
+        self._setup_devel_feeds()
+
+    def _setup_devel_feeds(self):
+        """
+        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)
+
+                bb.utils.mkdirhier(os.path.dirname(cfg_file_name))
+                with open(cfg_file_name, "w+") as cfg_file:
+                    cfg_file.write("src local-%s %s/%s\n" %
+                                   (arch,
+                                    self.d.getVar('FEED_DEPLOYDIR_BASE_URI',
True),
+                                    arch))
+
+                    if self.opkg_dir != self.target_rootfs +
'/var/lib/opkg':
+                        # There is no command line option for this
anymore, we need to add
+                        # info_dir and status_file to config file, if
OPKGLIBDIR doesn't have
+                        # the default value of "/var/lib" as defined in
opkg:
+                        # libopkg/opkg_conf.h:#define
OPKG_CONF_DEFAULT_INFO_DIR      "/var/lib/opkg/info"
+                        # libopkg/opkg_conf.h:#define
OPKG_CONF_DEFAULT_STATUS_FILE   "/var/lib/opkg/status"
+                        cfg_file.write("option info_dir     %s\n" %
os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
+                        cfg_file.write("option status_file  %s\n" %
os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
      def _create_config(self):
@@ -1702,6 +1705,8 @@ class OpkgPM(OpkgDpkgPM):
                 config_file.write("option info_dir     %s\n" %
os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
                 config_file.write("option status_file  %s\n" %
os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))

+        self._setup_devel_feeds()
+
     def insert_feeds_uris(self):
         if self.feed_uris == "":
             return
-- 
2.7.1



More information about the Openembedded-devel mailing list