Opened 16 years ago

Closed 14 years ago

Last modified 14 years ago

#14123 closed defect (fixed)

base-1.6.0 "port uninstall" left installed files at case-sensitive FS

Reported by: ononon@… Owned by: macports-tickets@…
Priority: Low Milestone: MacPorts 1.9.0
Component: base Version: 1.6.0
Keywords: Cc: jmroot (Joshua Root), pguyot (Paul Guyot), raimue (Rainer Müller), dhaines@…, ruud@…
Port:

Description

At HFS+ (case sensitive),

port install ncursesw
port uninstall ncursesw

make errors and some installed files are not deleted.

This is because "filemap" in Pextlib.dylib is a case-insensitive function, so

filemap set testmap "/A/Apple_Terminal" "casetest"
filemap set testmap "/a/appleII"        "casetest"
puts [filemap list testmap "casetest"]

show "/A/Apple_Terminal /A/appleII". (Note that path 'a' of 'appleII' was touppered !)

To fix this, you have only to substitute 'strncasecmp' with 'strncmp' in src/pextlib1.0/filemap.c . I guess that this fix make little influence to case-insensitive users, then expect that it is applied for our case-sensitive users.

Thanks in advance.

Attachments (1)

filemap_file_case.diff (1.2 KB) - added by jmroot (Joshua Root) 16 years ago.
implementation of the requested change

Download all attachments as: .zip

Change History (21)

Changed 16 years ago by jmroot (Joshua Root)

Attachment: filemap_file_case.diff added

implementation of the requested change

comment:1 Changed 16 years ago by jmroot (Joshua Root)

Cc: jmr@… pguyot@… added

The attached patch should do what you're asking for. Paul, you wrote this code—will this break anything?

comment:2 Changed 16 years ago by raimue (Rainer Müller)

Cc: raimue@… added

Cc Me!

comment:3 Changed 16 years ago by jmroot (Joshua Root)

To answer my own question, yes, applying just this patch breaks deactivation.

comment:4 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:5 Changed 14 years ago by dhaines@…

Cc: dhaines@… added

Cc Me!

comment:6 in reply to:  3 Changed 14 years ago by dhaines@…

Replying to jmr@…:

To answer my own question, yes, applying just this patch breaks deactivation.

From what I can tell, replacing the three instances of strncasecmp in src/pextlib1.0/filemap.c with strncmp works just fine in 1.8.1. I've tested it on both a case-sensitive filesystem and a case-insensitive disk image, and it seems to handle activation, deactivation, installation, and deinstallation of various ports, including ncursesw and qt4-mac, just fine. Unless someone else finds an error with this, I'd ask that the change be included with the next released version of MacPorts.

comment:7 Changed 14 years ago by jmroot (Joshua Root)

Have you tested on Tiger, Leopard and Snow Leopard?

comment:8 in reply to:  7 ; Changed 14 years ago by dhaines@…

Replying to jmr@…:

Have you tested on Tiger, Leopard and Snow Leopard?

Only Leopard. Sorry.

comment:9 in reply to:  8 Changed 14 years ago by dhaines@…

Replying to dhaines@…:

Replying to jmr@…:

Have you tested on Tiger, Leopard and Snow Leopard?

Only Leopard. Sorry.

I've now tested on both Leopard and Snow Leopard, and the patch works on both.

comment:10 Changed 14 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 1.9.0
Resolution: fixed
Status: newclosed

comment:11 Changed 14 years ago by jmroot (Joshua Root)

Milestone: MacPorts 1.9.0MacPorts Future
Resolution: fixed
Status: closedreopened

Reverted in r60247, still breaks deactivation of some ports (e.g. ncursesw).

comment:12 Changed 14 years ago by ruud@…

Cc: ruud@… added

Cc Me!

comment:13 in reply to:  11 ; Changed 14 years ago by dhaines@…

Replying to jmr@…:

Reverted in r60247, still breaks deactivation of some ports (e.g. ncursesw).

In which situations did it break things? I know that I tested it on 10.5, 10.6, both case sensitive and case insensitive. Is this a 10.4 issue? At worst, we could include an #ifdef for, say, 10.5 and 10.6. Thoughts?

comment:14 in reply to:  13 ; Changed 14 years ago by jmroot (Joshua Root)

Replying to dhaines@…:

In which situations did it break things?

Install without patch, apply patch, try deactivating.

comment:15 in reply to:  14 Changed 14 years ago by dhaines@…

Replying to jmr@…:

Replying to dhaines@…:

In which situations did it break things?

Install without patch, apply patch, try deactivating.

Ah yes. I think that's just how any fix would have to be unless someone wants to write a migration/translation tool for the database affected.

comment:16 Changed 14 years ago by jmroot (Joshua Root)

This is probably fixed in the sqlite registry.

comment:17 Changed 14 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 1.9.0

comment:18 Changed 14 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed

Seems fine to me, reopen if you still have this problem when using portdbformat sqlite.

comment:19 in reply to:  18 ; Changed 14 years ago by dhaines@…

Replying to jmr@…:

Seems fine to me, reopen if you still have this problem when using portdbformat sqlite.

Isn't that an unsupported option?

comment:20 in reply to:  19 Changed 14 years ago by raimue (Rainer Müller)

Replying to dhaines@…:

Isn't that an unsupported option?

sqlite will be the new default registry format as of MacPorts 1.9. Please do not enable it yet with 1.8.x.

Note: See TracTickets for help on using tickets.