Changeset 40099 for titan/mediathek


Ignore:
Timestamp:
02/25/17 23:19:18 (6 years ago)
Author:
obi
Message:

fix

Location:
titan/mediathek/localhoster/lib/python2.7
Files:
16 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/lib/python2.7/site.py

    r40094 r40099  
    1919resulting directories, if they exist, are appended to sys.path, and
    2020also inspected for path configuration files.
     21
     22For Debian and derivatives, this sys.path is augmented with directories
     23for packages distributed within the distribution. Local addons go
     24into /usr/local/lib/python<version>/dist-packages, Debian addons
     25install into /usr/{lib,share}/python<version>/dist-packages.
     26/usr/lib/python<version>/site-packages is not used.
    2127
    2228A path configuration file is a file whose name has the form
     
    268274    if ENABLE_USER_SITE and os.path.isdir(user_site):
    269275        addsitedir(user_site, known_paths)
     276    if ENABLE_USER_SITE:
     277        for dist_libdir in ("local/lib", "lib"):
     278            user_site = os.path.join(USER_BASE, dist_libdir,
     279                                     "python" + sys.version[:3],
     280                                     "dist-packages")
     281            if os.path.isdir(user_site):
     282                addsitedir(user_site, known_paths)
    270283    return known_paths
    271284
     
    289302            sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
    290303        elif os.sep == '/':
    291             sitepackages.append(os.path.join(prefix, sys.lib,
     304            sitepackages.append(os.path.join(prefix, "local/lib",
    292305                                        "python" + sys.version[:3],
    293                                         "site-packages"))
    294             sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
    295             if sys.lib != "lib":
    296                 sitepackages.append(os.path.join(prefix, "lib",
    297                                             "python" + sys.version[:3],
    298                                             "site-packages"))
    299                 sitepackages.append(os.path.join(prefix, "lib", "site-python"))
     306                                        "dist-packages"))
     307            sitepackages.append(os.path.join(prefix, "lib",
     308                                        "python" + sys.version[:3],
     309                                        "dist-packages"))
    300310        else:
    301311            sitepackages.append(prefix)
    302             sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
     312            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
    303313        if sys.platform == "darwin":
    304314            # for framework builds *only* we add the standard Apple
     
    442452    here = os.path.dirname(os.__file__)
    443453    __builtin__.license = _Printer(
    444         "license", "See https://www.python.org/psf/license/",
     454        "license", "See http://www.python.org/psf/license/",
    445455        ["LICENSE.txt", "LICENSE"],
    446456        [os.path.join(here, os.pardir), here, os.curdir])
  • titan/mediathek/localhoster/lib/python2.7/sysconfig.py

    r40094 r40099  
    88_INSTALL_SCHEMES = {
    99    'posix_prefix': {
    10         'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
    11         'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
    12         'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
    13         'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
     10        'stdlib': '{base}/lib/python{py_version_short}',
     11        'platstdlib': '{platbase}/lib/python{py_version_short}',
     12        'purelib': '{base}/lib/python{py_version_short}/site-packages',
     13        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
     14        'include': '{base}/include/python{py_version_short}',
     15        'platinclude': '{platbase}/include/python{py_version_short}',
     16        'scripts': '{base}/bin',
     17        'data': '{base}',
     18        },
     19    'posix_local': {
     20        'stdlib': '{base}/lib/python{py_version_short}',
     21        'platstdlib': '{platbase}/lib/python{py_version_short}',
     22        'purelib': '{base}/local/lib/python{py_version_short}/dist-packages',
     23        'platlib': '{platbase}/local/lib/python{py_version_short}/dist-packages',
     24        'include': '{base}/local/include/python{py_version_short}',
     25        'platinclude': '{platbase}/local/include/python{py_version_short}',
     26        'scripts': '{base}/local/bin',
     27        'data': '{base}/local',
     28        },
     29    'deb_system': {
     30        'stdlib': '{base}/lib/python{py_version_short}',
     31        'platstdlib': '{platbase}/lib/python{py_version_short}',
     32        'purelib': '{base}/lib/python{py_version_short}/dist-packages',
     33        'platlib': '{platbase}/lib/python{py_version_short}/dist-packages',
    1434        'include': '{base}/include/python{py_version_short}',
    1535        'platinclude': '{platbase}/include/python{py_version_short}',
     
    6686        },
    6787    'posix_user': {
    68         'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
    69         'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
    70         'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
    71         'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
     88        'stdlib': '{userbase}/lib/python{py_version_short}',
     89        'platstdlib': '{userbase}/lib/python{py_version_short}',
     90        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
     91        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
    7292        'include': '{userbase}/include/python{py_version_short}',
    7393        'scripts': '{userbase}/bin',
     
    130150
    131151if _PYTHON_BUILD:
    132     for scheme in ('posix_prefix', 'posix_home'):
     152    for scheme in ('posix_prefix', 'posix_local', 'deb_system', 'posix_home'):
    133153        _INSTALL_SCHEMES[scheme]['include'] = '{projectbase}/Include'
    134154        _INSTALL_SCHEMES[scheme]['platinclude'] = '{srcdir}'
     
    164184def _get_default_scheme():
    165185    if os.name == 'posix':
    166         # the default scheme for posix is posix_prefix
    167         return 'posix_prefix'
     186        # the default scheme for posix on Debian/Ubuntu is posix_local
     187        # FIXME: return dist-packages/posix_prefix only for
     188        #   is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__
     189        # is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local')
     190        return 'posix_local'
    168191    return os.name
    169192
     
    232255
    233256    # do variable interpolation here
    234     while notdone:
    235         for name in notdone.keys():
     257    variables = list(notdone.keys())
     258
     259    # Variables with a 'PY_' prefix in the makefile. These need to
     260    # be made available without that prefix through sysconfig.
     261    # Special care is needed to ensure that variable expansion works, even
     262    # if the expansion uses the name without a prefix.
     263    renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
     264
     265    while len(variables) > 0:
     266        for name in tuple(variables):
    236267            value = notdone[name]
    237268            m = _findvar1_rx.search(value) or _findvar2_rx.search(value)
    238             if m:
     269            if m is not None:
    239270                n = m.group(1)
    240271                found = True
     
    247278                    # do it like make: fall back to environment
    248279                    item = os.environ[n]
     280
     281                elif n in renamed_variables:
     282                    if name.startswith('PY_') and name[3:] in renamed_variables:
     283                        item = ""
     284
     285                    elif 'PY_' + n in notdone:
     286                        found = False
     287
     288                    else:
     289                        item = str(done['PY_' + n])
     290
    249291                else:
    250292                    done[n] = item = ""
     293
    251294                if found:
    252295                    after = value[m.end():]
     
    255298                        notdone[name] = value
    256299                    else:
    257                         try: value = int(value)
     300                        try:
     301                            value = int(value)
    258302                        except ValueError:
    259303                            done[name] = value.strip()
    260304                        else:
    261305                            done[name] = value
    262                         del notdone[name]
     306                        variables.remove(name)
     307
     308                        if name.startswith('PY_') \
     309                        and name[3:] in renamed_variables:
     310
     311                            name = name[3:]
     312                            if name not in done:
     313                                done[name] = value
     314
     315
    263316            else:
    264                 # bogus variable reference; just drop it since we can't deal
    265                 del notdone[name]
     317                # bogus variable reference (e.g. "prefix=$/opt/python");
     318                # just drop it since we can't deal
     319                done[name] = value
     320                variables.remove(name)
     321
    266322    # strip spurious spaces
    267323    for k, v in done.items():
     
    278334    if _PYTHON_BUILD:
    279335        return os.path.join(_PROJECT_BASE, "Makefile")
    280     return os.path.join(get_path('platstdlib'), "config", "Makefile")
     336    return os.path.join(get_config_var('LIBPL'), "Makefile")
    281337
    282338# Issue #22199: retain undocumented private name for compatibility
     
    410466            inc_dir = _PROJECT_BASE
    411467    else:
    412         inc_dir = get_path('platinclude')
     468        inc_dir = get_path('platinclude').replace("/usr/local","/usr",1)+(sys.pydebug and "_d" or "")
    413469    return os.path.join(inc_dir, 'pyconfig.h')
    414470
     
    476532        # the init-function.
    477533        _CONFIG_VARS['userbase'] = _getuserbase()
     534
     535        multiarch = get_config_var('MULTIARCH')
     536        if multiarch:
     537            _CONFIG_VARS['multiarchsubdir'] = '/' + multiarch
     538        else:
     539            _CONFIG_VARS['multiarchsubdir'] = ''
    478540
    479541        if 'srcdir' not in _CONFIG_VARS:
Note: See TracChangeset for help on using the changeset viewer.