[pypy-commit] pypy default: merge heads

antocuni pypy.commits at gmail.com
Tue Feb 28 17:11:09 EST 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r90433:fdae6b92de2f
Date: 2017-02-28 23:10 +0100
http://bitbucket.org/pypy/pypy/changeset/fdae6b92de2f/

Log:	merge heads

diff --git a/pypy/goal/getnightly.py b/pypy/goal/getnightly.py
--- a/pypy/goal/getnightly.py
+++ b/pypy/goal/getnightly.py
@@ -4,16 +4,24 @@
 import os
 import py
 
+TAR_OPTIONS = '-x -v --strip-components=2'
+TAR = 'tar {options} -f {tarfile} {files}'
+
+def untar(tarfile, files):
+    cmd = TAR.format(options=TAR_OPTIONS, tarfile=tarfile, files=files)
+    os.system(cmd)
+
 if sys.platform.startswith('linux'):
     arch = 'linux'
     cmd = 'wget "%s"'
-    tar = "tar -x -v --wildcards --strip-components=2 -f %s '*/bin/pypy' '*/bin/libpypy-c.so'"
+    TAR_OPTIONS += ' --wildcards'
+    binfiles = "'*/bin/pypy' '*/bin/libpypy-c.so'"
     if os.uname()[-1].startswith('arm'):
         arch += '-armhf-raspbian'
 elif sys.platform.startswith('darwin'):
     arch = 'osx'
     cmd = 'curl -O "%s"'
-    tar = "tar -x -v --strip-components=2 -f %s '*/bin/pypy'"
+    binfiles = "'*/bin/pypy'"
 else:
     print 'Cannot determine the platform, please update this script'
     sys.exit(1)
@@ -34,6 +42,7 @@
 filename = 'pypy-c-%s-latest-%s.tar.bz2' % (kind, arch)
 url = 'http://buildbot.pypy.org/nightly/%s/%s' % (branch, filename)
 tmp = py.path.local.mkdtemp()
+pypy_latest = tmp.join(filename)
 mydir = tmp.chdir()
 print 'Downloading pypy to', tmp
 if os.system(cmd % url) != 0:
@@ -41,4 +50,10 @@
 
 print 'Extracting pypy binary'
 mydir.chdir()
-os.system(tar % tmp.join(filename))
+untar(pypy_latest, binfiles)
+include_dir = py.path.local('../../include')
+if include_dir.check(dir=True):
+    include_dir.chdir()
+    untar(pypy_latest, '*/include/*')
+else:
+    print 'WARNING: could not find the include/ dir'


More information about the pypy-commit mailing list