Opened 19 years ago

Closed 19 years ago

#4700 closed defect (fixed)

dependencies in dep_map.bz2 are broken after 'port upgrade <port>' and 'port -u uninstall'

Reported by: fabianwenk (Fabian Wenk) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 1.0
Keywords: Cc:
Port:

Description

This allows the uninstallation of Ports which are required by other Ports.

Just did an upgrade (and uninstall of the old version) of fortune (which depends on libcompat) from 4.6.2-RELEASE_4 to 4.6.2-RELEASE_5

root@flashback:~# port installed|grep fortune

fortune 4.6.2-RELEASE_4 fortune 4.6.2-RELEASE_5 (active)

root@flashback:~# port -u uninstall ---> Uninstalling fortune 4.6.2-RELEASE_4 ---> Uninstall is removing fortune from the port registry. root@flashback:~#

Afterwards fortune and libcompat where not recorded anymore in the /opt/local/var/db/dports/receipts/dep_map.bz2 file. Now it is possible to uninstall libcompat without any problem:

root@flashback:~# port deps fortune fortune has library dependencies on:

libcompat

root@flashback:~# port uninstall libcompat ---> Deactivating libcompat 4.6.2-RELEASE_0 ---> Uninstalling libcompat 4.6.2-RELEASE_0 ---> Uninstall is removing libcompat from the port registry. root@flashback:~# fortune dyld: fortune can't open library: /opt/local/lib/libcompat.1.dylib (No such file or directory, errno = 2) Trace/BPT trap root@flashback:~#

After reinstalling libcompat fortune was again working just fine, but the dependency is still not recorded in dep_map.bz2. After uninstalling and reinstalling fortune it is back in dep_map.bz2 and 'port uninstall libcompat' complains:

root@flashback:~# port uninstall libcompat ---> Unable to uninstall libcompat 4.6.2-RELEASE_0, the following ports depend on it: ---> fortune port uninstall failed: Please uninstall the ports that depend on libcompat first. root@flashback:~#

Saw the problem with some gtk2 application and dependencies just a few days ago when I had a problem with building gimp2 and solved it with rebuilding gtk2 (see http://bugzilla.opendarwin.org/show_bug.cgi?id=4041#c4). I also had gaim, gimp2 and xchat2 installed, which also depend on gtk2. But 'port uninstall gtk2' complained only about gaim. I uninstalled gaim and then could uninstall gtk2 without problem (knowing, that gtk2 is also need by the still running xchat2). Did clean and reinstall gtk2 and gaim.

This alerted me, that something is really wrong with the recorded dependencies so I searched around and found the dep_map.bz2 and saw in there, that the dependencies of xchat2 and gimp2 were missing. Did upgrade xchat2 and gimp2 a few weeks before, incl. 'port -u uninstall'.

I think when doing a uninstall of a Port which still has any other version installed, the step "---> Uninstall is removing fortune from the port registry." should not be done.

Don't know how hard it would be to fix this, but would probably help not to accidently remove Ports which are still needed by other Ports, because it doesn't warn when doing 'port uninstall ...'

Change History (2)

comment:1 Changed 19 years ago by pguyot (Paul Guyot)

Thanks for the report. I committed a temporary fix. A complete fix would consist in changing the dependency map format to include versions.

comment:2 Changed 19 years ago by pguyot (Paul Guyot)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.