logging.info("...retrieving " + url)
of = "{0}_{1}.apk.binary".format(app['id'], thisbuild['vercode'])
of = os.path.join(output_dir, of)
- p = FDroidPopen(['wget', '-nv', '-O', of, url])
- if p.returncode != 0 or not os.path.exists(of):
- raise BuildException("...failed to retrieve " + url)
+ common.download_file(url, local_filename=of)
build_succeeded.append(app)
wikilog = "Build succeeded"
import re
import shutil
import glob
+import requests
import stat
import subprocess
import time
return True
except ValueError:
return False
+
+
+def download_file(url, local_filename=None, dldir='tmp'):
+ filename = url.split('/')[-1]
+ if local_filename is None:
+ local_filename = os.path.join(dldir, filename)
+ # the stream=True parameter keeps memory usage low
+ r = requests.get(url, stream=True)
+ with open(local_filename, 'wb') as f:
+ for chunk in r.iter_content(chunk_size=1024):
+ if chunk: # filter out keep-alive new chunks
+ f.write(chunk)
+ f.flush()
+ return local_filename
import logging
import common
-from common import FDroidPopen, FDroidException
+from common import FDroidException
options = None
config = None
os.remove(remoteapk)
url = 'https://f-droid.org/repo/' + apkfilename
logging.info("...retrieving " + url)
- p = FDroidPopen(['wget', '-nv', url], cwd=tmp_dir)
- if p.returncode != 0:
- raise FDroidException("Failed to get " + apkfilename)
+ common.download_file(url, dldir=tmp_dir)
compare_result = common.compare_apks(
os.path.join(unsigned_dir, apkfilename),
'apache-libcloud >= 0.14.1',
'pyasn1',
'pyasn1-modules',
+ 'requests',
],
classifiers=[
'Development Status :: 3 - Alpha',