From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 40DCC1381F3 for ; Tue, 22 Oct 2013 15:15:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D1BF2E06CC; Tue, 22 Oct 2013 15:15:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5FC2DE06CC for ; Tue, 22 Oct 2013 15:15:55 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5050833EFE2 for ; Tue, 22 Oct 2013 15:15:54 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2279) id 661FE2004C; Tue, 22 Oct 2013 15:15:51 +0000 (UTC) From: "Michal Gorny (mgorny)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, mgorny@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog distutils-r1.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: ChangeLog distutils-r1.eclass X-VCS-Directories: eclass X-VCS-Committer: mgorny X-VCS-Committer-Name: Michal Gorny Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20131022151551.661FE2004C@flycatcher.gentoo.org> Date: Tue, 22 Oct 2013 15:15:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a7bd55ab-4ee8-4662-9818-f9cec67d4edb X-Archives-Hash: fc0e7ea26c6671f8aad636197f3d17cb mgorny 13/10/22 15:15:51 Modified: ChangeLog distutils-r1.eclass Log: Support installing Python scripts with custom --install-scripts argument. Bug #487788. Revision Changes Path 1.1031 eclass/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1031&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1031&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1030&r2=1.1031 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v retrieving revision 1.1030 retrieving revision 1.1031 diff -u -r1.1030 -r1.1031 --- ChangeLog 22 Oct 2013 15:14:40 -0000 1.1030 +++ ChangeLog 22 Oct 2013 15:15:51 -0000 1.1031 @@ -1,6 +1,10 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1030 2013/10/22 15:14:40 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1031 2013/10/22 15:15:51 mgorny Exp $ + + 22 Oct 2013; Michał Górny distutils-r1.eclass: + Support installing Python scripts with custom --install-scripts argument. Bug + #487788. 22 Oct 2013; Michał Górny systemd.eclass: Add systemd_enable_ntpunit wrt bug #458132. 1.88 eclass/distutils-r1.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.88&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.88&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?r1=1.87&r2=1.88 Index: distutils-r1.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- distutils-r1.eclass 10 Oct 2013 06:10:00 -0000 1.87 +++ distutils-r1.eclass 22 Oct 2013 15:15:51 -0000 1.88 @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.87 2013/10/10 06:10:00 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.88 2013/10/22 15:15:51 mgorny Exp $ # @ECLASS: distutils-r1 # @MAINTAINER: @@ -407,21 +407,21 @@ } # @FUNCTION: _distutils-r1_wrap_scripts -# @USAGE: +# @USAGE: # @INTERNAL # @DESCRIPTION: # Moves and wraps all installed scripts/executables as necessary. _distutils-r1_wrap_scripts() { debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 2 ]] || die "usage: ${FUNCNAME} " local path=${1} - [[ ${path} ]] || die "${FUNCNAME}: no path given" + local bindir=${2} if ! _python_want_python_exec2; then - local PYTHON_SCRIPTDIR=${EPREFIX}/usr/bin + local PYTHON_SCRIPTDIR=${bindir} fi - mkdir -p "${path}${EPREFIX}/usr/bin" || die local f while IFS= read -r -d '' f; do local basename=${f##*/} @@ -429,6 +429,7 @@ [[ -d ${f} ]] && die "Unexpected directory: ${f}" + mkdir -p "${path}${bindir}" || die local shebang read -r shebang < "${f}" if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then @@ -440,14 +441,14 @@ mv "${f}" "${newf}" || die fi - debug-print "${FUNCNAME}: installing wrapper at /usr/bin/${basename}" + debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}" _python_ln_rel "${path}${EPREFIX}"$(_python_get_wrapper_path) \ - "${path}${EPREFIX}/usr/bin/${basename}" || die + "${path}${bindir}/${basename}" || die elif _python_want_python_exec2; then debug-print "${FUNCNAME}: non-matching shebang: ${shebang}" - debug-print "${FUNCNAME}: moving to /usr/bin/${basename}" - mv "${f}" "${path}${EPREFIX}/usr/bin/${basename}" || die + debug-print "${FUNCNAME}: moving to ${bindir}/${basename}" + mv "${f}" "${path}${bindir}/${basename}" || die fi done < <(find "${path}${PYTHON_SCRIPTDIR}" -mindepth 1 -print0) } @@ -491,14 +492,33 @@ flags+=( --install-scripts="${PYTHON_SCRIPTDIR}" ) fi - esetup.py install "${flags[@]}" "${@}" + esetup.py install "${@}" "${flags[@]}" if [[ -d ${root}$(python_get_sitedir)/tests ]]; then die "Package installs 'tests' package, file collisions likely." fi if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then - _distutils-r1_wrap_scripts "${root}" + # user may override --install-scripts + # note: this is poor but distutils argv parsing is dumb + local scriptdir=${EPREFIX}/usr/bin + set -- "${mydistutilsargs[@]}" "${@}" + while [[ ${@} ]]; do + local a=${1} + shift + + case "${a}" in + --install-scripts=*) + scriptdir=${a#--install-scripts=} + ;; + --install-scripts) + scriptdir=${1} + shift + ;; + esac + done + + _distutils-r1_wrap_scripts "${root}" "${scriptdir}" multibuild_merge_root "${root}" "${D}" fi }