summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-10-26 17:47:51 +0000
committerMichał Górny <mgorny@gentoo.org>2013-10-26 17:47:51 +0000
commite2a44f8558389fc065262c43ed1d6b3e58f7e5af (patch)
treed1d1b4e4a53bc57bfe0555bbcc994c0adfdfff14 /eclass
parentVersion bump to 2.1.0; summary of the commits leading up to this: Removed and... (diff)
downloadgentoo-2-e2a44f8558389fc065262c43ed1d6b3e58f7e5af.tar.gz
gentoo-2-e2a44f8558389fc065262c43ed1d6b3e58f7e5af.tar.bz2
gentoo-2-e2a44f8558389fc065262c43ed1d6b3e58f7e5af.zip
Fix distutils-r1_python_install to strip --install-scripts= rather than passing "install" twice to override it. Fixes compatibility with dev-python/paver.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog7
-rw-r--r--eclass/distutils-r1.eclass54
2 files changed, 43 insertions, 18 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 44016a349bfe..057f5e2c2dda 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1034 2013/10/26 06:19:13 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1035 2013/10/26 17:47:51 mgorny Exp $
+
+ 26 Oct 2013; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass:
+ Fix distutils-r1_python_install to strip --install-scripts= rather than
+ passing "install" twice to override it. Fixes compatibility with
+ dev-python/paver.
26 Oct 2013; Michał Górny <mgorny@gentoo.org> git-r3.eclass:
Fix handling relative submodule paths.
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index f7d2ef984d7a..2b609b485648 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -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.89 2013/10/22 19:23:47 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.90 2013/10/26 17:47:51 mgorny Exp $
# @ECLASS: distutils-r1
# @MAINTAINER:
@@ -463,6 +463,7 @@ _distutils-r1_wrap_scripts() {
distutils-r1_python_install() {
debug-print-function ${FUNCNAME} "${@}"
+ local args=( "${@}" )
local flags
case "${EPYTHON}" in
@@ -485,39 +486,58 @@ distutils-r1_python_install() {
[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
flags+=( --root="${root}" )
- if [[ ! ${DISTUTILS_SINGLE_IMPL} ]] && _python_want_python_exec2
- then
- local PYTHON_SCRIPTDIR
- python_export PYTHON_SCRIPTDIR
- flags+=( --install-scripts="${PYTHON_SCRIPTDIR}" )
- fi
-
- esetup.py install "${@}" install "${flags[@]}"
-
- if [[ -d ${root}$(python_get_sitedir)/tests ]]; then
- die "Package installs 'tests' package, file collisions likely."
- fi
-
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
# user may override --install-scripts
# note: this is poor but distutils argv parsing is dumb
+ local mydistutilsargs=( "${mydistutilsargs[@]}" )
local scriptdir=${EPREFIX}/usr/bin
- set -- "${mydistutilsargs[@]}" "${@}"
+
+ # construct a list of mydistutilsargs[0] args[0] args[1]...
+ local arg arg_vars
+ [[ ${mydistutilsargs[@]} ]] && eval arg_vars+=(
+ 'mydistutilsargs['{0..$(( ${#mydistutilsargs[@]} - 1 ))}']'
+ )
+ [[ ${args[@]} ]] && eval arg_vars+=(
+ 'args['{0..$(( ${#args[@]} - 1 ))}']'
+ )
+
+ set -- "${arg_vars[@]}"
while [[ ${@} ]]; do
- local a=${1}
+ local arg_var=${1}
shift
+ local a=${!arg_var}
case "${a}" in
--install-scripts=*)
scriptdir=${a#--install-scripts=}
+ if _python_want_python_exec2; then
+ unset "${arg_var}"
+ fi
;;
--install-scripts)
- scriptdir=${1}
+ scriptdir=${!1}
+ if _python_want_python_exec2; then
+ unset "${arg_var}" "${1}"
+ fi
shift
;;
esac
done
+ if _python_want_python_exec2; then
+ local PYTHON_SCRIPTDIR
+ python_export PYTHON_SCRIPTDIR
+ flags+=( --install-scripts="${PYTHON_SCRIPTDIR}" )
+ fi
+ fi
+
+ esetup.py install "${flags[@]}" "${args[@]}"
+
+ 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}" "${scriptdir}"
multibuild_merge_root "${root}" "${D}"
fi