<div dir="ltr">An even easier solution would be to use oe.path.join, which solely exists to join paths without the "interesting" absolute path quirk of os.path.join.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 December 2017 at 10:48, André Draszik <span dir="ltr"><<a href="mailto:git@andred.net" target="_blank">git@andred.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, 2017-12-07 at 16:16 -0500, Gaël PORTAY wrote:<br>
> The opkg custom config feature has moved to the package_manager python<br>
> module. This feature is broken since commit 19c538f57c.<br>
><br>
> The python function os.path.join joins path components. If a component<br>
> is an absolute path, all previous components are thrown away.<br>
><br>
> The sysconfdir variable is an absolute path component. It causes the<br>
> leading target rootfs component to be removed. As a result, the<br>
> package-manager module tries to write in the real root filesystem<br>
> instead of the temporary work directory for the rootfs image.<br>
><br>
> This fixes the issue by prepending the target rootfs component using the<br>
> string concatenation operator when the file is opened (without using<br>
> os.path module).<br>
><br>
> Cc: Ash Charles <<a href="mailto:ash.charles@savoirfairelinux.com">ash.charles@savoirfairelinux.<wbr>com</a>><br>
> Signed-off-by: Gaël PORTAY <<a href="mailto:gael.portay@savoirfairelinux.com">gael.portay@savoirfairelinux.<wbr>com</a>><br>
> ---<br>
> meta/lib/oe/package_manager.py | 5 ++---<br>
> 1 file changed, 2 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/meta/lib/oe/package_manager.<wbr>py<br>
> b/meta/lib/oe/package_manager.<wbr>py<br>
> index 6cbb61fd84..ac29593f88 100644<br>
> --- a/meta/lib/oe/package_manager.<wbr>py<br>
> +++ b/meta/lib/oe/package_manager.<wbr>py<br>
> @@ -953,12 +953,11 @@ class OpkgPM(OpkgDpkgPM):<br>
> """<br>
> if (self.d.getVar('FEED_<wbr>DEPLOYDIR_BASE_URI') or "") != "":<br>
> for arch in self.pkg_archs.split():<br>
> - cfg_file_name = os.path.join(self.target_<wbr>rootfs,<br>
> - self.d.getVar("sysconfdi<br>
> r"),<br>
> + cfg_file_name =<br>
> os.path.join(self.d.getVar("<wbr>sysconfdir", True),<br>
<br>
</div></div>The 'True' argument has been removed from all getVar() calls, please don't<br>
re-introduce it.<br>
<span class=""><br>
<br>
> "opkg",<br>
> "local-%s-feed.conf" %<br>
> arch)<br>
><br>
> - with open(cfg_file_name, "w+") as cfg_file:<br>
> + with open(self.target_rootfs + cfg_file_name, "w+")<br>
> as cfg_file:<br>
> cfg_file.write("src/gz local-%s %s/%s" %<br>
> (arch,<br>
> self.d.getVar('FEED_DEPLOYDIR_<wbr>BAS<br>
> E_URI'),<br>
> --<br>
> 2.15.0<br>
><br>
<br>
</span>Also, a simpler solution would be to simply strip the leading '/' from<br>
sysconfdir:<br>
<span class=""><br>
cfg_file_name = os.path.join(self.target_<wbr>rootfs,<br>
- self.d.getVar("sysconfdir"),<br>
</span>+ self.d.getVar("sysconfdir").<wbr>lstrip("/"),<br>
<span class=""> "opkg",<br>
"local-%s-feed.conf" % arch)<br>
<br>
</span>would be the only change needed.<br>
<br>
<br>
Cheers,<br>
Andre'<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br></div>