How to handle Case-sensitive files?

Michael Dickens michaelld at macports.org
Wed Jun 23 10:22:39 PDT 2010


Related to tickets #22119 (supposedly fixed) and #22046 (still open), it
seems as though qt4 4.6.3 and 4.7.0b1 both still have 2 sets of files
that are different only in caps (content of all 4 is the same):

{{{
  qt4-mac/include/phonon/Phonon
  qt4-mac/include/phonon/phonon
}}}

and (not surprisingly):

{{{
  qt4-mac/lib/phonon.framework/Versions/4/Headers/Phonon
  qt4-mac/lib/phonon.framework/Versions/4/Headers/phonon
}}}

I will be the first to say that I think the use of only-Caps-different
filenames is poor programming practice, and at least in this case I can
make sure that just one of each set is installed.  Non-withstanding my
opinion, there will be ports that provide such files, without the
Portfile developer's knowledge, and I think it's important for MacPorts
to handle them correctly (whatever that ends up being); right now, they
are not being robustly handled:

When these files are activated, it looks like all are added to the
MacPorts' "database" of installed files (e.g., for just the former set):

{{{
  DEBUG: activating file:
  /opt/local/libexec/qt4-mac-devel/include/phonon/Phonon
  DEBUG: activating file:
  /opt/local/libexec/qt4-mac-devel/include/phonon/phonon
  DEBUG: Adding file to file_map:
  /opt/local/libexec/qt4-mac-devel/include/phonon/Phonon for:
  qt4-mac-devel
  DEBUG: Adding file to file_map:
  /opt/local/libexec/qt4-mac-devel/include/phonon/phonon for:
  qt4-mac-devel
}}}

But, when I deactivate the port, only the Uppercase version is
deactivated; the lowercase version is left behind (again, just the
former set):

{{{
  DEBUG: deactivating file:
  /opt/local/libexec/qt4-mac-devel/include/phonon/Phonon
  DEBUG: Removing entry from file_map:
  /opt/local/libexec/qt4-mac-devel/include/phonon/Phonon
}}}

Now, if I activate this port again, port errors out with:

{{{
  DEBUG: Image error: /opt/local/libexec/qt4-mac/include/phonon/phonon
  already exists and does not belong to a registered port.  Unable to
  activate port qt4-mac. Use 'port -f activate qt4-mac' to force the
  activation.
    while executing
  "_activate_contents $name $imagefiles $imagedir"
    (procedure "portimage::activate" line 110)
    invoked from within
  "portimage::activate $portname $composite_version [array get options]"
}}}

So, there seems to be a case-sensitive issue with the database of
filenames, or something to that effect.  Seems as though, if nothing
else, 'port' should print out a warning when activating that it found a
case-difference in files & that this might mess up the use and
deactivation of the port.  Ideally IMHO, the database of filenames would
be case-sensitive and thus just work for these cases.

Do others have thoughts on this matter?  Should I enter this issue as a
ticket?  Thanks! - MLD


More information about the macports-dev mailing list