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 372FA1381F3 for ; Fri, 13 Sep 2013 18:58:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C5098E09B7; Fri, 13 Sep 2013 18:58:30 +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 5AD2DE09B7 for ; Fri, 13 Sep 2013 18:58:30 +0000 (UTC) Received: from pomiot.lan (host-81.219.110.26.devs.futuro.pl [81.219.110.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 86F3933ECAF; Fri, 13 Sep 2013 18:58:28 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-python@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-python] [PATCH 2/8] Clean up python_replicate_script(). Date: Fri, 13 Sep 2013 20:58:43 +0200 Message-Id: <1379098729-2801-3-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1379098729-2801-1-git-send-email-mgorny@gentoo.org> References: <1379098729-2801-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org X-Archives-Salt: 2d698ce3-f0bf-4284-b68f-baf4ae873f43 X-Archives-Hash: 4f52eb4bb5025d6fdb462bd6f2d4ac34 --- gx86/eclass/python-r1.eclass | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass index 6994952..e006744 100644 --- a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass @@ -741,28 +741,22 @@ python_export_best() { python_replicate_script() { debug-print-function ${FUNCNAME} "${@}" - local suffixes=() - - _add_suffix() { - suffixes+=( "${EPYTHON}" ) - } - python_foreach_impl _add_suffix - debug-print "${FUNCNAME}: suffixes = ( ${suffixes[@]} )" - - local f suffix - for suffix in "${suffixes[@]}"; do - for f; do - local newf=${f}-${suffix} - - debug-print "${FUNCNAME}: ${f} -> ${newf}" - cp "${f}" "${newf}" || die + _python_replicate_script() { + local f + for f in "${files[@]}"; do + cp -p "${f}" "${f}-${EPYTHON}" || die done + _python_rewrite_shebang "${EPYTHON}" \ + "${files[@]/%/-${EPYTHON}}" + } - _python_rewrite_shebang "${suffix}" "${@/%/-${suffix}}" - done + local files=( "${@}" ) + python_foreach_impl _python_replicate_script + # install the wrappers + local f for f; do - _python_ln_rel "${ED}"/usr/bin/python-exec "${f}" || die + _python_ln_rel "${ED%/}"/usr/bin/python-exec "${f}" || die done } -- 1.8.3.2