Ticket #17491: 17491.patch
File 17491.patch, 1.9 KB (added by , 13 years ago) |
---|
-
setup.py
17 17 self.set_undefined_options('install', ('install_lib', 'install_dir')) 18 18 install_data.finalize_options(self) 19 19 20 if sys.platform == "darwin": 21 cmdclasses = {'install_data': osx_install_data} 22 else: 23 cmdclasses = {'install_data': install_data} 20 if sys.platform == "darwin": 21 cmdclasses = {'install_data': osx_install_data} 22 else: 23 cmdclasses = {'install_data': install_data} 24 24 25 25 def fullsplit(path, result=None): 26 26 """ … … 66 66 file_info[0] = '\\PURELIB\\%s' % file_info[0] 67 67 68 68 # Dynamically calculate the version based on django.VERSION. 69 version = __import__('django').get_version() 70 if u'SVN' in version: 71 version = ' '.join(version.split(' ')[:-1]) 69 version = __import__('django').get_distutils_version() 72 70 73 71 setup( 74 72 name = "Django", 75 version = version .replace(' ', '-'),73 version = version, 76 74 url = 'http://www.djangoproject.com/', 77 75 author = 'Django Software Foundation', 78 76 author_email = 'foundation@djangoproject.com', -
django/__init__.py
14 14 if svn_rev != u'SVN-unknown': 15 15 version = "%s %s" % (version, svn_rev) 16 16 return version 17 18 def get_distutils_version(): 19 # Distutils expects a version number formatted as major.minor[.patch][sub] 20 parts = 5 21 if VERSION[3] == 'final': 22 parts = 3 23 if VERSION[2] == 0: 24 parts = 2 25 version = VERSION[:parts] 26 version = [str(x)[0] for x in version] # ['1', '4', '0', 'a', '1'] 27 if parts > 2: 28 version[2:] = [''.join(version[2:])] # ['1', '4', '0a1'] 29 version = '.'.join(version) # '1.4.0a1' 30 return version