summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-07-15 17:45:15 +0200
committerGitHub <noreply@github.com>2024-07-15 17:45:15 +0200
commitbb954390ecea804da7079241ffb4e8dc3089dd57 (patch)
tree7667b85d634acb70889e28a52e8e2eb3ed7af424 /var
parentbf9b6940c9622f729802a8631ead6985248f4fd0 (diff)
downloadspack-bb954390ecea804da7079241ffb4e8dc3089dd57.tar.gz
spack-bb954390ecea804da7079241ffb4e8dc3089dd57.tar.bz2
spack-bb954390ecea804da7079241ffb4e8dc3089dd57.tar.xz
spack-bb954390ecea804da7079241ffb4e8dc3089dd57.zip
sqlite: fix url_for_version (#45228)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/sqlite/package.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/sqlite/package.py b/var/spack/repos/builtin/packages/sqlite/package.py
index 4dd755c0b2..8509bd4083 100644
--- a/var/spack/repos/builtin/packages/sqlite/package.py
+++ b/var/spack/repos/builtin/packages/sqlite/package.py
@@ -178,11 +178,13 @@ class Sqlite(AutotoolsPackage, NMakePackage):
return all_variants
def url_for_version(self, version):
- full_version = list(version.version) + [0 * (4 - len(version.version))]
- version_string = str(full_version[0]) + "".join(["%02d" % v for v in full_version[1:]])
+ if len(version) < 3:
+ raise ValueError(f"Unsupported sqlite version: {version}")
# See https://www.sqlite.org/chronology.html for version -> year
# correspondence.
- if version >= Version("3.41.0"):
+ if version >= Version("3.45.0"):
+ year = "2024"
+ elif version >= Version("3.41.0"):
year = "2023"
elif version >= Version("3.37.2"):
year = "2022"
@@ -205,8 +207,8 @@ class Sqlite(AutotoolsPackage, NMakePackage):
elif version >= Version("3.7.16"):
year = "2013"
else:
- raise ValueError("Unsupported version {0}".format(version))
- return "https://www.sqlite.org/{0}/sqlite-autoconf-{1}.tar.gz".format(year, version_string)
+ raise ValueError(f"Unsupported sqlite version {version}")
+ return f"https://www.sqlite.org/{year}/sqlite-autoconf-{version[0]}{version[1]:02}{version[2]:02}00.tar.gz"
@property
def libs(self):