openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
403 stars 110 forks source link

zypper repo priorities by default dont allow repo demotion #480

Closed Firstyear closed 1 year ago

Firstyear commented 1 year ago

By default zypper allows priorities 0 through 99, where 0 is the "highest" and 99 is the "lowest". By default all repos with no manually set priority are set to "99". This has the unfortunate side effect that when third party repos are added (like packman, obs) that they are on an equivalent step to the main/default repos from opensuse.

This has led to multiple situations in the community where content is supplied from repos like packman (ie mesa) which can break systems graphical displays. While the issue is the inclusion of third party and lower quality content, we can't stop users doing this.

What would be perfect is to have zypper change the default opensuse repos to be a prio of 50, but the issue is that because these have been set to 99 for so long, many users may have their systems broken if we suddenly change this to 50.

Instead I want to suggest that the range of priorities is expanded. Either from 0-199 or 0-100. This would allow the current repos and defaults to remain at 99, while still allowing at least some room to demote third party repos (rather than needing to promote all the main repos).

While not necessary, it could be considered that when repos are added their default is set to lower than the main repos, but that may be a seperate issue.

mlandres commented 1 year ago

Where do you see the priority being limited?

           -p, --priority positive-integer
               Set the priority of the repository. Priority of 1 is the highest, the higher the number the lower the
               priority. -p 0 will set the priority back to the default (99). Packages from repositories with higher
               priority will be preferred even in case there is a higher installable version available in the
               repository with a lower priority.

99 is the default, but you can use lower numbers:

# zypper mr --priority 100 CA
Repository 'CA' priority has been set to 100.
Firstyear commented 1 year ago

The docs say nothing about the range that exists. They imply strongly the range is 0-99. I think that you should clearly state the range in the docs since this is news to me and others.

mlandres commented 1 year ago

the higher the number the lower the priority. Technically [0,MAXINT] is the range.

mlandres commented 1 year ago

Which docs do you refer to? Something outside zypper?

Firstyear commented 1 year ago

man zypper. It doesn't state the priority range.

   -p, --priority positive-integer

Should be

   -p, --priority positive-integer
   -p, --priority [0-65536]
Set the priority of the repository. Priority of 1 is the highest, and X is the lowest.
mlandres commented 1 year ago

We can do this. Actually it's [0-2147483647].

Firstyear commented 1 year ago

Thanks, the man fixes are very useful :)