diff options
author | Mike Gilbert <floppym@gentoo.org> | 2012-01-21 19:48:20 +0000 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2012-01-21 19:48:20 +0000 |
commit | 768c44b2e41193f3addb8b3f604b4bed7ed2aca7 (patch) | |
tree | c96578677d13d5ec6795a475ec15de1bae58e34d /eclass | |
parent | old (diff) | |
download | gentoo-2-768c44b2e41193f3addb8b3f604b4bed7ed2aca7.tar.gz gentoo-2-768c44b2e41193f3addb8b3f604b4bed7ed2aca7.tar.bz2 gentoo-2-768c44b2e41193f3addb8b3f604b4bed7ed2aca7.zip |
Copy python_clean_installation_image from Progress overlay. Thanks Arfrever. Bug 396586.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/python.eclass | 38 |
2 files changed, 42 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 9a334de2a0d1..ba981e5bfca6 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.99 2012/01/20 18:24:08 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.100 2012/01/21 19:48:20 floppym Exp $ + + 21 Jan 2012; Mike Gilbert <floppym@gentoo.org> python.eclass: + Copy python_clean_installation_image from Progress overlay. Thanks Arfrever. + Bug 396586. 20 Jan 2012; Sergei Trofimovich <slyfox@gentoo.org> haskell-cabal.eclass: Added stdout echoing of most executed phase commands. Added stub for 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: |