Jon Turney wrote: > Handle '--packages package=version' to allow specifing the version of a > package to install on the command line. > > isManuallyWanted() now returns the target packageversion (if specified), > or an empty packageversion (which is translated into an instruction to > the solver to choose the version). > > In the 'upgrade' case, this changes from using the complex logic of > packagemeta::trustp() to determine the target version, when unspecified > on the command line, to allowing the solver to make that decision (which > should be broadly the same i.e. not downgrading test versions, etc.). > > This also subtly changes the behaviour when the package version is not > specified. Instead of forcing the current version, we allow the solver > to choose the version, so it may not pick that version, if other > constraints exist, which prevent a solution containing that version. > > There's probably some future work which can be done to simplify the > remaining uses packagemeta::trustp(), which are only related to the UI.
<snip> This is really useful (tested locally for a couple of use-cases: one wanting a downgrade from latest and the other to manually specify a test version). Does libsolv give the ability to put more complex constraints? In opam, for example, I can issue `opam install 'utop<2.7.0' and get the last version before 2.7.0. `--packages mingw64-x86_64-binutils=2.35.2-1` is already very useful but `--packages mingw64-x86_64-binutils<2.36` is even more so. David