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 A13561381F3 for ; Sun, 15 Sep 2013 17:11:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0982CE0C28; Sun, 15 Sep 2013 17:11:25 +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 7EC10E0C28 for ; Sun, 15 Sep 2013 17:11:24 +0000 (UTC) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 58EAD33EB24 for ; Sun, 15 Sep 2013 17:11:23 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id u16so5874062iet.33 for ; Sun, 15 Sep 2013 10:11:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=YPhGPB49FBoiwOHQDjqDBA79TlqeASSUKDo05xZuq08=; b=UKJM65OYq3nFkLI4jXR+3CX1ZcVj3B/D/dFnMmn8QJRLnHsXb6vwLbS7zhQv3g97Y6 wW0jo98Z6vjGd0VemqYh+KlQaVXjPFnCck5iUB4KcA/oUGClQiJSaKQwzu9eNypT1Hzc f/THxv7PxBmNzgvJnoV9iTRtxJ/zxbcOeemw/8t3YMZEnA4Y5UUqD+GoG3u/yGjvxokx UEV86W57mhV5SwX0LW+C8PSa1Yisa/2pBv3TtHZyUVrm1QxDnWpWPVJNokYZPuOvz/Ha ZVW0jYw79ixgg5TJsnXkzIvWrznB8l+sHUBSPEbW8gzQeQKxbXcfINPM3WFa5l3hJ8Fi 3sAw== 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 MIME-Version: 1.0 X-Received: by 10.50.7.101 with SMTP id i5mr4867272iga.48.1379265081676; Sun, 15 Sep 2013 10:11:21 -0700 (PDT) Received: by 10.64.62.148 with HTTP; Sun, 15 Sep 2013 10:11:21 -0700 (PDT) In-Reply-To: <1379098729-2801-3-git-send-email-mgorny@gentoo.org> References: <1379098729-2801-1-git-send-email-mgorny@gentoo.org> <1379098729-2801-3-git-send-email-mgorny@gentoo.org> Date: Sun, 15 Sep 2013 13:11:21 -0400 Message-ID: Subject: [gentoo-python] Re: [PATCH 2/8] Clean up python_replicate_script(). From: Mike Gilbert To: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Cc: gentoo-python , Gentoo Python Project Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 3ae4773c-a51e-4856-982b-2310e3f0121d X-Archives-Hash: 3c98d06771a60d272c97a4e87eb41c5c On Fri, Sep 13, 2013 at 2:58 PM, Micha=C5=82 G=C3=B3rny = wrote: > --- > 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=3D() > - > - _add_suffix() { > - suffixes+=3D( "${EPYTHON}" ) > - } > - python_foreach_impl _add_suffix > - debug-print "${FUNCNAME}: suffixes =3D ( ${suffixes[@]} )" > - > - local f suffix > - for suffix in "${suffixes[@]}"; do > - for f; do > - local newf=3D${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=3D( "${@}" ) > + python_foreach_impl _python_replicate_script Why are we creating a new array variable here? Why not just pass $@ to _python_replicate script as arguments? > > + # 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}" || di= e > done > } > > -- > 1.8.3.2 >