Opened 20 years ago

Closed 20 years ago

Last modified 9 years ago

#2665 closed defect (fixed)

Forgetting sudo breaks 'port uninstall'

Reported by: cssdev@… Owned by: rshaw@…
Priority: Normal Milestone:
Component: base Version: 1.0
Keywords: Cc:
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I have a nasty habit of forgetting to sudo when uninstalling. This leads to problems, as I am then unable to uninstall the package. For example, I updated gsl and wanted to get rid of the old version:

[css@vectorsigma:/Users/Shared/darwinports]$ port uninstall gsl 1.5_0
--->  Uninstalling gsl 1.5_0
port uninstall failed: error deleting "/opt/local/var/db/dports/software/gsl/1.5_0/opt/local/share/
aclocal/gsl.m4": permission denied

Oops, I forgot the sudo again. After I added it, port complained that it could not find the required files:

[css@vectorsigma:/Users/Shared/darwinports]$ sudo port uninstall gsl 1.5_0
--->  Uninstalling gsl 1.5_0
port uninstall failed: could not read "/opt/local/var/db/dports/software/gsl/1.5_0/opt/local/share/
man/man3": no such file or directory

Using port -d uninstall, it looks like uninstall removes files from /opt/local/var/db/dports/software without requiring admin authority. The uninstall stops when it lacks permission for removing files in /opt/local/share. When the second uninstall runs, it fails to find any files in /opt/local/var/db/dports/ software, so it fails. Perhaps the installer isn't securing proper permissions for the staging directory? In any case, it seems that forgetting to add the sudo shouldn't restrict future uninstalls.

Change History (4)

comment:1 Changed 20 years ago by rshaw@…

Owner: changed from darwinports-bugs@… to rshaw@…

I'll take a look at this. At a minimum, it should just keep uninstalling files even if they are already gone, and not error out. -rshaw

comment:2 Changed 20 years ago by rshaw@…

Status: newassigned

comment:3 Changed 20 years ago by rshaw@…

Resolution: fixed
Status: assignedclosed

I've committed a fix to uninstall so that it properly skips files that it cannot find (that have already been removed). Thanks for reporting this! -rshaw

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Component: deprecatedbase
Description: modified (diff)
Note: See TracTickets for help on using tickets.