Browse Source

lib/oe/package_manager: don't try to rm /var/lib/opkg

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>
(cherry picked from commit fc974977cea389f54e7fc7de7b1c8fd3d8bafe58)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Jan Luebbe 4 years ago
parent
commit
71711f5f20
1 changed files with 1 additions and 2 deletions
  1. 1 2
      meta/lib/oe/package_manager.py

+ 1 - 2
meta/lib/oe/package_manager.py

@@ -1791,8 +1791,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):