]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/package_manager: don't try to rm /var/lib/opkg
authorJan Luebbe <jlu@pengutronix.de>
Wed, 1 Apr 2020 14:58:05 +0000 (16:58 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 1 Apr 2020 22:18:09 +0000 (23:18 +0100)
As opkglibdir starts with a /, os.path.join will ignore
self.target_rootfs, leading to an attempt to remove /var/lib/opkg.

This only fails if it exists on the host, explaining why this remained
undiscovered for long.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager.py

index 2a5d7ef539e6daa97e35ef6a5d5fc23f8206b102..b0660411eaf55c8b82184546c0a25f58de056f54 100644 (file)
@@ -1796,8 +1796,7 @@ class DpkgPM(OpkgDpkgPM):
             open(os.path.join(target_dpkg_dir, "available"), "w+").close()
 
     def remove_packaging_data(self):
-        bb.utils.remove(os.path.join(self.target_rootfs,
-                                     self.d.getVar('opkglibdir')), True)
+        bb.utils.remove(self.target_rootfs + self.d.getVar('opkglibdir'), True)
         bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True)
 
     def fix_broken_dependencies(self):