[MacPorts] #60749: Activation fails if a port tries to install ._ files

MacPorts noreply at macports.org
Wed Jul 1 08:33:02 UTC 2020


#60749: Activation fails if a port tries to install ._ files
------------------------+--------------------
 Reporter:  ryandesign  |      Owner:  (none)
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  base        |    Version:  2.6.2
 Keywords:              |       Port:
------------------------+--------------------
 A [https://github.com/macports/macports-ports/pull/7030 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 "._"
 ([https://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats
 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/60749>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list