package_manager.py: fix issues when dealing with FEED_DEPLOYDIR_BASE_URI
PATCH 1/1 package_manager.py: fix issues when dealing with FEED_DEPLOYDIR_BASE_URI
From: Ming Liu <[email protected]>
There are several flaws need fixing them:
- The "/etc/opkg" should be "etc/opkg" when being passed to os.path.join
- /etc/opkg directory does not exist in image rootfs, need create it.
- There is a "\n" missing when writing path to feed conf file.
Signed-off-by Ming Liu <[email protected]>
--- meta/lib/oe/package_manager.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
meta/lib/oe/package_manager.py +4 -6
@@ -1662,14 +1662,12 @@ class OpkgPM(OpkgDpkgPM): NOTE: Development-helper feature, NOT a full-fledged feed. """ if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI') or "") != "": + cfg_dir_name = os.path.join(self.target_rootfs, "etc/opkg") + bb.utils.mkdirhier(cfg_dir_name) for arch in self.pkg_archs.split(): - cfg_file_name = os.path.join(self.target_rootfs, - self.d.getVar("sysconfdir"), - "opkg", - "local-%s-feed.conf" % arch) - + cfg_file_name = os.path.join(cfg_dir_name, "local-%s-feed.conf" % arch) with open(cfg_file_name, "w+") as cfg_file: - cfg_file.write("src/gz local-%s %s/%s" % + cfg_file.write("src/gz local-%s %s/%s\n" % (arch, self.d.getVar('FEED_DEPLOYDIR_BASE_URI'), arch))
Signature · 1 line
1.9.1
Quoted 23 lines · On 26 January 2017 at 13:04, <[email protected]> wrote:
meta/lib/oe/package_manager.py +4
-6@@ -1662,14 +1662,12 @@ class OpkgPM(OpkgDpkgPM): NOTE: Development-helper feature, NOT a full-fledged feed. """ if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI') or "") != "": + cfg_dir_name = os.path.join(self.target_rootfs, "etc/opkg") + bb.utils.mkdirhier(cfg_dir_name) for arch in self.pkg_archs.split(): - cfg_file_name = os.path.join(self.target_rootfs, - self.d.getVar("sysconfdir"), - "opkg", - "local-%s-feed.conf" % arch) - + cfg_file_name = os.path.join(cfg_dir_name, "local-%s-feed.conf" % arch) with open(cfg_file_name, "w+") as cfg_file: - cfg_file.write("src/gz local-%s %s/%s" % + cfg_file.write("src/gz local-%s %s/%s\n" % (arch, self.d.getVar('FEED_DEPLOYDIR_
BASE_URI'),
Quoted 2 lines
arch))
Isn't this a bad clone of the feeds generated by PACKAGE_FEED_URIS so should be deleted entirely?
Ross