summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2012-01-21 19:48:20 +0000
committerMike Gilbert <floppym@gentoo.org>2012-01-21 19:48:20 +0000
commitec5fe3cc0b445df38afc5f8a5972634fe9026dbc (patch)
tree8e07db895f009d6e56c675fb2a8f6b6b7a9474e6 /eclass/python.eclass
parentold (diff)
downloadhistorical-ec5fe3cc0b445df38afc5f8a5972634fe9026dbc.tar.gz
historical-ec5fe3cc0b445df38afc5f8a5972634fe9026dbc.tar.bz2
historical-ec5fe3cc0b445df38afc5f8a5972634fe9026dbc.zip
Copy python_clean_installation_image from Progress overlay. Thanks Arfrever. Bug 396586.
Diffstat (limited to 'eclass/python.eclass')
-rw-r--r--eclass/python.eclass38
1 files changed, 37 insertions, 1 deletions
diff --git a/eclass/python.eclass b/eclass/python.eclass
index a0a562f04a6a..2e7ae8459968 100644
--- a/eclass/python.eclass
+++ b/eclass/python.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.144 2012/01/01 05:02:27 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.145 2012/01/21 19:48:20 floppym Exp $
# @ECLASS: python.eclass
# @MAINTAINER:
@@ -558,6 +558,42 @@ python_convert_shebangs() {
done
}
+# @FUNCTION: python_clean_py-compile_files
+# @USAGE: [-q|--quiet]
+# @DESCRIPTION:
+# Clean py-compile files to disable byte-compilation.
+python_clean_py-compile_files() {
+ _python_check_python_pkg_setup_execution
+
+ local file files=() quiet="0"
+
+ while (($#)); do
+ case "$1" in
+ -q|--quiet)
+ quiet="1"
+ ;;
+ -*)
+ die "${FUNCNAME}(): Unrecognized option '$1'"
+ ;;
+ *)
+ die "${FUNCNAME}(): Invalid usage"
+ ;;
+ esac
+ shift
+ done
+
+ while read -d $'\0' -r file; do
+ files+=("${file#./}")
+ done < <(find -name py-compile -type f -print0)
+
+ for file in "${files[@]}"; do
+ if [[ "${quiet}" == "0" ]]; then
+ einfo "Cleaning '${file}' file"
+ fi
+ echo "#!/bin/sh" > "${file}"
+ done
+}
+
# @FUNCTION: python_clean_installation_image
# @USAGE: [-q|--quiet]
# @DESCRIPTION: