-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-detect image magick latest 6.9.X-Y version (#936)
* Auto-detect image magick version * Fix version detection
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from urllib import request | ||
import re | ||
|
||
url = "https://legacy.imagemagick.org/script/index.php" | ||
|
||
'''This little script parses url above to extract latest image magick version | ||
(major version 6.9), to feed it into CI system. Not the best way for reproducible | ||
builds, but it's preferred for now over storing imagemagick installer into the | ||
git repository | ||
''' | ||
|
||
response = request.urlopen(url) | ||
html = response.read().decode('utf-8') | ||
r = re.compile("6\.9\.[0-9]+\-[0-9]+") | ||
version = r.findall(html) | ||
if len(version) == 0: | ||
raise ValueError("Could not find latest legacy 6.9.X-Y ImageMagick version from {}".format(url)) | ||
version = version[0] | ||
# Append Q16 build | ||
version += '-Q16' | ||
print(version) |