From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Mbdbq-00076f-RQ for garchives@archives.gentoo.org; Thu, 13 Aug 2009 16:57:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5E290E03AF; Thu, 13 Aug 2009 16:57:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1CA03E03AF for ; Thu, 13 Aug 2009 16:57:02 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id AF0BF66AD5 for ; Thu, 13 Aug 2009 16:57:01 +0000 (UTC) Received: from arfrever by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Mbdbp-0006Ge-8n for gentoo-commits@lists.gentoo.org; Thu, 13 Aug 2009 16:57:01 +0000 From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, arfrever@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: python.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: python.eclass X-VCS-Directories: eclass X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis Content-Type: text/plain; charset=utf8 Message-Id: Sender: Arfrever Frehtes Taifersar Arahesis Date: Thu, 13 Aug 2009 16:57:01 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: fd2c22f5-52c7-4010-bf0e-d424af6f9536 X-Archives-Hash: 7c8efba513f09fa93c65b44174953b52 arfrever 09/08/13 16:57:01 Modified: python.eclass Log: Don't include needless '/' characters before $(python_get_sitedir). Don= 't try to find *.py[co] files in directories already removed due to being= empty. Display messages about purging of *.py[co] files only once for ea= ch pair of *.py[co] files. Display messages about removing of empty direc= tories. Revision Changes Path 1.62 eclass/python.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.62&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?rev=3D1.62&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/python.ecla= ss?r1=3D1.61&r2=3D1.62 Index: python.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/python.eclass,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- python.eclass 7 Aug 2009 00:43:16 -0000 1.61 +++ python.eclass 13 Aug 2009 16:57:01 -0000 1.62 @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.61 2009/08/0= 7 00:43:16 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.62 2009/08/1= 3 16:57:01 arfrever Exp $ =20 # @ECLASS: python.eclass # @MAINTAINER: @@ -616,13 +616,13 @@ fi else for PYTHON_ABI in ${PYTHON_ABIS}; do - if [[ -d "${root}/$(python_get_sitedir)/$1" ]]; then + if [[ -d "${root}$(python_get_sitedir)/$1" ]]; then site_packages_dirs+=3D("$1") break - elif [[ -f "${root}/$(python_get_sitedir)/$1" ]]; then + elif [[ -f "${root}$(python_get_sitedir)/$1" ]]; then site_packages_files+=3D("$1") break - elif [[ -e "${root}/$(python_get_sitedir)/$1" ]]; then + elif [[ -e "${root}$(python_get_sitedir)/$1" ]]; then ewarn "'$1' is not a file or a directory!" else ewarn "'$1' doesn't exist!" @@ -643,17 +643,17 @@ ebegin "Compilation and optimization of Python modules for Python ${= PYTHON_ABI}" if ((${#site_packages_dirs[@]})); then for dir in "${site_packages_dirs[@]}"; do - site_packages_absolute_dirs+=3D("${root}/$(python_get_sitedir)/${d= ir}") + site_packages_absolute_dirs+=3D("${root}$(python_get_sitedir)/${di= r}") done - "$(PYTHON)" "${root}/$(python_get_libdir)/compileall.py" "${options= [@]}" "${site_packages_absolute_dirs[@]}" || return_code=3D"1" - "$(PYTHON)" -O "${root}/$(python_get_libdir)/compileall.py" "${opti= ons[@]}" "${site_packages_absolute_dirs[@]}" 2> /dev/null || return_code=3D= "1" + "$(PYTHON)" "${root}$(python_get_libdir)/compileall.py" "${options[= @]}" "${site_packages_absolute_dirs[@]}" || return_code=3D"1" + "$(PYTHON)" -O "${root}$(python_get_libdir)/compileall.py" "${optio= ns[@]}" "${site_packages_absolute_dirs[@]}" 2> /dev/null || return_code=3D= "1" fi if ((${#site_packages_files[@]})); then for file in "${site_packages_files[@]}"; do - site_packages_absolute_files+=3D("${root}/$(python_get_sitedir)/${= file}") + site_packages_absolute_files+=3D("${root}$(python_get_sitedir)/${f= ile}") done - "$(PYTHON)" "${root}/$(python_get_libdir)/py_compile.py" "${site_pa= ckages_absolute_files[@]}" || return_code=3D"1" - "$(PYTHON)" -O "${root}/$(python_get_libdir)/py_compile.py" "${site= _packages_absolute_files[@]}" 2> /dev/null || return_code=3D"1" + "$(PYTHON)" "${root}$(python_get_libdir)/py_compile.py" "${site_pac= kages_absolute_files[@]}" || return_code=3D"1" + "$(PYTHON)" -O "${root}$(python_get_libdir)/py_compile.py" "${site_= packages_absolute_files[@]}" 2> /dev/null || return_code=3D"1" fi eend "${return_code}" fi @@ -667,12 +667,12 @@ return_code=3D"0" ebegin "Compilation and optimization of Python modules placed outside= of site-packages directories for Python ${PYVER}..." if ((${#other_dirs[@]})); then - python${PYVER} "${root}/$(python_get_libdir)/compileall.py" "${optio= ns[@]}" "${other_dirs[@]}" || return_code=3D"1" - python${PYVER} -O "${root}/$(python_get_libdir)/compileall.py" "${op= tions[@]}" "${other_dirs[@]}" 2> /dev/null || return_code=3D"1" + python${PYVER} "${root}$(python_get_libdir)/compileall.py" "${option= s[@]}" "${other_dirs[@]}" || return_code=3D"1" + python${PYVER} -O "${root}$(python_get_libdir)/compileall.py" "${opt= ions[@]}" "${other_dirs[@]}" 2> /dev/null || return_code=3D"1" fi if ((${#other_files[@]})); then - python${PYVER} "${root}/$(python_get_libdir)/py_compile.py" "${other= _files[@]}" || return_code=3D"1" - python${PYVER} -O "${root}/$(python_get_libdir)/py_compile.py" "${ot= her_files[@]}" 2> /dev/null || return_code=3D"1" + python${PYVER} "${root}$(python_get_libdir)/py_compile.py" "${other_= files[@]}" || return_code=3D"1" + python${PYVER} -O "${root}$(python_get_libdir)/py_compile.py" "${oth= er_files[@]}" 2> /dev/null || return_code=3D"1" fi eend "${return_code}" fi @@ -768,7 +768,7 @@ SEARCH_PATH+=3D("${root}/${1#/}") else for PYTHON_ABI in ${PYTHON_ABIS}; do - SEARCH_PATH+=3D("${root}/$(python_get_sitedir)/$1") + SEARCH_PATH+=3D("${root}$(python_get_sitedir)/$1") done fi shift @@ -782,17 +782,18 @@ fi =20 for path in "${SEARCH_PATH[@]}"; do + [[ ! -d "${path}" ]] && continue einfo "Cleaning orphaned Python bytecode from ${path} .." find "${path}" -name '*.py[co]' -print0 | while read -rd ''; do src_py=3D"${REPLY%[co]}" - [[ -f "${src_py}" ]] && continue + [[ -f "${src_py}" || (! -f "${src_py}c" && ! -f "${src_py}o") ]] && c= ontinue einfo "Purging ${src_py}[co]" rm -f "${src_py}"[co] done =20 # Attempt to remove directories that may be empty. find "${path}" -type d | sort -r | while read -r dir; do - rmdir "${dir}" 2>/dev/null + rmdir "${dir}" 2>/dev/null && einfo "Removing empty directory ${dir}" done done }