projects
/
platform
/
upstream
/
automake.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git]
/
lib
/
py-compile
diff --git
a/lib/py-compile
b/lib/py-compile
index
699e28f
..
46ea866
100755
(executable)
--- a/
lib/py-compile
+++ b/
lib/py-compile
@@
-3,7
+3,7
@@
scriptversion=2011-06-08.12; # UTC
scriptversion=2011-06-08.12; # UTC
-# Copyright (C) 2000-201
2
Free Software Foundation, Inc.
+# Copyright (C) 2000-201
3
Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-36,7
+36,7
@@
me=py-compile
usage_error ()
{
echo "$me: $*" >&2
usage_error ()
{
echo "$me: $*" >&2
- echo "Try
\`
$me --help' for more information." >&2
+ echo "Try
'
$me --help' for more information." >&2
exit 1
}
exit 1
}
@@
-116,7
+116,7
@@
else
fi
$PYTHON -c "
fi
$PYTHON -c "
-import sys, os, py_compile
+import sys, os, py_compile
, imp
files = '''$files'''
files = '''$files'''
@@
-129,12
+129,19
@@
for file in files.split():
continue
sys.stdout.write(file)
sys.stdout.flush()
continue
sys.stdout.write(file)
sys.stdout.flush()
- py_compile.compile(filepath, filepath + 'c', path)
+ if hasattr(imp, 'get_tag'):
+ py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+ else:
+ py_compile.compile(filepath, filepath + 'c', path)
sys.stdout.write('\n')" || exit $?
# this will fail for python < 1.5, but that doesn't matter ...
$PYTHON -O -c "
sys.stdout.write('\n')" || exit $?
# this will fail for python < 1.5, but that doesn't matter ...
$PYTHON -O -c "
-import sys, os, py_compile
+import sys, os, py_compile, imp
+
+# pypy does not use .pyo optimization
+if hasattr(sys, 'pypy_translation_info'):
+ sys.exit(0)
files = '''$files'''
sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
files = '''$files'''
sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
@@
-146,7
+153,10
@@
for file in files.split():
continue
sys.stdout.write(file)
sys.stdout.flush()
continue
sys.stdout.write(file)
sys.stdout.flush()
- py_compile.compile(filepath, filepath + 'o', path)
+ if hasattr(imp, 'get_tag'):
+ py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+ else:
+ py_compile.compile(filepath, filepath + 'o', path)
sys.stdout.write('\n')" 2>/dev/null || :
# Local Variables:
sys.stdout.write('\n')" 2>/dev/null || :
# Local Variables: