Installing a fixed version of a packages does not seem to work as described in the documentation
Closed this issue · 2 comments
The documentation claims:
If string is the name of the package in question then one can specify a required package version via a string as value of the optional argument version, which is interpreted as described in Section Reference: Version Numbers. In particular, if version starts with = then the function will try to install exactly the given version [...] If the package is not yet installed or if no installed version satisfies the version condition then an upgrade is tried only if the package version that is listed on the GAP webpages satisfies the condition.
Yet if I try to install a fixed version like this:
gap> InstallPackage( "digraphs", "=1.5.2" );
the most recent version seems to be installed:
#I Getting PackageInfo URLs...
#I Retrieving PackageInfo.g from https://digraphs.github.io/Digraphs/PackageInfo.g ...
#I Downloading archive from URL https://github.com/digraphs/Digraphs/releases/download/v1.6.1/digraphs-1.6.1.tar.gz ...
[...]
Am I misreading the documentation or is this a bug?
Hi Fabian!
The key section of the documentation is:
the function will try to install exactly the given version, and otherwise it will try to install a version that is not smaller than the given one.
In your case, you specified a version to which PackageManager doesn't currently have access, so although it "tried" to install that version, it instead installed a version not smaller than it, i.e. 1.6.1. In this way the behaviour is as described in the doc.
It'd be good if the package manager had access to a broader range of package versions so that this sort of thing was successful more often. At the moment there are few situations where it has access to any versions but the latest. Improving this might be part of #112.
Thanks for the fast reply!
I think the "otherwise ... not smaller" you are quoting from the documentation refers to the case that NO equality sign is given, right?
In particular, if version starts with = then the function will try to install exactly the given version, and otherwise it will try to install a version that is not smaller than the given one.
And then it says (emphasis mine):
If the package is not yet installed or if no installed version satisfies the version condition then an upgrade is tried only if the package version that is listed on the GAP webpages satisfies the condition.
I'm interpreting "upgrade" as "install" in the case that the package is not yet installed. So I read this as "no installation is attempted if the required version cannot be found on the GAP webpage."
But since you say the behavior I am seeing is a known issue, I will close this issue. (It turned out that downgrading Digraphs wasn't a solution for my original application anyway :D )