[Scipy-svn] r5513 - trunk/tools/win32/build_scripts
scipy-svn at scipy.org
scipy-svn at scipy.org
Fri Jan 23 04:25:03 EST 2009
Author: cdavid
Date: 2009-01-23 03:24:54 -0600 (Fri, 23 Jan 2009)
New Revision: 5513
Added:
trunk/tools/win32/build_scripts/lib.py
Modified:
trunk/tools/win32/build_scripts/pavement.py
Log:
'forward-port' the changes in build scripts to handle rc versions for win32 binaries.
Copied: trunk/tools/win32/build_scripts/lib.py (from rev 5510, branches/0.7.x/tools/win32/build_scripts/lib.py)
Modified: trunk/tools/win32/build_scripts/pavement.py
===================================================================
--- trunk/tools/win32/build_scripts/pavement.py 2009-01-23 07:28:14 UTC (rev 5512)
+++ trunk/tools/win32/build_scripts/pavement.py 2009-01-23 09:24:54 UTC (rev 5513)
@@ -5,6 +5,8 @@
import re
from zipfile import ZipFile
+from lib import get_svn_version, get_scipy_version
+
BUILD_MSI = False
SRC_ROOT = normpath(pjoin(os.getcwd(), os.pardir, os.pardir, os.pardir))
BUILD_ROOT = os.getcwd()
@@ -157,54 +159,6 @@
def bootstrap_dir(pyver):
return pjoin(BUILD_ROOT, "bootstrap-%s" % pyver)
-def get_scipy_version(src_root):
- version_file = pjoin(src_root, "scipy", "version.py")
- if not pexists(version_file):
- raise IOError("file %s not found" % version_file)
-
- fid = open(version_file, "r")
- vregex = re.compile("version\s*=\s*'(\d+)\.(\d+)\.(\d+)'")
- isrelregex = re.compile("release\s*=\s*True")
- isdevregex = re.compile("release\s*=\s*False")
- isdev = None
- version = None
- for line in fid.readlines():
- m = vregex.match(line)
- if m:
- version = [int(i) for i in m.groups()]
- if isrelregex.match(line):
- if isdev is None:
- isdev = False
- else:
- raise RuntimeError("isdev already set ?")
- if isdevregex.match(line):
- if isdev is None:
- isdev = True
- else:
- raise RuntimeError("isdev already set ?")
-
- verstr = ".".join([str(i) for i in version])
- if isdev:
- verstr += ".dev"
- verstr += get_svn_version(src_root)
- return verstr
-
-def get_svn_version(chdir):
- out = subprocess.Popen(['svn', 'info'],
- stdout = subprocess.PIPE,
- cwd = chdir).communicate()[0]
- r = re.compile('Revision: ([0-9]+)')
- svnver = None
- for line in out.split('\n'):
- m = r.match(line)
- if m:
- svnver = m.group(1)
-
- if not svnver:
- raise ValueError("Error while parsing svn version ?")
-
- return svnver
-
def get_python_exec(ver):
"""Return the executable of python for the given version."""
# XXX Check that the file actually exists
More information about the Scipy-svn
mailing list