Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 562808 - repoman should test length of DESCRIPTION
Summary: repoman should test length of DESCRIPTION
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL: https://devmanual.gentoo.org/ebuild-w...
Whiteboard:
Keywords:
Depends on: 562806
Blocks:
  Show dependency tree
 
Reported: 2015-10-11 09:56 UTC by Jonas Stein
Modified: 2015-12-10 17:43 UTC (History)
2 users (show)

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 Jonas Stein gentoo-dev 2015-10-11 09:56:24 UTC
If the DESCRIPTION variable must be limited 
repoman should test length of the DESCRIPTION variable. 
Today there are 2398 ebuilds in the tree ignoring the limit [1] which can be used for testing the new repoman function.


[1] qgrep -C -N DESCRIPTION= | sed -e "s/DESCRIPTION=//g" | awk '{split($0,a,":"); if (length(a[2])>81) print a[1] " --> " a[2]}'

Reproducible: Always
Comment 1 Manuel Rüger (RETIRED) gentoo-dev 2015-10-11 10:43:00 UTC
repoman has a DESCRIPTION.toolong error message, that is prompted if you run "repoman full" on a package.
Comment 2 Jonas Stein gentoo-dev 2015-10-11 11:41:36 UTC
Thank you for pointing me to that. The stable repoman 2.2.20.1 did not have this feature yet, but found it now with your hint on [1].

But I do not understand why 
max_desc_len = 100

  79 CHAR from devman 
+ 14 CHAR for DESCRIPTION="" 
= 93 CHAR in sum

[1] https://github.com/gentoo/portage/blob/master/pym/repoman/checks/ebuilds/variables/description.py

[2] https://github.com/gentoo/portage/blob/master/pym/repoman/qa_data.py#L11
Comment 3 Ulrich Müller gentoo-dev 2015-10-12 06:25:35 UTC
(In reply to Jonas Stein from comment #2)
> The stable repoman 2.2.20.1 did not have this feature yet, [...]

Sure it has. That test is there since a long time.

> But I do not understand why 
> max_desc_len = 100
> 
>   79 CHAR from devman 
> + 14 CHAR for DESCRIPTION="" 
> = 93 CHAR in sum

Repoman will trigger a warning if the string between the "" is longer than 100. This doesn't include the length of the variable name.

But indeed, if the devmanual says 80 characters then repoman should warn if the length is greater than 80 characters. So max_desc_len should be 80 not 100.

CCing QA.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-12 07:50:07 UTC
Yep. There was a comment suggesting that 'DESCRIPTION=' is taken into consideration but the code proves otherwise. I'm sending a patch to gentoo-portage-dev@ to fix it.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-13 16:33:45 UTC
Fix committed now, repoman will complain if DESCRIPTIONS is longer than 80 characters.
Comment 6 Jonas Stein gentoo-dev 2015-12-04 15:12:31 UTC
Thank you for the patch. 
But I think it is not fully in accordance with devman yet, where it says:
"*less* than 80 characters" 

https://github.com/gentoo/portage/blob/master/pym/repoman/checks/ebuilds/variables/description.py#L27

tests for:
if len(pkg._metadata['DESCRIPTION']) > max_desc_len:

so

https://github.com/gentoo/portage/blob/master/pym/repoman/qa_data.py#L10
should be
max_desc_len = 79
instead of
max_desc_len = 80

or the test shuld be >=
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-04 15:57:00 UTC
In that case, I think >= would be better (to match the devmanual wording). Of course I can do the change if someone else confirms. I'm sure people are going to hate me even more for taking their precious 1 character and causing their perfectly awesome packages to generate warnings once more.
Comment 8 Ulrich Müller gentoo-dev 2015-12-04 17:39:39 UTC
(In reply to Michał Górny from comment #7)
> In that case, I think >= would be better (to match the devmanual wording).
> Of course I can do the change if someone else confirms.

Please don't. The devmanual's wording is mostly informal, therefore I would not take it for granted that the intention was to exclude equality. Also 79 characters would be a very unusual limit.

Also, "less" refers to quantity, not to number. So presumably the devmanual should be updated to say "not more than 80 characters" or "strictly fewer than 80 characters".
Comment 9 Ulrich Müller gentoo-dev 2015-12-08 20:13:07 UTC
(In reply to Ulrich Müller from comment #8)
> Also, "less" refers to quantity, not to number. So presumably the devmanual
> should be updated to say "not more than 80 characters" or "strictly fewer
> than 80 characters".

I've committed that change to the devmanual, see bug 562806. Can this bug be closed (again)?