backend/Makefile.defs | 6 - backend/compile.py | 105 --------------------------- client/tools/osad/Makefile.defs | 4 - client/tools/osad/compile.py | 105 --------------------------- client/tools/rhncfg/Makefile.defs | 5 - client/tools/rhncfg/compile.py | 105 --------------------------- client/tools/rhncfg/solaris/build-solaris.sh | 1 client/tools/rhncustominfo/Makefile.defs | 4 - client/tools/rhncustominfo/compile.py | 105 --------------------------- client/tools/spacewalk-koan/Makefile.defs | 4 - client/tools/spacewalk-koan/compile.py | 105 --------------------------- proxy/proxy/Makefile.defs | 4 - proxy/proxy/compile.py | 105 --------------------------- spacewalk/certs-tools/Makefile.defs | 4 - spacewalk/certs-tools/compile.py | 105 --------------------------- utils/Makefile.defs | 6 - utils/compile.py | 105 --------------------------- 17 files changed, 19 insertions(+), 859 deletions(-)
New commits: commit 2b18d613f79d2bcc2ec05a337c8723dc90e5c3d3 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 23:58:01 2010 +0200
fixed tabs in Makefiles
diff --git a/client/tools/osad/Makefile.defs b/client/tools/osad/Makefile.defs index 6164760..138ea4d 100644 --- a/client/tools/osad/Makefile.defs +++ b/client/tools/osad/Makefile.defs @@ -55,7 +55,7 @@ clean :: %.pyc : %.py python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')" + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/client/tools/rhncfg/Makefile.defs b/client/tools/rhncfg/Makefile.defs index 6f71741..e937e6e 100644 --- a/client/tools/rhncfg/Makefile.defs +++ b/client/tools/rhncfg/Makefile.defs @@ -58,7 +58,7 @@ clean :: %.pyc : %.py python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')" + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
%.8 : %.sgml [ -f /usr/bin/docbook2man ] && /usr/bin/docbook2man $< || true diff --git a/client/tools/rhncustominfo/Makefile.defs b/client/tools/rhncustominfo/Makefile.defs index 123870a..724b3fc 100644 --- a/client/tools/rhncustominfo/Makefile.defs +++ b/client/tools/rhncustominfo/Makefile.defs @@ -53,7 +53,7 @@ clean :: %.pyc : %.py python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')" + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/client/tools/spacewalk-koan/Makefile.defs b/client/tools/spacewalk-koan/Makefile.defs index 0ba39c1..7924c15 100644 --- a/client/tools/spacewalk-koan/Makefile.defs +++ b/client/tools/spacewalk-koan/Makefile.defs @@ -61,7 +61,7 @@ clean :: %.pyc : %.py python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')" + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/spacewalk/certs-tools/Makefile.defs b/spacewalk/certs-tools/Makefile.defs index bc5e700..02dac00 100644 --- a/spacewalk/certs-tools/Makefile.defs +++ b/spacewalk/certs-tools/Makefile.defs @@ -68,7 +68,7 @@ clean :: %.pyc : %.py python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')" + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; )
commit a46fb258a7fc151ce8aabd32cf5327ad7ed02931 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 23:08:20 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/client/tools/spacewalk-koan/Makefile.defs b/client/tools/spacewalk-koan/Makefile.defs index 94e4c2c..0ba39c1 100644 --- a/client/tools/spacewalk-koan/Makefile.defs +++ b/client/tools/spacewalk-koan/Makefile.defs @@ -59,9 +59,9 @@ clean ::
# default compile rules %.pyc : %.py - $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO $(TOP)/compile.py $< $@ + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/client/tools/spacewalk-koan/compile.py b/client/tools/spacewalk-koan/compile.py deleted file mode 100755 index 09bb23c..0000000 --- a/client/tools/spacewalk-koan/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
commit 5165f0cecde885c1322d1271347f55783a3ff739 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 23:08:20 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/client/tools/rhncustominfo/Makefile.defs b/client/tools/rhncustominfo/Makefile.defs index eec937f..123870a 100644 --- a/client/tools/rhncustominfo/Makefile.defs +++ b/client/tools/rhncustominfo/Makefile.defs @@ -51,9 +51,9 @@ clean ::
# default compile rules %.pyc : %.py - $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO $(TOP)/compile.py $< $@ + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/client/tools/rhncustominfo/compile.py b/client/tools/rhncustominfo/compile.py deleted file mode 100755 index 09bb23c..0000000 --- a/client/tools/rhncustominfo/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
commit 1d73174c2f3b21a372a8ca4368eae945e243eafc Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 23:08:20 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/client/tools/rhncfg/Makefile.defs b/client/tools/rhncfg/Makefile.defs index dcc747e..6f71741 100644 --- a/client/tools/rhncfg/Makefile.defs +++ b/client/tools/rhncfg/Makefile.defs @@ -56,9 +56,10 @@ clean ::
# default compile rules %.pyc : %.py - $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO $(TOP)/compile.py $< $@ + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')" + %.8 : %.sgml [ -f /usr/bin/docbook2man ] && /usr/bin/docbook2man $< || true
diff --git a/client/tools/rhncfg/compile.py b/client/tools/rhncfg/compile.py deleted file mode 100755 index 09bb23c..0000000 --- a/client/tools/rhncfg/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1) diff --git a/client/tools/rhncfg/solaris/build-solaris.sh b/client/tools/rhncfg/solaris/build-solaris.sh index 7a4a1aa..5f40ad0 100755 --- a/client/tools/rhncfg/solaris/build-solaris.sh +++ b/client/tools/rhncfg/solaris/build-solaris.sh @@ -58,7 +58,6 @@ perl -pi -e "s|os.path.join(os.sep|os.path.join('$DEST_PREFIX'|" \ ./config_common/local_config.py
perl -pi -e "s|^#!/usr/bin/python|#!$DEST_PREFIX/bin/python|" \ - ./compile.py \ ./config_client/rhncfg-client.py \ ./config_management/rhncfg-manager.py
commit f58f6cdfdbaa7e25ab88ea13ebb3ff3f3546eda6 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 22:51:11 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/client/tools/osad/Makefile.defs b/client/tools/osad/Makefile.defs index 5adc1c1..6164760 100644 --- a/client/tools/osad/Makefile.defs +++ b/client/tools/osad/Makefile.defs @@ -53,9 +53,9 @@ clean ::
# default compile rules %.pyc : %.py - $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO $(TOP)/compile.py $< $@ + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/client/tools/osad/compile.py b/client/tools/osad/compile.py deleted file mode 100755 index 09bb23c..0000000 --- a/client/tools/osad/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
commit 1e2081824a51b05feb18d0e8733ab75ab4f6fb96 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 22:51:11 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/spacewalk/certs-tools/Makefile.defs b/spacewalk/certs-tools/Makefile.defs index db92cc8..bc5e700 100644 --- a/spacewalk/certs-tools/Makefile.defs +++ b/spacewalk/certs-tools/Makefile.defs @@ -66,9 +66,9 @@ clean ::
# default compile rules %.pyc : %.py - $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO $(TOP)/compile.py $< $@ + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/spacewalk/certs-tools/compile.py b/spacewalk/certs-tools/compile.py deleted file mode 100755 index 847debb..0000000 --- a/spacewalk/certs-tools/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
commit 3ae30f9fdf27820275cab5177cda1108fd413301 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 22:51:11 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/utils/Makefile.defs b/utils/Makefile.defs index 8e35f51..9f8ee98 100644 --- a/utils/Makefile.defs +++ b/utils/Makefile.defs @@ -52,9 +52,9 @@ clean ::
# default compile rules %.pyc : %.py - python $(TOP)/compile.py $< $@ -#%.pyo : %.py -# python -OO $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" +%.pyo : %.py + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/utils/compile.py b/utils/compile.py deleted file mode 100755 index 847debb..0000000 --- a/utils/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
commit 7dc4ca4840b409d8533e8868618119211b5bee7c Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 23:38:58 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/backend/Makefile.defs b/backend/Makefile.defs index ee3fe86..f368792 100644 --- a/backend/Makefile.defs +++ b/backend/Makefile.defs @@ -62,9 +62,9 @@ clean ::
# default compile rules %.pyc : %.py - python $(TOP)/compile.py $< $@ -#%.pyo : %.py -# python -OO $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" +%.pyo : %.py + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/backend/compile.py b/backend/compile.py deleted file mode 100755 index 09bb23c..0000000 --- a/backend/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
commit 834f46538c027329537deae4b067c60dbba74498 Author: Michael Mraka michael.mraka@redhat.com Date: Thu Sep 30 22:51:11 2010 +0200
replaced local copy of compile.py with standard compileall module
diff --git a/proxy/proxy/Makefile.defs b/proxy/proxy/Makefile.defs index 98652f1..5935079 100644 --- a/proxy/proxy/Makefile.defs +++ b/proxy/proxy/Makefile.defs @@ -51,9 +51,9 @@ clean ::
# default compile rules %.pyc : %.py - $(TOP)/compile.py $< $@ + python -c "import compileall; compileall.compile_dir('$(CURDIR)')" %.pyo : %.py - python -OO $(TOP)/compile.py $< $@ + python -OO -c "import compileall; compileall.compile_dir('$(CURDIR)')"
# useful macro descend-subdirs = @$(foreach d,$(SUBDIRS), $(MAKE) -C $(d) $@ || exit 1; ) diff --git a/proxy/proxy/compile.py b/proxy/proxy/compile.py deleted file mode 100755 index 847debb..0000000 --- a/proxy/proxy/compile.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2008 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 2 (GPLv2). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -# along with this software; if not, see -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -# -# Red Hat trademarks are not licensed under GPLv2. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# -# -# python compiler. "Borrowed" from Python's py_compile module. As -# opposed to the Python one, this script returns error codes when a -# compile fails, so it can be used from Makefiles -# -# $Id$ - -import os -import sys -import marshal -import traceback -import string -import __builtin__ - -import imp -MAGIC = imp.get_magic() - -if len(sys.argv) != 3: - print "Usage:", sys.argv[0], "infile outfile" - sys.exit(-1) -infile = sys.argv[1] -outfile = sys.argv[2] - -def wr_long(f, x): - "Internal; write a 32-bit int to a file in little-endian order." - f.write(chr( x & 0xff)) - f.write(chr((x >> 8) & 0xff)) - f.write(chr((x >> 16) & 0xff)) - f.write(chr((x >> 24) & 0xff)) - -def compile(file, cfile=None, dfile=None): - """Byte-compile one Python source file to Python bytecode. - - Arguments: - - file: source filename - cfile: target filename; defaults to source with 'c' or 'o' appended - ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) - dfile: purported filename; defaults to source (this is the filename - that will show up in error messages) - - Note that it isn't necessary to byte-compile Python modules for - execution efficiency -- Python itself byte-compiles a module when - it is loaded, and if it can, writes out the bytecode to the - corresponding .pyc (or .pyo) file. - - However, if a Python installation is shared between users, it is a - good idea to byte-compile all modules upon installation, since - other users may not be able to write in the source directories, - and thus they won't be able to write the .pyc/.pyo file, and then - they would be byte-compiling every module each time it is loaded. - This can slow down program start-up considerably. - - See compileall.py for a script/module that uses this module to - byte-compile all installed files (or all files in selected - directories). - """ - - f = open(file) - try: - timestamp = long(os.fstat(f.fileno())[8]) - except AttributeError: - timestamp = long(os.stat(file)[8]) - codestring = f.read() - f.close() - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - try: - codeobject = __builtin__.compile(codestring, dfile or file, 'exec') - except SyntaxError, detail: - lines = traceback.format_exception_only(SyntaxError, detail) - sys.stderr.write("%s: Error compiling\n" % file) - for line in lines: - sys.stderr.write(string.replace(line, 'File "<string>"', - 'File "%s"' % (dfile or file))) - return -1 - if not cfile: - cfile = file + (__debug__ and 'c' or 'o') - fc = open(cfile, 'wb') - fc.write('\0\0\0\0') - wr_long(fc, timestamp) - marshal.dump(codeobject, fc) - fc.flush() - fc.seek(0, 0) - fc.write(MAGIC) - fc.close() - return 0 - -if compile(infile, outfile) != 0: - sys.exit(-1)
spacewalk-commits@lists.fedorahosted.org