mirror of https://github.com/docker/docker-py.git
Merge pull request #2298 from ijc/fix-docker-version-detection-script
scripts/version.py: Use regex grouping to extract the version
This commit is contained in:
commit
f97c577c1d
|
|
@ -62,13 +62,9 @@ def main():
|
||||||
for url in [base_url.format(cat) for cat in categories]:
|
for url in [base_url.format(cat) for cat in categories]:
|
||||||
res = requests.get(url)
|
res = requests.get(url)
|
||||||
content = res.text
|
content = res.text
|
||||||
versions = [
|
versions = [Version.parse(v) for v in re.findall(
|
||||||
Version.parse(
|
r'"docker-([0-9]+\.[0-9]+\.[0-9]+)-?.*tgz"', content
|
||||||
v.strip('"').lstrip('docker-').rstrip('.tgz').rstrip('-x86_64')
|
)]
|
||||||
) for v in re.findall(
|
|
||||||
r'"docker-[0-9]+\.[0-9]+\.[0-9]+-?.*tgz"', content
|
|
||||||
)
|
|
||||||
]
|
|
||||||
sorted_versions = sorted(
|
sorted_versions = sorted(
|
||||||
versions, reverse=True, key=operator.attrgetter('order')
|
versions, reverse=True, key=operator.attrgetter('order')
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue