diff options
author | Ross Burton <ross.burton@intel.com> | 2018-04-27 16:55:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-05-22 13:13:32 +0100 |
commit | f0fe88b89f2b89e2fa7038580578f216aab1e34d (patch) | |
tree | 6a968d9b666b534e22f2fd26948bfe4c17e94fdc /meta | |
parent | ef7222c6d1cbd81cd95dd3f13b282ed70b978ea9 (diff) | |
download | poky-f0fe88b89f2b89e2fa7038580578f216aab1e34d.tar.gz |
package_manager: expand the removal list for RPM
If package management is disabled we remove the state and configuration for the
package manager after the rootfs has been populated. This list wasn't complete
and the DNF/RPM configuration files were left behind.
As we've added files to the list (and not just directories), expand the
backup/restore package management state code to handle this.
(From OE-Core rev: c8a6422457b4d29e6afd1e193b8b921287472137)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/package_manager.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 2d8aeba037..1cba5ee968 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -668,7 +668,7 @@ class RpmPM(PackageManager): | |||
668 | self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name) | 668 | self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name) |
669 | if not os.path.exists(self.d.expand('${T}/saved_packaging_data')): | 669 | if not os.path.exists(self.d.expand('${T}/saved_packaging_data')): |
670 | bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data')) | 670 | bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data')) |
671 | self.packaging_data_dirs = ['var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf'] | 671 | self.packaging_data_dirs = ['etc/rpm', 'etc/rpmrc', 'etc/dnf', 'var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf'] |
672 | self.solution_manifest = self.d.expand('${T}/saved/%s_solution' % | 672 | self.solution_manifest = self.d.expand('${T}/saved/%s_solution' % |
673 | self.task_name) | 673 | self.task_name) |
674 | if not os.path.exists(self.d.expand('${T}/saved')): | 674 | if not os.path.exists(self.d.expand('${T}/saved')): |
@@ -832,7 +832,10 @@ class RpmPM(PackageManager): | |||
832 | for i in self.packaging_data_dirs: | 832 | for i in self.packaging_data_dirs: |
833 | source_dir = oe.path.join(self.target_rootfs, i) | 833 | source_dir = oe.path.join(self.target_rootfs, i) |
834 | target_dir = oe.path.join(self.saved_packaging_data, i) | 834 | target_dir = oe.path.join(self.saved_packaging_data, i) |
835 | shutil.copytree(source_dir, target_dir, symlinks=True) | 835 | if os.path.isdir(source_dir): |
836 | shutil.copytree(source_dir, target_dir, symlinks=True) | ||
837 | elif os.path.isfile(source_dir): | ||
838 | shutil.copy2(source_dir, target_dir) | ||
836 | 839 | ||
837 | def recovery_packaging_data(self): | 840 | def recovery_packaging_data(self): |
838 | # Move the rpmlib back | 841 | # Move the rpmlib back |
@@ -842,9 +845,10 @@ class RpmPM(PackageManager): | |||
842 | if os.path.exists(target_dir): | 845 | if os.path.exists(target_dir): |
843 | bb.utils.remove(target_dir, True) | 846 | bb.utils.remove(target_dir, True) |
844 | source_dir = oe.path.join(self.saved_packaging_data, i) | 847 | source_dir = oe.path.join(self.saved_packaging_data, i) |
845 | shutil.copytree(source_dir, | 848 | if os.path.isdir(source_dir): |
846 | target_dir, | 849 | shutil.copytree(source_dir, target_dir, symlinks=True) |
847 | symlinks=True) | 850 | elif os.path.isfile(source_dir): |
851 | shutil.copy2(source_dir, target_dir) | ||
848 | 852 | ||
849 | def list_installed(self): | 853 | def list_installed(self): |
850 | output = self._invoke_dnf(["repoquery", "--installed", "--queryformat", "Package: %{name} %{arch} %{version} %{name}-%{version}-%{release}.%{arch}.rpm\nDependencies:\n%{requires}\nRecommendations:\n%{recommends}\nDependenciesEndHere:\n"], | 854 | output = self._invoke_dnf(["repoquery", "--installed", "--queryformat", "Package: %{name} %{arch} %{version} %{name}-%{version}-%{release}.%{arch}.rpm\nDependencies:\n%{requires}\nRecommendations:\n%{recommends}\nDependenciesEndHere:\n"], |