New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #14123 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

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: jmr@…, pguyot@…, raimue@…, 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

filemap_file_case.diff (1.2 KB) - added by jmr@… 5 years ago.
implementation of the requested change

Change History

Changed 5 years ago by jmr@…

implementation of the requested change

comment:1 Changed 5 years ago by jmr@…

  • 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 5 years ago by raimue@…

  • Cc raimue@… added

Cc Me!

comment:3 follow-up: ↓ 6 Changed 5 years ago by jmr@…

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

comment:4 Changed 4 years ago by toby@…

  • Milestone changed from MacPorts base bugs to MacPorts Future

Milestone MacPorts base bugs deleted

comment:5 Changed 4 years ago by dhaines@…

  • Cc dhaines@… added

Cc Me!

comment:6 in reply to: ↑ 3 Changed 4 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 follow-up: ↓ 8 Changed 4 years ago by jmr@…

Have you tested on Tiger, Leopard and Snow Leopard?

comment:8 in reply to: ↑ 7 ; follow-up: ↓ 9 Changed 4 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 4 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 4 years ago by jmr@…

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from MacPorts Future to MacPorts 1.9.0

comment:11 follow-up: ↓ 13 Changed 4 years ago by jmr@…

  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Milestone changed from MacPorts 1.9.0 to MacPorts Future

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

comment:12 Changed 3 years ago by ruud@…

  • Cc ruud@… added

Cc Me!

comment:13 in reply to: ↑ 11 ; follow-up: ↓ 14 Changed 3 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 ; follow-up: ↓ 15 Changed 3 years ago by jmr@…

Replying to dhaines@…:

In which situations did it break things?

Install without patch, apply patch, try deactivating.

comment:15 in reply to: ↑ 14 Changed 3 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 3 years ago by jmr@…

This is probably fixed in the sqlite registry.

comment:17 Changed 3 years ago by jmr@…

  • Milestone changed from MacPorts Future to MacPorts 1.9.0

comment:18 follow-up: ↓ 19 Changed 3 years ago by jmr@…

  • Status changed from reopened to closed
  • Resolution set to fixed

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

comment:19 in reply to: ↑ 18 ; follow-up: ↓ 20 Changed 3 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 3 years ago by raimue@…

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.