Commits

Martin von Löwis committed 73297ed

Get sources.

Comments (0)

Files changed (2)

+from sources import *
+
+get_python('r32b2')
+get_gcc('4.5.2')
+get_binutils('2.21')
+import subprocess, os, urllib.request, tarfile
+
+class SVNError(Exception):
+    pass
+
+def svn_export(url, target):
+    if os.path.exists(target):
+        return
+    p = subprocess.Popen(["svn", "export", url, target])
+    sts = os.waitpid(p.pid, 0)[1]
+    if sts != 0:
+        raise SVNError("Exporting %s failed (%s)" % (url, target))
+
+def get_tarball(url):
+    fn = url.rsplit('/', 1)[1]
+    if not os.path.exists(fn):
+        fn, headers = urllib.request.urlretrieve(url, fn)
+    t = tarfile.TarFile.open(fn)
+    t.extractall()
+
+def get_python(tag):
+    svn_export('http://svn.python.org/projects/python/tags/'+tag,
+               'python_'+tag)
+
+def get_gcc(version):
+    if os.path.exists("gcc-"+version):
+        return
+    get_tarball('ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-%s/gcc-core-%s.tar.bz2' % (version, version))
+
+def get_binutils(version):
+    if os.path.exists("binutils-"+version):
+        return
+    get_tarball("http://ftp.gnu.org/gnu/binutils/binutils-%s.tar.gz" % version)