Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 580468 - perl-module.eclass passes only one argument from DIST_EXAMPLES to perl_doexamples
Summary: perl-module.eclass passes only one argument from DIST_EXAMPLES to perl_doexam...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-18 20:17 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2016-04-18 21:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2016-04-18 20:17:02 UTC
> DIST_EXAMPLES=("a" "b")
> perl_doexamples "${DIST_EXAMPLES}"

This combination only results in "a" being installed.

> DIST_EXAMPLES=("a" "b")
> echo ${DIST_EXAMPLES}

Only prints "a"

> DIST_EXAMPLES=("a c" "b c")
> perl -MData::Dumper -E 'say Dumper(\@ARGV)' ${DIST_EXAMPLES[@]}

> # $VAR1 = [
> #           'a',
> #           'c',
> #           'b',
> #           'c'
> #         ];

This evidences lack of quoting turns spaces in tokens into new tokens.

> DIST_EXAMPLES=("a c" "b c")
> 
> perl -MData::Dumper -E 'say Dumper(\@ARGV)' "${DIST_EXAMPLES[@]}"
 
> # $VAR1 = [
> #           'a c',
> #           'b c'
> #         ];

I believe this is the behaviour we want.

Hence, the line should read:

> [[ -z "${DIST_EXAMPLES}" ]] || perl_doexamples "${DIST_EXAMPLES[@]}"

But I'm not sure about the '-z' part ;)
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2016-04-18 21:07:11 UTC
commit 65a68e76dbbc3245624c79548dffb617da7885bd
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Mon Apr 18 23:05:55 2016 +0200

    perl-module.eclass: Fix bash array handling of DIST_EXAMPLES



Thanks, fixed. (Also the -z part.)