Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add bucket sorting (order) #5131

Open
leni8ec opened this issue Aug 31, 2022 · 8 comments
Open

[Feature] Add bucket sorting (order) #5131

leni8ec opened this issue Aug 31, 2022 · 8 comments

Comments

@leni8ec
Copy link

leni8ec commented Aug 31, 2022

Is it possible to use manual bucket sorting for getting information and installing packages?

If the same application is available in several packages, scoop will use this sorting to determine the "priority" bucket (now alphabetical sorting is used instead).

This is useful when using several buckets (I use about 10), and need to install some package whose name I know, but do not want to figure out which bucket it is available in. But I want to install it by priority from certain buckets.
image

Use bucket order for comands:

  • info, install, search results, depends, download, cat.

Example

1. Current version

$> scoop search scoop-completion
Name             Version Source    Binaries
----             ------- ------    --------
scoop-completion 0.2.3   dev-tools
scoop-completion 0.2.3   dodorz
scoop-completion 0.2.3   extras
scoop-completion 0.2.3   naderi

$> scoop install scoop-completion
Installing 'scoop-completion' from dev-tools bucket

2. Set order

Buckets:

1. main
2. extras
3. dodorz
4. naderi
5. dev-tools

3. Result

$> scoop search scoop-completion
Name             Version Source    Binaries
----             ------- ------    --------
scoop-completion 0.2.3   extras
scoop-completion 0.2.3   dodorz
scoop-completion 0.2.3   naderi
scoop-completion 0.2.3   dev-tools

$> scoop install scoop-completion
Installing 'scoop-completion' from extras bucket

Solution suggestions

Variant 1: Use bucket sorting list

I assume that this option is easier to implement

Sorting is used for all buckets, new buckets are added to the end.
We can specify a specific order in the list for each bucket

Variant 2: Use the 'order' parameter

We can prioritize only the buckets we want - the others will be used alphabetically the way they are prioritized by default.
Each bucket will have an "order" parameter.

@HUMORCE
Copy link
Member

HUMORCE commented Sep 5, 2022

yes and I think the official bucket should have a higher weighting (by default)

the another side,

scoop bucket add 1-main <repo>
scoop bucket add 2-extras <repo>
scoop bucket add 3-foo <repo>

@chawyehsu
Copy link
Member

scoop bucket add 1-main <repo>
scoop bucket add 2-extras <repo>
scoop bucket add 3-foo <repo>

This is not recommended. It would break dependencies prefixed with bucket names. e.g.

"depends": "extras/vscode"

@rashil2000
Copy link
Member

I feel the best compromise would be to search buckets in the order they are added by user. In this case Main bucket will always be first as it is added by default, and the rest of the bucket order can be left to the user.

@HUMORCE
Copy link
Member

HUMORCE commented Sep 8, 2022

It would break dependencies prefixed with bucket names.

just a dirty method, I use it for sort personal bucket first to avoid declaring the bucket name in executing commands only. so, we need this feature.

@moltenform
Copy link

I'm thinking about the case where the user types scoop install x, and there are several buckets that provide a package named x. Instead of getting the first match, maybe we could show a list of potential matches and let the user select which one, before continuing.

@NamelessUzer
Copy link

I'm thinking about the case where the user types scoop install x, and there are several buckets that provide a package named x. Instead of getting the first match, maybe we could show a list of potential matches and let the user select which one, before continuing.

Users may add buckets other than "main" and "extras", and these buckets may include the same software (the version may or may not be the same).

@leni8ec
Copy link
Author

leni8ec commented Mar 20, 2023

It's cool that official repositories will now have priority.

But the original idea was to be able to change the priority by yourself.

Perhaps this request should be left open, for the future?

@niheaven
Copy link
Member

Yes, will not be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants