Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 564258 - repoman should leverage eclass documentation to detect variable type mismatches
Summary: repoman should leverage eclass documentation to detect variable type mismatches
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-27 12:37 UTC by Pacho Ramos
Modified: 2022-07-12 03:18 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 Pacho Ramos gentoo-dev 2015-10-27 12:37:43 UTC
I just noticed this change:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc452109e2076f5c0a2903ee594e3399bf12d2aa

Maybe if repoman could show a warning when some widely used vars like this one are not set properly it would be easier to fix them earlier and not repeat the error in the future :)

Thanks
Comment 1 Arfrever Frehtes Taifersar Arahesis 2015-10-31 19:34:53 UTC
I think that repoman should not hardcode list of such variables, and instead relevant eclasses should check type of variable.

python-r1.eclass, python-single-r1.eclass and python-any-r1.eclass already contain:

if ! declare -p PYTHON_COMPAT &>/dev/null; then
    die 'PYTHON_COMPAT not declared.'
fi

I suggest that they additionally contain this check:

if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then
    die 'PYTHON_COMPAT should be an array'
fi
Comment 2 SpanKY gentoo-dev 2015-11-01 04:09:48 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)

repoman has the ability to probe eclass documentation and check for missing inherits.  there's no reason it couldn't be expanded to include type details.
Comment 3 Mike Gilbert gentoo-dev 2015-11-02 16:30:51 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> I suggest that they additionally contain this check:
> 
> if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then
>     die 'PYTHON_COMPAT should be an array'
> fi

Thanks for the suggestion.

https://github.com/gentoo/gentoo/pull/319
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:17 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.