Added a force_url option for packages that do not have nice URLs
This commit is contained in:
parent
03ee31e0e8
commit
c3b72c3d7c
@ -321,6 +321,9 @@ class SomePackage(Package):
|
|||||||
"""Controls whether install and uninstall check deps before running."""
|
"""Controls whether install and uninstall check deps before running."""
|
||||||
ignore_dependencies = False
|
ignore_dependencies = False
|
||||||
|
|
||||||
|
"""Dirty hack for forcing packages with uninterpretable URLs"""
|
||||||
|
force_url = False
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, spec):
|
def __init__(self, spec):
|
||||||
# These attributes are required for all packages.
|
# These attributes are required for all packages.
|
||||||
@ -552,11 +555,15 @@ def url_version(self, version):
|
|||||||
override this, e.g. for boost versions where you need to ensure that there
|
override this, e.g. for boost versions where you need to ensure that there
|
||||||
are _'s in the download URL.
|
are _'s in the download URL.
|
||||||
"""
|
"""
|
||||||
|
if self.force_url:
|
||||||
|
return self.default_version
|
||||||
return str(version)
|
return str(version)
|
||||||
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
"""Gives a URL that you can download a new version of this package from."""
|
"""Gives a URL that you can download a new version of this package from."""
|
||||||
|
if self.force_url:
|
||||||
|
return self.url
|
||||||
return url.substitute_version(self.__class__.url, self.url_version(version))
|
return url.substitute_version(self.__class__.url, self.url_version(version))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user