Ticket #4362: xcb-proto-1.9-py_compile_python3-1.patch

File xcb-proto-1.9-py_compile_python3-1.patch, 1.8 KB (added by Fernando de Oliveira, 10 years ago)
  • xcb-proto-1.9/py-compile

    Submitted By: Fernando de Oliveira <famobr at yahoo dot com dot br>
    Date: 2013-11-23
    Initial Package Version: 1.9
    Upstream Status: Not Submitted
    Origin: Fernando de Oliveira <famobr at yahoo dot com dot br>
    Description: Fixes make install with Python3
    
    old new  
    99117fi
    100118
    101119$PYTHON -c "
    102 import sys, os, string, py_compile
     120import sys, os, py_compile
    103121
    104122files = '''$files'''
    105123
    106 print 'Byte-compiling python modules...'
    107 for file in string.split(files):
     124sys.stdout.write('Byte-compiling python modules...\n')
     125for file in files.split():
    108126    $pathtrans
    109127    $filetrans
    110128    if not os.path.exists(filepath) or not (len(filepath) >= 3
    111129                                            and filepath[-3:] == '.py'):
    112         continue
    113     print file,
     130            continue
     131    sys.stdout.write(file)
    114132    sys.stdout.flush()
    115133    py_compile.compile(filepath, filepath + 'c', path)
    116 print" || exit $?
     134sys.stdout.write('\n')" || exit $?
    117135
    118136# this will fail for python < 1.5, but that doesn't matter ...
    119137$PYTHON -O -c "
    120 import sys, os, string, py_compile
     138import sys, os, py_compile
    121139
    122140files = '''$files'''
    123 print 'Byte-compiling python modules (optimized versions) ...'
    124 for file in string.split(files):
     141sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
     142for file in files.split():
    125143    $pathtrans
    126144    $filetrans
    127145    if not os.path.exists(filepath) or not (len(filepath) >= 3
    128146                                            and filepath[-3:] == '.py'):
    129         continue
    130     print file,
     147            continue
     148    sys.stdout.write(file)
    131149    sys.stdout.flush()
    132150    py_compile.compile(filepath, filepath + 'o', path)
    133 print" 2>/dev/null || :
     151sys.stdout.write('\n')" 2>/dev/null || :
    134152
    135153# Local Variables:
    136154# mode: shell-script