diff options
Diffstat (limited to 'meta/lib/oe/package_manager/ipk/rootfs.py')
-rw-r--r-- | meta/lib/oe/package_manager/ipk/rootfs.py | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py b/meta/lib/oe/package_manager/ipk/rootfs.py index 26dbee6f6a..ba93eb62ea 100644 --- a/meta/lib/oe/package_manager/ipk/rootfs.py +++ b/meta/lib/oe/package_manager/ipk/rootfs.py | |||
@@ -1,4 +1,6 @@ | |||
1 | # | 1 | # |
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
2 | # SPDX-License-Identifier: GPL-2.0-only | 4 | # SPDX-License-Identifier: GPL-2.0-only |
3 | # | 5 | # |
4 | 6 | ||
@@ -145,51 +147,14 @@ class PkgRootfs(DpkgOpkgRootfs): | |||
145 | self.pm.recover_packaging_data() | 147 | self.pm.recover_packaging_data() |
146 | 148 | ||
147 | bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True) | 149 | bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True) |
148 | |||
149 | def _prelink_file(self, root_dir, filename): | ||
150 | bb.note('prelink %s in %s' % (filename, root_dir)) | ||
151 | prelink_cfg = oe.path.join(root_dir, | ||
152 | self.d.expand('${sysconfdir}/prelink.conf')) | ||
153 | if not os.path.exists(prelink_cfg): | ||
154 | shutil.copy(self.d.expand('${STAGING_DIR_NATIVE}${sysconfdir_native}/prelink.conf'), | ||
155 | prelink_cfg) | ||
156 | |||
157 | cmd_prelink = self.d.expand('${STAGING_DIR_NATIVE}${sbindir_native}/prelink') | ||
158 | self._exec_shell_cmd([cmd_prelink, | ||
159 | '--root', | ||
160 | root_dir, | ||
161 | '-amR', | ||
162 | '-N', | ||
163 | '-c', | ||
164 | self.d.expand('${sysconfdir}/prelink.conf')]) | ||
165 | |||
166 | ''' | 150 | ''' |
167 | Compare two files with the same key twice to see if they are equal. | 151 | Compare two files with the same key twice to see if they are equal. |
168 | If they are not equal, it means they are duplicated and come from | 152 | If they are not equal, it means they are duplicated and come from |
169 | different packages. | 153 | different packages. |
170 | 1st: Comapre them directly; | ||
171 | 2nd: While incremental image creation is enabled, one of the | ||
172 | files could be probaly prelinked in the previous image | ||
173 | creation and the file has been changed, so we need to | ||
174 | prelink the other one and compare them. | ||
175 | ''' | 154 | ''' |
176 | def _file_equal(self, key, f1, f2): | 155 | def _file_equal(self, key, f1, f2): |
177 | |||
178 | # Both of them are not prelinked | ||
179 | if filecmp.cmp(f1, f2): | 156 | if filecmp.cmp(f1, f2): |
180 | return True | 157 | return True |
181 | |||
182 | if bb.data.inherits_class('image-prelink', self.d): | ||
183 | if self.image_rootfs not in f1: | ||
184 | self._prelink_file(f1.replace(key, ''), f1) | ||
185 | |||
186 | if self.image_rootfs not in f2: | ||
187 | self._prelink_file(f2.replace(key, ''), f2) | ||
188 | |||
189 | # Both of them are prelinked | ||
190 | if filecmp.cmp(f1, f2): | ||
191 | return True | ||
192 | |||
193 | # Not equal | 158 | # Not equal |
194 | return False | 159 | return False |
195 | 160 | ||
@@ -200,7 +165,7 @@ class PkgRootfs(DpkgOpkgRootfs): | |||
200 | """ | 165 | """ |
201 | def _multilib_sanity_test(self, dirs): | 166 | def _multilib_sanity_test(self, dirs): |
202 | 167 | ||
203 | allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP") | 168 | allow_replace = "|".join((self.d.getVar("MULTILIBRE_ALLOW_REP") or "").split()) |
204 | if allow_replace is None: | 169 | if allow_replace is None: |
205 | allow_replace = "" | 170 | allow_replace = "" |
206 | 171 | ||