]>
git.ipfire.org Git - ipfire-3.x.git/blob - pkgs/build-essentials/buildsystem-tools/py-compile
3 PYTHON
=$
(which python
2>/dev
/null
)
5 if [ -z "${PYTHON}" ]; then
6 # Python is not present. Fail silently.
12 if [ -e ${i}c
] && [ -e ${i}o
]; then
13 continue # all files we want are already there
18 if [ -z "${files}" ]; then
19 # No files need to be proceeded.
24 import sys, os, string, py_compile
27 print 'Byte-compiling python modules...'
28 for file in string.split(files):
29 if not os.path.exists(file) or not (len(file) >= 3 and file[-3:] == '.py'):
33 py_compile.compile(file)
36 # this will fail for python < 1.5, but that doesn't matter ...
38 import sys, os, string, py_compile
41 print 'Byte-compiling python modules (optimised versions) ...'
42 for file in string.split(files):
43 if not os.path.exists(file) or not (len(file) >= 3 and file[-3:] == '.py'):
47 py_compile.compile(file)
48 print" 2>/dev
/null ||
: