[MacPorts] #46229: Uninstalling all active ports - are you sure?
MacPorts
noreply at macports.org
Sun Aug 20 01:54:41 UTC 2023
#46229: Uninstalling all active ports - are you sure?
--------------------------+--------------------------
Reporter: stuchalk | Owner: umeshksingla
Type: enhancement | Status: assigned
Priority: Normal | Milestone:
Component: base | Version: 2.3.3
Resolution: | Keywords:
Port: |
--------------------------+--------------------------
Changes (by ryandesign):
* cc: bitaxis (added)
Comment:
Do you have a suggestion of how to do it? I imagine there are very few
people who know MacPorts base well enough to be able to do it. And there
are several questions about exactly how this feature should behave.
One problem is that "active" is one of several "pseudo-ports" which expand
to a list of ports. I imagine MacPorts base has a procedure that performs
this expansion. And then there are other procedures that perform the
individual commands like install or uninstall. But the commands like
install and uninstall never see that you had typed "active"; they just see
the expanded list of ports. It's analogous to wishing there were a warning
when you type `rm *` in the shell. `rm` can't give you that warning
because `rm` never sees that you typed `*`; it only sees the list of items
that the shell expanded `*` to. The shell could give you a warning anytime
you typed `*` for any command but that would get tedious in interactive
use and would break shell scripts.
Ports and pseudo-ports and other selectors can be combined at will. You
can ask MacPorts to do something with ports that are `active and not
outdated` or `inactive and name:^lib` or `outdated and
maintainer:ryandesign`. Do you want this warning only when the `active`
pseudo-port is used by itself or anytime it is used as part of a selection
criteria? Is `active` the only pseudo-port for which you want this
treatment? Does it only apply to the uninstall command or also to others?
One option to implement it could be that we need to keep track of which
pseudo-ports were used and make that available to the commands so they can
show the warning based on that. Another possibility would be to make the
warning appear not based on pseudo-ports but instead based on how many
ports the command would act—so it could warn if you're trying to uninstall
100 ports, say, regardless whether those 100 ports were specified
individually or via some pseudo-port expansion.
--
Ticket URL: <https://trac.macports.org/ticket/46229#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list