Opened 19 years ago
Closed 16 years ago
#8763 closed defect (fixed)
duplicate entries in dependency list
Reported by: | agentmonkey@… | Owned by: | jmroot (Joshua Root) |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 1.7.0 |
Component: | base | Version: | |
Keywords: | Cc: | nox@…, ryandesign (Ryan Carsten Schmidt) | |
Port: |
Description (last modified by jmpalacios (Juan Manuel Palacios))
After going through a few upgrades via "port -a upgrade" I noticed that the upgrades only deactivated older versions of packages. After uninstalling the inactive ports manually (I needed to use -f since inactive ports can still have dependents) I noticed that their entries in the "dependency list" are not removed. For example:
~ $ sudo port installed | grep apr apr @1.2.6_0 (active) apr-util @1.2.6_0 (active) -= rom@leviathan =- Sun May 07, 02:00 AM ~ $
then,
-= rom@leviathan =- Sun May 07, 02:00 AM ~ $ sudo port uninstall apr Password: ---> Unable to uninstall apr 1.2.6_0, the following ports depend on it: ---> apr-util ---> apr-util ---> apr-util ---> subversion ---> subversion-javahlbindings Error: /opt/local/bin/port: port uninstall failed: Please uninstall the ports that depend on apr first. -= rom@leviathan =- Sun May 07, 02:16 AM ~ $
Notice that apr-util appears three times but in the former command only one apr-util package is shown to be installed (apr-util @1.2.6_0). These "residual" packages are from previous inactive versions (because of upgrades) that were manually uninstalled.
Attachments (3)
Change History (25)
comment:1 Changed 18 years ago by markd@…
Summary: | port uninstall package does not remove entry in dependency list. → BUG: 'port uninstall' does not remove entry in dependency list. |
---|
comment:2 Changed 18 years ago by pipping@…
Milestone: | → Port Bugs |
---|
comment:3 Changed 18 years ago by pipping@…
Milestone: | Port Bugs → MacPorts 1.4 |
---|
comment:4 Changed 18 years ago by jmpalacios (Juan Manuel Palacios)
Description: | modified (diff) |
---|
comment:5 Changed 18 years ago by jmpalacios (Juan Manuel Palacios)
Milestone: | MacPorts 1.4 → Needs developer review |
---|---|
Owner: | changed from macports-tickets@… to macports-dev@… |
comment:6 Changed 18 years ago by kballard (Lily Ballard)
The duplicates are definitely in the dep_map. I just checked my own dep_map file on disk and it has duplicates right in there. I can't vouch for the source of the duplicates, but upgrade seems to be a reasonable assumption.
comment:7 Changed 18 years ago by kballard (Lily Ballard)
Ah hah, I've reproduced this issue.
- Install port1 and port2, where port2 depends on port1
- Upgrade your dports tree such that a new version of port2 is available
- Deactivate port2 and install the new version. The default
port upgrade
behaviour does exactly this.
Now the dep_map contains two entries for port2 depending on port1. At this point, uninstalling port2 does not change the dep map, leaving behind two entries.
Uninstalling all copies of port2 will clean up the dep map, but as long as you have one version of port2 installed at all times, the duplicates will occur.
comment:8 Changed 18 years ago by kballard (Lily Ballard)
D'oh, wiki formatting lied to me. I needed a space before the list items.
- Install port1 and port2, where port2 depends on port1
- Upgrade your dports tree such that a new version of port2 is available
- Deactivate port2 and install the new version. The default port upgrade behaviour does exactly this.
comment:9 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)
Milestone: | Needs developer review → MacPorts base bugs |
---|
Milestone Needs developer review deleted
comment:10 Changed 17 years ago by nox@…
Priority: | Expected → Normal |
---|---|
Version: | 1.2 |
Is this still relevant?
comment:11 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | agentmonkey@… ryandesign@… added |
---|
comment:12 Changed 17 years ago by nox@…
Cc: | nox@… added |
---|---|
Summary: | BUG: 'port uninstall' does not remove entry in dependency list. → 'port uninstall' does not remove entry in dependency list. |
comment:13 Changed 17 years ago by jmroot (Joshua Root)
Cc: | jmr@… added; agentmonkey@… removed |
---|
The bit of code that is causing this problem is here. The issue is that at that point you don't know which of the multiple versions of the port actually needed a given dependency (since dependencies can change between versions), and hence you don't know whether you can remove the dep map entry.
It would be possible to just trim the supernumerary entries from the dep map, but that would still leave you with spurious entries in cases where dependencies have been dropped from the new port version.
Maybe upgrade should clear the dep map entries for the old version before installing the new version?
comment:14 Changed 17 years ago by jmroot (Joshua Root)
Milestone: | MacPorts base bugs → MacPorts 1.6.1 |
---|
Let's just prevent duplicate dep map entries being inserted in the first place. Attached patch implements this. We can make a tool to trim existing duplicates as well if we decide it's too inconvenient for users to remove them by uninstall + reinstall.
Nominating for the upcoming release.
comment:15 Changed 17 years ago by raimue (Rainer Müller)
Things like this should become faster with registry2.0, so just fix it in this slow way for now.
comment:16 Changed 17 years ago by jmroot (Joshua Root)
Summary: | 'port uninstall' does not remove entry in dependency list. → duplicate entries in dependency list |
---|
Committed the patch to trunk in r36745. I'll see about adding a command to clean out existing duplicates.
Changed 16 years ago by jmroot (Joshua Root)
Attachment: | regclean.diff added |
---|
add the 'regclean' target
comment:17 Changed 16 years ago by jmroot (Joshua Root)
Cc: | jmr@… removed |
---|---|
Owner: | changed from macports-tickets@… to jmr@… |
Status: | new → assigned |
Attached a new patch which adds a 'regclean' target. This will remove all duplicate entries from the dep_map. It appears to do the right thing for me without breaking anything, but back up your dep_map.bz2 just in case. ;-)
comment:18 Changed 16 years ago by raimue (Rainer Müller)
Hm, do we really need a new action for this? I mean, this is a one time issue only. We could as well release some extra script which cleans the registry and only needs to be run one time (announced in the release notes). Or we add this script to postflight/make install in the next release to do it automatically. With the next release this will not happen anymore, so I don't see a reason for a new action.
comment:19 Changed 16 years ago by jmroot (Joshua Root)
Sure, an action isn't necessary if we're going to run the code in postflight and selfupdate. But it's quite convenient for testing purposes. :-)
comment:20 Changed 16 years ago by jmroot (Joshua Root)
Committed the clean_dep_map registry procedure in r39116.
Changed 16 years ago by jmroot (Joshua Root)
Attachment: | portdepclean.tcl added |
---|
a simple script to run clean_dep_map
comment:21 Changed 16 years ago by jmroot (Joshua Root)
Added a working version of the cleanup script to postflight and make install in r40142. Now all that is needed is for the MacPorts port to be updated to include the script in the .dmg resources.
comment:22 Changed 16 years ago by raimue (Rainer Müller)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Marking fixed.
I'm not entirely sure the repeated entries in that dependents list is due to leftovers in the dependency list (dep_map), could very well be in the port(1) code that builds the list and echo's it to the user. But I'm sure developer review instead of wild guesses would best serve toward fixing this issue, therefore setting this ticket to that milestone ;-)
-jmpp