# HG changeset patch # User Adrian Buehlmann # Date 2010-02-07 22:07:58 # Node ID fb203201ce308017600a78750ca897e73aa2458f # Parent e7b97b54cb023209618673820d8872c5f934bb6c setup.py: fixing version info for Windows hg.exe (py2exe) Fixes warning: py2exe: Version Info will not be included: could not parse version number ... which was seen when doing nightly builds. hg.exe files of nightly builds did not have any version info resoure, which may cause problems with installers. Also setting a copyright string for the version resource (was missing). diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -37,7 +37,6 @@ from distutils.command.build_py import b from distutils.spawn import spawn, find_executable from distutils.ccompiler import new_compiler -extra = {} scripts = ['hg'] if os.name == 'nt': scripts.append('contrib/win32/hg.bat') @@ -77,6 +76,7 @@ def hasfunction(cc, funcname): # py2exe needs to be installed to work try: import py2exe + py2exeloaded = True # Help py2exe to find win32com.shell try: @@ -92,9 +92,8 @@ try: except ImportError: pass - extra['console'] = ['hg'] - except ImportError: + py2exeloaded = False pass def runcmd(cmd, env): @@ -266,9 +265,22 @@ for root in ('templates',): packagedata['mercurial'].append(f) datafiles = [] +setupversion = version +extra = {} + +if py2exeloaded: + extra['console'] = [ + {'script':'hg', + 'copyright':'Copyright (C) 2005-2010 Matt Mackall and others', + 'product_version':version}] + +if os.name == 'nt': + # Windows binary file versions for exe/dll files must have the + # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535 + setupversion = version.split('+', 1)[0] setup(name='mercurial', - version=version, + version=setupversion, author='Matt Mackall', author_email='mpm@selenic.com', url='http://mercurial.selenic.com/',