-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download all versions of the xflux binary
To make it easier to test if you're experiencing the dreaded Issue #27. And make the magic numbers less magic.
- Loading branch information
Showing
2 changed files
with
16 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ dist/ | |
build/ | ||
/xflux | ||
/installed.txt | ||
/xflux11 | ||
/xflux12 |
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 |
---|---|---|
@@ -1,19 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from sys import maxsize | ||
import subprocess | ||
|
||
# There is similar code in ./debian/postinst. If you are changing this | ||
# you probably want to change that too. | ||
def download_xflux(): | ||
# Determines which is the appropriate executable for 32-bit | ||
if maxsize == 2147483647: | ||
if maxsize == 2**31 - 1: | ||
print("Downloading 32-bit xflux ...") | ||
url = "https://justgetflux.com/linux/xflux-pre.tgz" | ||
elif maxsize == 9223372036854775807: | ||
urls = ["https://justgetflux.com/linux/xflux-pre.tgz"] | ||
elif maxsize == 2**63 - 1: | ||
print("Downloading 64-bit xflux ...") | ||
url = "https://justgetflux.com/linux/xflux64.tgz" | ||
tarchive = "/tmp/xflux.tgz" | ||
subprocess.call(['wget', url, '-O', tarchive]) | ||
subprocess.call(['tar', '-xvf', tarchive]) | ||
urls = ["https://justgetflux.com/linux/xflux64.tgz", | ||
"https://justgetflux.com/linux/xflux11.tgz", | ||
"https://justgetflux.com/linux/xflux12.tgz"] | ||
else: | ||
raise Exception("Unexpected maxsize = %i!" % maxsize) | ||
for url in urls: | ||
tarchive = "/tmp/xflux.tgz" | ||
subprocess.call(['wget', url, '-O', tarchive]) | ||
subprocess.call(['tar', '-xvf', tarchive]) | ||
|
||
if __name__ == '__main__': | ||
download_xflux() |