updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / python26-distribute / distribute-0.6.16-fix_deprecation_warnings.patch
blob32adae89c627327ea6ad53495ac863fec555ffc8
1 diff -Naur distribute-0.6.16.ori/pkg_resources.py distribute-0.6.16/pkg_resources.py
2 --- distribute-0.6.16.ori/pkg_resources.py 2010-07-31 12:28:15.000000000 -0700
3 +++ distribute-0.6.16/pkg_resources.py 2011-05-03 10:29:38.757750390 -0700
4 @@ -210,9 +210,10 @@
5 needs some hacks for Linux and Mac OS X.
6 """
7 try:
8 - from distutils.util import get_platform
9 - except ImportError:
10 + # Python 2.7 or >=3.2
11 from sysconfig import get_platform
12 + except ImportError:
13 + from distutils.util import get_platform
15 plat = get_platform()
16 if sys.platform == "darwin" and not plat.startswith('macosx-'):
17 diff -Naur distribute-0.6.16.ori/setuptools/command/bdist_egg.py distribute-0.6.16/setuptools/command/bdist_egg.py
18 --- distribute-0.6.16.ori/setuptools/command/bdist_egg.py 2011-03-18 07:32:22.000000000 -0700
19 +++ distribute-0.6.16/setuptools/command/bdist_egg.py 2011-05-03 10:29:38.757750390 -0700
20 @@ -7,10 +7,14 @@
21 from setuptools import Command
22 from distutils.dir_util import remove_tree, mkpath
23 try:
24 - from distutils.sysconfig import get_python_version, get_python_lib
25 + # Python 2.7 or >=3.2
26 + from sysconfig import get_path, get_python_version
27 + def _get_purelib():
28 + return get_path("purelib")
29 except ImportError:
30 - from sysconfig import get_python_version
31 - from distutils.sysconfig import get_python_lib
32 + from distutils.sysconfig import get_python_version, get_python_lib
33 + def _get_purelib():
34 + return get_python_lib(False)
36 from distutils import log
37 from distutils.errors import DistutilsSetupError
38 @@ -130,7 +134,7 @@
39 # Hack for packages that install data to install's --install-lib
40 self.get_finalized_command('install').install_lib = self.bdist_dir
42 - site_packages = os.path.normcase(os.path.realpath(get_python_lib()))
43 + site_packages = os.path.normcase(os.path.realpath(_get_purelib()))
44 old, self.distribution.data_files = self.distribution.data_files,[]
46 for item in old:
47 diff -Naur distribute-0.6.16.ori/setuptools/command/build_ext.py distribute-0.6.16/setuptools/command/build_ext.py
48 --- distribute-0.6.16.ori/setuptools/command/build_ext.py 2010-07-31 12:28:15.000000000 -0700
49 +++ distribute-0.6.16/setuptools/command/build_ext.py 2011-05-03 10:29:38.757750390 -0700
50 @@ -9,9 +9,14 @@
51 from distutils.file_util import copy_file
52 from setuptools.extension import Library
53 from distutils.ccompiler import new_compiler
54 -from distutils.sysconfig import customize_compiler, get_config_var
55 -get_config_var("LDSHARED") # make sure _config_vars is initialized
56 -from distutils.sysconfig import _config_vars
57 +try:
58 + # Python 2.7 or >=3.2
59 + from distutils.ccompiler import customize_compiler
60 + from sysconfig import get_config_var, _CONFIG_VARS
61 +except ImportError:
62 + from distutils.sysconfig import customize_compiler, get_config_var
63 + get_config_var("LDSHARED") # make sure _config_vars is initialized
64 + from distutils.sysconfig import _config_vars as _CONFIG_VARS
65 from distutils import log
66 from distutils.errors import *
68 @@ -133,16 +138,16 @@
69 compiler=self.compiler, dry_run=self.dry_run, force=self.force
71 if sys.platform == "darwin":
72 - tmp = _config_vars.copy()
73 + tmp = _CONFIG_VARS.copy()
74 try:
75 # XXX Help! I don't have any idea whether these are right...
76 - _config_vars['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
77 - _config_vars['CCSHARED'] = " -dynamiclib"
78 - _config_vars['SO'] = ".dylib"
79 + _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
80 + _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
81 + _CONFIG_VARS['SO'] = ".dylib"
82 customize_compiler(compiler)
83 finally:
84 - _config_vars.clear()
85 - _config_vars.update(tmp)
86 + _CONFIG_VARS.clear()
87 + _CONFIG_VARS.update(tmp)
88 else:
89 customize_compiler(compiler)
91 diff -Naur distribute-0.6.16.ori/setuptools/command/easy_install.py distribute-0.6.16/setuptools/command/easy_install.py
92 --- distribute-0.6.16.ori/setuptools/command/easy_install.py 2011-04-28 06:33:30.000000000 -0700
93 +++ distribute-0.6.16/setuptools/command/easy_install.py 2011-05-03 10:29:38.757750390 -0700
94 @@ -15,9 +15,22 @@
95 from setuptools import Command, _dont_write_bytecode
96 from setuptools.sandbox import run_setup
97 from distutils import log, dir_util
98 +try:
99 + # Python 2.7 or >=3.2
100 + from sysconfig import get_config_vars, get_path
101 + def _get_platlib():
102 + return get_path("platlib")
103 + def _get_purelib():
104 + return get_path("purelib")
105 +except ImportError:
106 + from distutils.sysconfig import get_config_vars, get_python_lib
107 + def _get_platlib():
108 + return get_python_lib(True)
109 + def _get_purelib():
110 + return get_python_lib(False)
112 from distutils.util import get_platform
113 from distutils.util import convert_path, subst_vars
114 -from distutils.sysconfig import get_python_lib, get_config_vars
115 from distutils.errors import DistutilsArgError, DistutilsOptionError, \
116 DistutilsError, DistutilsPlatformError
117 from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS
118 @@ -1348,8 +1361,7 @@
119 'Python',
120 sys.version[:3],
121 'site-packages'))
122 - for plat_specific in (0,1):
123 - site_lib = get_python_lib(plat_specific)
124 + for site_lib in (_get_purelib(), _get_platlib()):
125 if site_lib not in sitedirs: sitedirs.append(site_lib)
127 if HAS_USER_SITE: