Re: [gentoo-dev][PATCH V3] dev-lang/go-1.6.2: enable go-bootstrap tarball for ppc64le #581278

2016-04-28 Thread Alexander Kapshuk
On Thu, Apr 28, 2016 at 1:37 PM, Leno Hou  wrote:
> There is a bootstrap tarball for ppc64le now, and  we have bi-arch
> support for ppc64 platform. It's means that we can build go-1.6.2
> without gccgo
>
> Signed-off-by: Leno Hou 
> ---
>  dev-lang/go/go-1.6.2.ebuild | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/dev-lang/go/go-1.6.2.ebuild b/dev-lang/go/go-1.6.2.ebuild
> index 57ca2c7..ba61397 100644
> --- a/dev-lang/go/go-1.6.2.ebuild
> +++ b/dev-lang/go/go-1.6.2.ebuild
> @@ -88,6 +88,11 @@ go_arch()
> case "${portage_arch}" in
> x86)echo 386;;
> x64-*)  echo amd64;;
> +   ppc64)  if [[ "$(tc-endian $@)" == "big" ]]; then
> +   echo ppc64
> +   else
> +   echo ppc64le
> +   fi;;
> *)  echo "${portage_arch}";;
> esac
>  }
> --
> 2.7.3
>
>

Sometimes, a nested 'case' construct may prove a bit clearer. Just a
suggestion. Not being critical of the original implementation in any
way.
...
ppc64)
case $(tc-endian $@) in
big)
echo ppc64
;;
little)
echo ppc64le
esac
...



Re: [gentoo-dev] [PATCH] bash-completion-r1: support for aliasing completions for commands

2014-08-27 Thread Alexander Kapshuk
On Wed, Aug 27, 2014 at 7:32 PM, Alexander Kapshuk
 wrote:
> On Wed, Aug 27, 2014 at 7:01 PM, Bertrand Jacquin  wrote:
>> Hi Michał,
>>
>> On 2014-08-27 17:06, Michał Górny wrote:
>>
>>> Please review.
>>
>>
>>> +bashcomp_alias() {
>>> +   debug-print-function ${FUNCNAME} "${@}"
>>> +
>>> +   [[ ${#} -lt 2 ]] && die "Usage: ${FUNCNAME}  ..."
>>> +   local base=${1} f
>>> +   shift
>>> +
>>> +   for f; do
>>
>>
>> is there a missing 'in "$@" after 'for f' ? f is never initialized.
>>
>>
>>> +   dosym "${base}"
>>> "$(_bash-completion-r1_get_bashcompdir)/${f}"
>>> +   done
>>> +}
>>
>>
>> --
>> Beber
>>
>
> bash(1)
> for name [ [ in [ word ... ] ] ; ] do list ; done
>   
>   If the in word  is  omitted,  the  for  command
> executes  list once for each positional
>   parameter that is set (see PARAMETERS below).

Here's a test run:
cat test4loop
#!/bin/sh
for f
do echo $f
done

sh -x test4loop 1 2 3
+ for f in '"$@"'
+ echo 1
1
+ for f in '"$@"'
+ echo 2
2
+ for f in '"$@"'
+ echo 3
3



Re: [gentoo-dev] [PATCH] bash-completion-r1: support for aliasing completions for commands

2014-08-27 Thread Alexander Kapshuk
On Wed, Aug 27, 2014 at 7:01 PM, Bertrand Jacquin  wrote:
> Hi Michał,
>
> On 2014-08-27 17:06, Michał Górny wrote:
>
>> Please review.
>
>
>> +bashcomp_alias() {
>> +   debug-print-function ${FUNCNAME} "${@}"
>> +
>> +   [[ ${#} -lt 2 ]] && die "Usage: ${FUNCNAME}  ..."
>> +   local base=${1} f
>> +   shift
>> +
>> +   for f; do
>
>
> is there a missing 'in "$@" after 'for f' ? f is never initialized.
>
>
>> +   dosym "${base}"
>> "$(_bash-completion-r1_get_bashcompdir)/${f}"
>> +   done
>> +}
>
>
> --
> Beber
>

bash(1)
for name [ [ in [ word ... ] ] ; ] do list ; done
  
  If the in word  is  omitted,  the  for  command
executes  list once for each positional
  parameter that is set (see PARAMETERS below).