Opened 13 years ago

Closed 11 years ago

#15260 closed enhancement (fixed)

RFE: track which ports were installed explicitly

Reported by: jmroot (Joshua Root) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.9.0
Component: base Version:
Keywords: Cc: kngspook@…, ryandesign (Ryan Schmidt), mcklaren@…, raimue (Rainer Müller), brett@…, antony.stubbs@…, macports@…, eallik@…, Mathias.Laurin+macports@…, jinn.koriech@…
Port:

Description

Keeping track of which ports the user explicitly asked to be installed, as opposed to those installed only to fulfil dependencies, would be quite useful. It would be analogous to Gentoo's 'world'. With this information, we could do things like uninstall all the ports that are no longer required after uninstalling some other port.

It shouldn't be hard to store the information by adding a magic port name to the dep_map which depends on all the explicitly-installed ports. We'd then need code to figure out during install whether the port was explicitly asked for, and add the dep_map entry. We'd also need to change the dependents check in uninstall to not complain if the only dependent is the magic 'world' port.

Change History (23)

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

Component: portsbase

comment:2 Changed 12 years ago by mcklaren@…

If this option or request in ticket #16298 i think that next version 1.7.0 should be add any option for remove dependencies or similar option as for example a inactive unused dependencies then if i install with sudo port install foo and this install too the dependencies B,C. A option that when i uninstall with sudo port uninstall foo this automaticlly deactive the unused dependencies, then we can uninstall with a sudo port -u uninstall. I think that is a very good option for macport, IMHO.

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

Milestone: MacPorts base enhancementsMacPorts 1.8.0

Too late for 1.7 I'm afraid.

comment:4 Changed 12 years ago by mcklaren@…

I think that is a important option then you will can to MacPorts 1.7.1

comment:5 in reply to:  4 Changed 12 years ago by mcklaren@…

Replying to mcklaren@…:

I think that is a important option then you will can change to MacPorts 1.7.1

Error to the write.

comment:6 Changed 12 years ago by kngspook@…

Cc: kngspook@… added

Cc Me!

comment:7 Changed 12 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added

Doesn't CPAN have a thing where it will just ask you? When you uninstall X, and if it depends on Y, and nothing else depends on Y, it will ask if you want to uninstall Y as well. Of course, that would again be an interactive thing, and MacPorts isn't (and IMHO shouldn't be) interactive. Well, except in interactive mode. But it could perhaps print a message "The following ports may no longer be needed; consider uninstalling them" and then the list of ports.

comment:8 Changed 12 years ago by mcklaren@…

Cc: mcklaren@… added

Cc Me!

comment:9 Changed 12 years ago by mcklaren@…

I think that is a good features the interactive option because we can have a clean system of unused dependencies, i'd like see this option in 1.7.0 or 1.7.1 version :P, Thank you by your job.

comment:10 Changed 12 years ago by ryandesign (Ryan Schmidt)

It certainly won't be in 1.7.0 since that's practically ready to be released, and we already have a year's worth of mostly well-tested features and bugfixes in it already. For this new feature, OTOH, we haven't even fully explored how it would work from a user perspective, much less what would need to be changed in the code to make it so. And since it's a new feature, it should go into 1.8.0 at the earliest, and not into 1.7.x which would only be bugfixes for 1.7.0.

I have a strong aversion to adding interactive features to MacPorts. Right now, if you type just "port", you get interactivity, and if you type "port <something>", you are guaranteed to not get interactivity. I like that guarantee a lot; it means I can control MacPorts from a script and be sure it won't hang while MacPorts is waiting for some input.

Perhaps I should be controlling MacPorts via the framework/API instead of by calling the "port" command directly. But that's another aspect that must be considered when adding a new feature like this: not only how will it be made available in the "port" command (will it interactively ask you if you want to remove things? or will it just print a message telling you what might be removable? or will there just be a new command (perhaps "port list unused") showing you what you might uninstall?), but also how will it be made available in the API.

comment:11 Changed 12 years ago by raimue (Rainer Müller)

I would tend to create a new pseudo-port "orphaned" which would expand to all implicitly installed ports without dependents. So you can uninstall them using sudo port uninstall orphaned and we could also add a switch to uninstall/upgrade to remove them automatically.

comment:12 in reply to:  11 Changed 12 years ago by mcklaren@…

Replying to raimue@…:

I would tend to create a new pseudo-port "orphaned" which would expand to all implicitly installed ports without dependents. So you can uninstall them using sudo port uninstall orphaned and we could also add a switch to uninstall/upgrade to remove them automatically.

Is it possible see this option in svn version soon ? or we have wait to 1.8.0 version. Because if in svn version is add then i install svn version for tester. Thank you.

comment:13 Changed 12 years ago by ryandesign (Ryan Schmidt)

@mcklaren: I wouldn't expect to see this feature too soon, since we're still discussing how it should work.

@all: I'd like to take the discussion of this feature to the macports-dev mailing list, so please respond there. Once a consensus is reached on how it should work, a summary can be added here. The issue tracker is just not a great place to have a discussion.

comment:14 Changed 12 years ago by raimue (Rainer Müller)

Cc: raimue@… added

Cc Me!

comment:15 Changed 12 years ago by brett@…

Cc: brett@… added

Cc Me!

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

Milestone: MacPorts 1.8.0MacPorts 1.9.0

comment:17 Changed 12 years ago by antony.stubbs@…

Cc: antony.stubbs@… added

Cc Me!

comment:18 Changed 11 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:19 Changed 11 years ago by eallik@…

Cc: eallik@… added

Cc Me!

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

Information added to the registry in r64517. Not doing anything with it yet.

comment:21 Changed 11 years ago by Mathias.Laurin+macports@…

Cc: Mathias.Laurin+macports@… added

Cc Me!

comment:22 Changed 11 years ago by jinn.koriech@…

Cc: jinn.koriech@… added

Cc Me!

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

Resolution: fixed
Status: newclosed

Preservation of requested flag across upgrades added in r64663, requested/unrequested pseudo-ports and setrequested/unsetrequested actions added in r65546, leaves pseudo-port added in r66037, documentation added in r66200, --follow-dependencies option for uninstall added in r66215.

Note: See TracTickets for help on using tickets.