Opened 4 years ago

Last modified 4 years ago

#60749 new defect

Activation fails if a port tries to install ._ files

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.6.2
Keywords: Cc: cooljeanius (Eric Gallager)
Port:

Description

A PR to add MacPass was submitted. It downloaded a zip file containing a compiled app. Some of the files within the app had extended attributes, which were represented within the zip archive as separate files with names beginning with "._" (AppleDouble files) in the usual way. Unfortunately, unlike Archive Utility, it seems that the unzip program doesn't know anything about "._" files so it just extracts them as is. The port in the PR then copied the app, including those "._" files, to the destroot.

MacPorts then created its tar.bz2 archive of the contents of the destroot. tar on macOS is aware of "._" files and extended attributes, so it recombined them. Upon activation, this led to an error:

Error: Failed to activate MacPass: Image error: Source file /opt/local/var/macports/software/MacPass/mpextractiWavLBZg/Applications/MacPorts/MacPass.app/Contents/Resources/es.lproj/._DatabaseSettingsWindow.strings does not appear to exist (cannot lstat it).  Unable to activate port MacPass.

Apparently MacPorts takes an inventory of the contents of the destroot first, then creates the archive, then extracts the archive, then verifies that everything that it inventoried got extracted, which won't be the case for the "._" files in this scenario.

Possible solutions:

  • Run dot_clean after extracting an archive to recombine the "._" files with their counterparts. Possibly only do this for zip archives and other files where we know that the decompressor doesn't already do this. dot_clean exists on Leopard and later. For Tiger, maybe we can do it manually.
  • Skip "._" files when taking the inventory.
  • Get the inventory from tar after it has made the archive, rather than inventory the destroot directly.

Change History (1)

comment:1 Changed 4 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.