diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-06 11:06:21 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-08 23:54:04 +0100 |
commit | cec9cfb059e05befd9f254015fd6e2be3ece59ab (patch) | |
tree | aaec28953dd4ad03c49f20dbb9805dc7cc6129c7 | |
parent | 9c1e94752e5e65065408bd389216199a6a262733 (diff) | |
download | poky-cec9cfb059e05befd9f254015fd6e2be3ece59ab.tar.gz |
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.
(From OE-Core rev: c22f64d16b0801a3bcebda81a6fedcad8fe02ab3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1a03c70c282b3445b93a4c70ea6d40a1778750c5)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/package_manager/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oe/package_manager/__init__.py b/meta/lib/oe/package_manager/__init__.py index 42225a3b2e..26f9f82aaa 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): | |||
189 | bb.utils.remove(self.intercepts_dir, True) | 189 | bb.utils.remove(self.intercepts_dir, True) |
190 | bb.utils.mkdirhier(self.intercepts_dir) | 190 | bb.utils.mkdirhier(self.intercepts_dir) |
191 | for intercept in postinst_intercepts: | 191 | for intercept in postinst_intercepts: |
192 | bb.utils.copyfile(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept))) | 192 | shutil.copy(intercept, os.path.join(self.intercepts_dir, os.path.basename(intercept))) |
193 | 193 | ||
194 | @abstractmethod | 194 | @abstractmethod |
195 | def _handle_intercept_failure(self, failed_script): | 195 | def _handle_intercept_failure(self, failed_script): |