Opened 12 years ago

Closed 12 years ago

#35226 closed defect (fixed)

muniversal portgroup fails when port installs "broken" symlinks

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: Cc:
Port: muniversal

Description

I'm unable to update fontconfig to 2.10 because of this bug in the muniversal portgroup. The problem is:

  • muniversal uses [file exists] to determine if a file exists in both destroots or only in one, to determine whether it should try to merge them or just copy one
  • fontconfig 2.10 wants to install some absolute symlinks—at destroot time, they're "broken" because what they're pointing to doesn't exist yet, but it will once the port is activated
  • for symlinks, [file exists] answers about the thing the symlink points to, not about the symlink itself

The result is that for each of these "broken" symlinks, muniversal prints an incorrect line like:

DEBUG: universal: merge: /opt/local/etc/fonts/conf.d/20-unhint-small-vera.conf only exists in /opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_fontconfig/fontconfig/work/destroot-x86_64

And then the merging of the destroots ultimately fails with:

Error: org.macports.destroot for port fontconfig returned: error copying "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_fontconfig/fontconfig/work/destroot-i386//opt/local/etc/fonts/conf.d/20-unhint-small-vera.conf" to "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_fontconfig/fontconfig/work/destroot-intel//opt/local/etc/fonts/conf.d/20-unhint-small-vera.conf": file already exists

I do not know why [file exists] acts on the symlink target instead of on the symlink itself. I don't see any switch to make [file exists] act on the symlink itself. There is no [file islink] that we could use. There is [file type]; we could perhaps use [file type] instead of [file exists], and take an error condition to mean that the file does not exist. There are multiple places within the muniversal portgroup where this would need to be addressed.

We might even consider adding a Tcl procedure to MacPorts base which could abstract away this solution (just as we already have Tcl procedures for "ln", "delete", "copy" and "move" in base to deal with other common needs). One slight problem is that portutil.tcl already contains an "exists" procedure and it has nothing to do with the filesystem.

Change History (1)

comment:1 in reply to:  description Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to ryandesign@…:

There is [file type]; we could perhaps use [file type] instead of [file exists], and take an error condition to mean that the file does not exist. There are multiple places within the muniversal portgroup where this would need to be addressed.

r99808

We might even consider adding a Tcl procedure to MacPorts base which could abstract away this solution (just as we already have Tcl procedures for "ln", "delete", "copy" and "move" in base to deal with other common needs).

I think this would still be a good idea to do later.

Note: See TracTickets for help on using tickets.