Open Ashcora opened 4 months ago
Are you familiar with the "Pin" command? I'd like to understand the scenario where the feature suggested wouldn't be achieved by using pinning.
Verification, see below.
Translated it means:
PS C:\Users\tobia> winget pin add --id Discord.Discord Found Discord [Discord.Discord] A PIN already exists for the Discord package. PS C:\Users\tobia> winget pin add --id nomic.gpt4all Found GPT4All [nomic.gpt4all] PIN successfully added
By adding "--force" you are telling WinGet to "ignore" the pin.
Is there a way to force pending installations while excluding specific packages I don’t want to be considered? Sometimes packages need to be updated using the ‘force’ command, but even the pinned ones should be excluded based on our current understanding
But in fact, your proposed adaption works to ignore the pinned ones.
You can run winget upgrade
to see which packages have upgrades available, then you can pass the Id's for the ones you want upgraded to the upgrade command.
winget upgrade <package id 1> <package id 2>
I like the idea for upgrade --all
. I used to use --exclude
in Portage all the time back when I used Gentoo.
Scenarios where this would be useful but pinning would be awkward:
SomeApp
and I don't want it to close on me when the update starts.SomeApp
takes a long time to update - maybe the installer is several GBs in size and my network is slow. Today I have something to do soon, and I know I'd have to cancel the update midway through if it starts, but I would still like to update everything else.In these cases I could do winget upgrade --all --exclude SomeApp
as a one time thing. I could do it with pinning, but since I just want it one time, I would have to add the pin and then remove it later.
Another valid case for this is when there is a separate paid/free version. i.e. MobaXterm (Mobatek.MobaXterm
)
winget upgrade --all --force
will "upgrade" MobaXterm to the free version of the application even if the paid version is installed, because the free version is what's available in the winget repository.
By adding "--force" you are telling WinGet to "ignore" the pin.
This isn't present in the winget-cli help for either pin
or upgrade
... Yes, it's present in the online documentation for pin
, but it's not self-evident. Other similar systems (apt
, etc.) don't override pin
s, so it feels counterintuitive.
If the program is reporting its version wrongly pin can be awkward.
Example: Program A is reporting version 1.1.1, when it is actually 1.1.1.123456.
This makes every single winget upgrade --all
to reinstall the patch 123456, since 1.1.1.123456 is bigger than flat 1.1.1.
Pinning 1.1.1 down would prevent a future 1.1.1.23456 patch to be installed through winget upgrade --all
so it can be awkward to track.
Having an --exclude tag could make this easier, so that you could run something like winget upgrade --all --exclude --id Awkward.App --version 1.1.1.123456
wich would not reinstall it every single time, but also allow for the novel 234567 patch to be installed as soon as it is released. If the problem then persists, instead of needing a new pin, you only have to change the --version tag from your upgrade command.
Are you familiar with the "Pin" command? I'd like to understand the scenario where the feature suggested wouldn't be achieved by using pinning.
I tried by adding a pin using winget pin add
but now winget upgrade --all
does not upgrade the packages that are not pinned:
I'm a PhD in law. Exclude is a perspective. Pin is usable. We think of this differently. The exclude I think of is a pinned malfunctioning 'winget upgrade --all' due to malicious version reporting from driver easy. God might be mighty against them.
Description of the new feature / enhancement
The --exclude option is designed to provide users with more control over their command line operations. This feature allows users to specify a list of IDs that should be excluded from the operation. This is particularly useful in scenarios where the user wants to apply an operation to a large set of items but needs to exclude a few specific ones.
For example, if a user is performing a bulk delete operation but wants to preserve certain items, they could use the --exclude ids option to specify the IDs of the items to be preserved. This saves the user from having to manually separate these items before performing the operation.
Proposed technical implementation details
The --exclude option could be implemented as a command line argument that accepts a list of IDs. These IDs would then be used to filter out the corresponding items from the operation. The key point is that the --exclude ids option provides a way for users to specify a list of IDs to be excluded from the operation, and this list is then used to filter out the corresponding items before the operation is performed.