From 411d216d8f978fb306dd3913a1967eac6e77ab11 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 23 Dec 2018 21:07:30 -0800 Subject: [PATCH] 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. --- .gitignore | 2 ++ download-xflux.py | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) mode change 100644 => 100755 download-xflux.py diff --git a/.gitignore b/.gitignore index 459d696..fe21c97 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ dist/ build/ /xflux /installed.txt +/xflux11 +/xflux12 diff --git a/download-xflux.py b/download-xflux.py old mode 100644 new mode 100755 index acc5674..5796b76 --- a/download-xflux.py +++ b/download-xflux.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from sys import maxsize import subprocess @@ -5,15 +7,20 @@ # 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()