[PATCH setup] Handle '--packages package=version'

Jon Turney jon.turney@dronecode.org.uk
Tue Apr 20 20:30:26 GMT 2021


On 20/04/2021 15:35, David Allsopp via Cygwin-apps wrote:

> 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).

Thanks for testing.

> 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.
Yes, I think so.  But more plumbing would be required to connect that up.



More information about the Cygwin-apps mailing list