blob: caca522fd69766f5f52c951c084d82b58807cd32 [file] [log] [blame]
Andrew Geissler635e0e42020-08-21 15:58:33 -05001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Andrew Geissler635e0e42020-08-21 15:58:33 -05004# SPDX-License-Identifier: GPL-2.0-only
5#
6
7import re
8import shutil
9import subprocess
10from oe.package_manager import *
11
12class OpkgIndexer(Indexer):
13 def write_index(self):
14 arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
15 "SDK_PACKAGE_ARCHS",
16 ]
17
18 opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
19 if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
20 signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
21 else:
22 signer = None
23
24 if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
25 open(os.path.join(self.deploy_dir, "Packages"), "w").close()
26
27 index_cmds = set()
28 index_sign_files = set()
29 for arch_var in arch_vars:
30 archs = self.d.getVar(arch_var)
31 if archs is None:
32 continue
33
34 for arch in archs.split():
35 pkgs_dir = os.path.join(self.deploy_dir, arch)
36 pkgs_file = os.path.join(pkgs_dir, "Packages")
37
38 if not os.path.isdir(pkgs_dir):
39 continue
40
41 if not os.path.exists(pkgs_file):
42 open(pkgs_file, "w").close()
43
44 index_cmds.add('%s --checksum md5 --checksum sha256 -r %s -p %s -m %s' %
45 (opkg_index_cmd, pkgs_file, pkgs_file, pkgs_dir))
46
47 index_sign_files.add(pkgs_file)
48
49 if len(index_cmds) == 0:
50 bb.note("There are no packages in %s!" % self.deploy_dir)
51 return
52
53 oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
54
55 if signer:
56 feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
57 is_ascii_sig = (feed_sig_type.upper() != "BIN")
58 for f in index_sign_files:
59 signer.detach_sign(f,
60 self.d.getVar('PACKAGE_FEED_GPG_NAME'),
61 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
62 armor=is_ascii_sig)
63
Andrew Geissler6ce62a22020-11-30 19:58:47 -060064class PMPkgsList(PkgsList):
65 def __init__(self, d, rootfs_dir):
66 super(PMPkgsList, self).__init__(d, rootfs_dir)
67 config_file = d.getVar("IPKGCONF_TARGET")
Andrew Geissler635e0e42020-08-21 15:58:33 -050068
69 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
70 self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
71 self.opkg_args += self.d.getVar("OPKG_ARGS")
72
73 def list_pkgs(self, format=None):
74 cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args)
75
76 # opkg returns success even when it printed some
77 # "Collected errors:" report to stderr. Mixing stderr into
78 # stdout then leads to random failures later on when
79 # parsing the output. To avoid this we need to collect both
80 # output streams separately and check for empty stderr.
81 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
82 cmd_output, cmd_stderr = p.communicate()
83 cmd_output = cmd_output.decode("utf-8")
84 cmd_stderr = cmd_stderr.decode("utf-8")
85 if p.returncode or cmd_stderr:
86 bb.fatal("Cannot get the installed packages list. Command '%s' "
87 "returned %d and stderr:\n%s" % (cmd, p.returncode, cmd_stderr))
88
89 return opkg_query(cmd_output)
90
91
92
93class OpkgDpkgPM(PackageManager):
94 def __init__(self, d, target_rootfs):
95 """
96 This is an abstract class. Do not instantiate this directly.
97 """
98 super(OpkgDpkgPM, self).__init__(d, target_rootfs)
99
100 def package_info(self, pkg, cmd):
101 """
102 Returns a dictionary with the package info.
103
104 This method extracts the common parts for Opkg and Dpkg
105 """
106
Patrick Williamsdb4c27e2022-08-05 08:10:29 -0500107 proc = subprocess.run(cmd, capture_output=True, encoding="utf-8", shell=True)
108 if proc.returncode:
Andrew Geissler635e0e42020-08-21 15:58:33 -0500109 bb.fatal("Unable to list available packages. Command '%s' "
Patrick Williamsdb4c27e2022-08-05 08:10:29 -0500110 "returned %d:\n%s" % (cmd, proc.returncode, proc.stderr))
111 elif proc.stderr:
112 bb.note("Command '%s' returned stderr: %s" % (cmd, proc.stderr))
113
114 return opkg_query(proc.stdout)
Andrew Geissler635e0e42020-08-21 15:58:33 -0500115
116 def extract(self, pkg, pkg_info):
117 """
118 Returns the path to a tmpdir where resides the contents of a package.
119
120 Deleting the tmpdir is responsability of the caller.
121
122 This method extracts the common parts for Opkg and Dpkg
123 """
124
125 ar_cmd = bb.utils.which(os.getenv("PATH"), "ar")
126 tar_cmd = bb.utils.which(os.getenv("PATH"), "tar")
127 pkg_path = pkg_info[pkg]["filepath"]
128
129 if not os.path.isfile(pkg_path):
130 bb.fatal("Unable to extract package for '%s'."
131 "File %s doesn't exists" % (pkg, pkg_path))
132
133 tmp_dir = tempfile.mkdtemp()
134 current_dir = os.getcwd()
135 os.chdir(tmp_dir)
136 data_tar = 'data.tar.xz'
137
138 try:
139 cmd = [ar_cmd, 'x', pkg_path]
140 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
141 cmd = [tar_cmd, 'xf', data_tar]
142 output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
143 except subprocess.CalledProcessError as e:
144 bb.utils.remove(tmp_dir, recurse=True)
145 bb.fatal("Unable to extract %s package. Command '%s' "
146 "returned %d:\n%s" % (pkg_path, ' '.join(cmd), e.returncode, e.output.decode("utf-8")))
147 except OSError as e:
148 bb.utils.remove(tmp_dir, recurse=True)
149 bb.fatal("Unable to extract %s package. Command '%s' "
150 "returned %d:\n%s at %s" % (pkg_path, ' '.join(cmd), e.errno, e.strerror, e.filename))
151
152 bb.note("Extracted %s to %s" % (pkg_path, tmp_dir))
153 bb.utils.remove(os.path.join(tmp_dir, "debian-binary"))
154 bb.utils.remove(os.path.join(tmp_dir, "control.tar.gz"))
155 os.chdir(current_dir)
156
157 return tmp_dir
158
159 def _handle_intercept_failure(self, registered_pkgs):
160 self.mark_packages("unpacked", registered_pkgs.split())
161
162class OpkgPM(OpkgDpkgPM):
163 def __init__(self, d, target_rootfs, config_file, archs, task_name='target', ipk_repo_workdir="oe-rootfs-repo", filterbydependencies=True, prepare_index=True):
164 super(OpkgPM, self).__init__(d, target_rootfs)
165
166 self.config_file = config_file
167 self.pkg_archs = archs
168 self.task_name = task_name
169
170 self.deploy_dir = oe.path.join(self.d.getVar('WORKDIR'), ipk_repo_workdir)
171 self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
172 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
173 self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
174 self.opkg_args += self.d.getVar("OPKG_ARGS")
175
176 if prepare_index:
177 create_packages_dir(self.d, self.deploy_dir, d.getVar("DEPLOY_DIR_IPK"), "package_write_ipk", filterbydependencies)
178
Andrew Geissler09209ee2020-12-13 08:44:15 -0600179 self.opkg_dir = oe.path.join(target_rootfs, self.d.getVar('OPKGLIBDIR'), "opkg")
Andrew Geissler635e0e42020-08-21 15:58:33 -0500180 bb.utils.mkdirhier(self.opkg_dir)
181
182 self.saved_opkg_dir = self.d.expand('${T}/saved/%s' % self.task_name)
183 if not os.path.exists(self.d.expand('${T}/saved')):
184 bb.utils.mkdirhier(self.d.expand('${T}/saved'))
185
186 self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") == "1"
187 if self.from_feeds:
188 self._create_custom_config()
189 else:
190 self._create_config()
191
192 self.indexer = OpkgIndexer(self.d, self.deploy_dir)
193
194 def mark_packages(self, status_tag, packages=None):
195 """
196 This function will change a package's status in /var/lib/opkg/status file.
197 If 'packages' is None then the new_status will be applied to all
198 packages
199 """
200 status_file = os.path.join(self.opkg_dir, "status")
201
202 with open(status_file, "r") as sf:
203 with open(status_file + ".tmp", "w+") as tmp_sf:
204 if packages is None:
205 tmp_sf.write(re.sub(r"Package: (.*?)\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)",
206 r"Package: \1\n\2Status: \3%s" % status_tag,
207 sf.read()))
208 else:
209 if type(packages).__name__ != "list":
210 raise TypeError("'packages' should be a list object")
211
212 status = sf.read()
213 for pkg in packages:
214 status = re.sub(r"Package: %s\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)" % pkg,
215 r"Package: %s\n\1Status: \2%s" % (pkg, status_tag),
216 status)
217
218 tmp_sf.write(status)
219
Andrew Geisslerc926e172021-05-07 16:11:35 -0500220 bb.utils.rename(status_file + ".tmp", status_file)
Andrew Geissler635e0e42020-08-21 15:58:33 -0500221
222 def _create_custom_config(self):
223 bb.note("Building from feeds activated!")
224
225 with open(self.config_file, "w+") as config_file:
226 priority = 1
227 for arch in self.pkg_archs.split():
228 config_file.write("arch %s %d\n" % (arch, priority))
229 priority += 5
230
231 for line in (self.d.getVar('IPK_FEED_URIS') or "").split():
232 feed_match = re.match(r"^[ \t]*(.*)##([^ \t]*)[ \t]*$", line)
233
234 if feed_match is not None:
235 feed_name = feed_match.group(1)
236 feed_uri = feed_match.group(2)
237
238 bb.note("Add %s feed with URL %s" % (feed_name, feed_uri))
239
240 config_file.write("src/gz %s %s\n" % (feed_name, feed_uri))
241
242 """
243 Allow to use package deploy directory contents as quick devel-testing
244 feed. This creates individual feed configs for each arch subdir of those
245 specified as compatible for the current machine.
246 NOTE: Development-helper feature, NOT a full-fledged feed.
247 """
248 if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI') or "") != "":
249 for arch in self.pkg_archs.split():
250 cfg_file_name = os.path.join(self.target_rootfs,
251 self.d.getVar("sysconfdir"),
252 "opkg",
253 "local-%s-feed.conf" % arch)
254
255 with open(cfg_file_name, "w+") as cfg_file:
256 cfg_file.write("src/gz local-%s %s/%s" %
257 (arch,
258 self.d.getVar('FEED_DEPLOYDIR_BASE_URI'),
259 arch))
260
261 if self.d.getVar('OPKGLIBDIR') != '/var/lib':
262 # There is no command line option for this anymore, we need to add
263 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
264 # the default value of "/var/lib" as defined in opkg:
265 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR VARDIR "/lib/opkg/lists"
266 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR VARDIR "/lib/opkg/info"
267 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
268 cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
269 cfg_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
270 cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
271
272
273 def _create_config(self):
274 with open(self.config_file, "w+") as config_file:
275 priority = 1
276 for arch in self.pkg_archs.split():
277 config_file.write("arch %s %d\n" % (arch, priority))
278 priority += 5
279
280 config_file.write("src oe file:%s\n" % self.deploy_dir)
281
282 for arch in self.pkg_archs.split():
283 pkgs_dir = os.path.join(self.deploy_dir, arch)
284 if os.path.isdir(pkgs_dir):
285 config_file.write("src oe-%s file:%s\n" %
286 (arch, pkgs_dir))
287
288 if self.d.getVar('OPKGLIBDIR') != '/var/lib':
289 # There is no command line option for this anymore, we need to add
290 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
291 # the default value of "/var/lib" as defined in opkg:
292 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR VARDIR "/lib/opkg/lists"
293 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR VARDIR "/lib/opkg/info"
294 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
295 config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
296 config_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
297 config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
298
299 def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
300 if feed_uris == "":
301 return
302
303 rootfs_config = os.path.join('%s/etc/opkg/base-feeds.conf'
304 % self.target_rootfs)
305
306 os.makedirs('%s/etc/opkg' % self.target_rootfs, exist_ok=True)
307
308 feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
309 archs = self.pkg_archs.split() if feed_archs is None else feed_archs.split()
310
311 with open(rootfs_config, "w+") as config_file:
312 uri_iterator = 0
313 for uri in feed_uris:
314 if archs:
315 for arch in archs:
316 if (feed_archs is None) and (not os.path.exists(oe.path.join(self.deploy_dir, arch))):
317 continue
318 bb.note('Adding opkg feed url-%s-%d (%s)' %
319 (arch, uri_iterator, uri))
320 config_file.write("src/gz uri-%s-%d %s/%s\n" %
321 (arch, uri_iterator, uri, arch))
322 else:
323 bb.note('Adding opkg feed url-%d (%s)' %
324 (uri_iterator, uri))
325 config_file.write("src/gz uri-%d %s\n" %
326 (uri_iterator, uri))
327
328 uri_iterator += 1
329
330 def update(self):
331 self.deploy_dir_lock()
332
333 cmd = "%s %s update" % (self.opkg_cmd, self.opkg_args)
334
335 try:
336 subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
337 except subprocess.CalledProcessError as e:
338 self.deploy_dir_unlock()
339 bb.fatal("Unable to update the package index files. Command '%s' "
340 "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
341
342 self.deploy_dir_unlock()
343
Andrew Geissler615f2f12022-07-15 14:00:58 -0500344 def install(self, pkgs, attempt_only=False, hard_depends_only=False):
Andrew Geissler635e0e42020-08-21 15:58:33 -0500345 if not pkgs:
346 return
347
348 cmd = "%s %s" % (self.opkg_cmd, self.opkg_args)
349 for exclude in (self.d.getVar("PACKAGE_EXCLUDE") or "").split():
350 cmd += " --add-exclude %s" % exclude
351 for bad_recommendation in (self.d.getVar("BAD_RECOMMENDATIONS") or "").split():
352 cmd += " --add-ignore-recommends %s" % bad_recommendation
Andrew Geissler615f2f12022-07-15 14:00:58 -0500353 if hard_depends_only:
354 cmd += " --no-install-recommends"
Andrew Geissler635e0e42020-08-21 15:58:33 -0500355 cmd += " install "
356 cmd += " ".join(pkgs)
357
358 os.environ['D'] = self.target_rootfs
359 os.environ['OFFLINE_ROOT'] = self.target_rootfs
360 os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
361 os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
362 os.environ['INTERCEPT_DIR'] = self.intercepts_dir
363 os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
364
365 try:
366 bb.note("Installing the following packages: %s" % ' '.join(pkgs))
367 bb.note(cmd)
368 output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
369 bb.note(output)
370 failed_pkgs = []
371 for line in output.split('\n'):
372 if line.endswith("configuration required on target."):
373 bb.warn(line)
374 failed_pkgs.append(line.split(".")[0])
375 if failed_pkgs:
376 failed_postinsts_abort(failed_pkgs, self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
377 except subprocess.CalledProcessError as e:
378 (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
379 "Command '%s' returned %d:\n%s" %
380 (cmd, e.returncode, e.output.decode("utf-8")))
381
382 def remove(self, pkgs, with_dependencies=True):
383 if not pkgs:
384 return
385
386 if with_dependencies:
387 cmd = "%s %s --force-remove --force-removal-of-dependent-packages remove %s" % \
388 (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
389 else:
390 cmd = "%s %s --force-depends remove %s" % \
391 (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
392
393 try:
394 bb.note(cmd)
395 output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
396 bb.note(output)
397 except subprocess.CalledProcessError as e:
398 bb.fatal("Unable to remove packages. Command '%s' "
399 "returned %d:\n%s" % (e.cmd, e.returncode, e.output.decode("utf-8")))
400
401 def write_index(self):
402 self.deploy_dir_lock()
403
404 result = self.indexer.write_index()
405
406 self.deploy_dir_unlock()
407
408 if result is not None:
409 bb.fatal(result)
410
411 def remove_packaging_data(self):
Andrew Geissler09209ee2020-12-13 08:44:15 -0600412 cachedir = oe.path.join(self.target_rootfs, self.d.getVar("localstatedir"), "cache", "opkg")
Andrew Geissler635e0e42020-08-21 15:58:33 -0500413 bb.utils.remove(self.opkg_dir, True)
Andrew Geissler09209ee2020-12-13 08:44:15 -0600414 bb.utils.remove(cachedir, True)
Andrew Geissler635e0e42020-08-21 15:58:33 -0500415
416 def remove_lists(self):
417 if not self.from_feeds:
418 bb.utils.remove(os.path.join(self.opkg_dir, "lists"), True)
419
420 def list_installed(self):
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600421 return PMPkgsList(self.d, self.target_rootfs).list_pkgs()
Andrew Geissler635e0e42020-08-21 15:58:33 -0500422
423 def dummy_install(self, pkgs):
424 """
425 The following function dummy installs pkgs and returns the log of output.
426 """
427 if len(pkgs) == 0:
428 return
429
430 # Create an temp dir as opkg root for dummy installation
431 temp_rootfs = self.d.expand('${T}/opkg')
432 opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
433 if opkg_lib_dir[0] == "/":
434 opkg_lib_dir = opkg_lib_dir[1:]
435 temp_opkg_dir = os.path.join(temp_rootfs, opkg_lib_dir, 'opkg')
436 bb.utils.mkdirhier(temp_opkg_dir)
437
438 opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)
439 opkg_args += self.d.getVar("OPKG_ARGS")
440
441 cmd = "%s %s update" % (self.opkg_cmd, opkg_args)
442 try:
443 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
444 except subprocess.CalledProcessError as e:
445 bb.fatal("Unable to update. Command '%s' "
446 "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
447
448 # Dummy installation
449 cmd = "%s %s --noaction install %s " % (self.opkg_cmd,
450 opkg_args,
451 ' '.join(pkgs))
Patrick Williamsdb4c27e2022-08-05 08:10:29 -0500452 proc = subprocess.run(cmd, capture_output=True, encoding="utf-8", shell=True)
453 if proc.returncode:
Andrew Geissler635e0e42020-08-21 15:58:33 -0500454 bb.fatal("Unable to dummy install packages. Command '%s' "
Patrick Williamsdb4c27e2022-08-05 08:10:29 -0500455 "returned %d:\n%s" % (cmd, proc.returncode, proc.stderr))
456 elif proc.stderr:
457 bb.note("Command '%s' returned stderr: %s" % (cmd, proc.stderr))
Andrew Geissler635e0e42020-08-21 15:58:33 -0500458
459 bb.utils.remove(temp_rootfs, True)
460
Patrick Williamsdb4c27e2022-08-05 08:10:29 -0500461 return proc.stdout
Andrew Geissler635e0e42020-08-21 15:58:33 -0500462
463 def backup_packaging_data(self):
464 # Save the opkglib for increment ipk image generation
465 if os.path.exists(self.saved_opkg_dir):
466 bb.utils.remove(self.saved_opkg_dir, True)
467 shutil.copytree(self.opkg_dir,
468 self.saved_opkg_dir,
469 symlinks=True)
470
471 def recover_packaging_data(self):
472 # Move the opkglib back
473 if os.path.exists(self.saved_opkg_dir):
474 if os.path.exists(self.opkg_dir):
475 bb.utils.remove(self.opkg_dir, True)
476
477 bb.note('Recover packaging data')
478 shutil.copytree(self.saved_opkg_dir,
479 self.opkg_dir,
480 symlinks=True)
481
482 def package_info(self, pkg):
483 """
484 Returns a dictionary with the package info.
485 """
486 cmd = "%s %s info %s" % (self.opkg_cmd, self.opkg_args, pkg)
487 pkg_info = super(OpkgPM, self).package_info(pkg, cmd)
488
489 pkg_arch = pkg_info[pkg]["arch"]
490 pkg_filename = pkg_info[pkg]["filename"]
491 pkg_info[pkg]["filepath"] = \
492 os.path.join(self.deploy_dir, pkg_arch, pkg_filename)
493
494 return pkg_info
495
496 def extract(self, pkg):
497 """
498 Returns the path to a tmpdir where resides the contents of a package.
499
500 Deleting the tmpdir is responsability of the caller.
501 """
502 pkg_info = self.package_info(pkg)
503 if not pkg_info:
504 bb.fatal("Unable to get information for package '%s' while "
505 "trying to extract the package." % pkg)
506
507 tmp_dir = super(OpkgPM, self).extract(pkg, pkg_info)
508 bb.utils.remove(os.path.join(tmp_dir, "data.tar.xz"))
509
510 return tmp_dir