]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/package_manager: Use shutil.copy instead of bb.utils.copyfile for intercepts
authorSteve Sakoman <steve@sakoman.com>
Thu, 6 May 2021 16:10:56 +0000 (06:10 -1000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 13 May 2021 21:10:00 +0000 (22:10 +0100)
If the scripts/postinst-intercepts is owned by root/root then the copyfile() calls
will fail due to chown issues. We don't care about ownership of these files so
use shutil.copy() instead which won't perform any chown.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oe/package_manager.py

index b0660411eaf55c8b82184546c0a25f58de056f54..db988d9247519fca75350294d5d448ef6088a6dc 100644 (file)
@@ -403,7 +403,7 @@ class PackageManager(object, metaclass=ABCMeta):
         bb.utils.remove(self.intercepts_dir, True)
         bb.utils.mkdirhier(self.intercepts_dir)
         for intercept in postinst_intercepts:
-            bb.utils.copyfile(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept)))
+            shutil.copy(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept)))
 
     @abstractmethod
     def _handle_intercept_failure(self, failed_script):