From: Richard Purdie Date: Wed, 5 May 2021 21:13:10 +0000 (+0100) Subject: lib/package_manager: Use shutil.copy instead of bb.utils.copyfile for intercepts X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~7969 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a03c70c282b3445b93a4c70ea6d40a1778750c5;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git lib/package_manager: Use shutil.copy instead of bb.utils.copyfile for intercepts 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 --- diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py index 8e7128b1958..4d22bc0296c 100644 --- a/meta/lib/oe/package_manager/__init__.py +++ b/meta/lib/oe/package_manager/__init__.py @@ -189,7 +189,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):