Add a DESCRIPTION.toolong warning for when the DESCRIPTION line is
authorZac Medico <zmedico@gentoo.org>
Fri, 11 Jan 2008 07:22:07 +0000 (07:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 11 Jan 2008 07:22:07 +0000 (07:22 -0000)
over 80 characters long. Thanks to Betelgeuse for the patch.

svn path=/main/trunk/; revision=9177

bin/repoman

index ebeaea9156bd9ee5ab1ac00e4e6836a67025e561..51fc8a395514724e2cb9206f4ef7e489d9d2d2dc 100755 (executable)
@@ -73,6 +73,8 @@ from portage.output import ConsoleStyleFile, StyleWriter
 
 initialize_logger()
 
+# 14 is the length of DESCRIPTION=""
+max_desc_len = 80 - 14
 allowed_filename_chars="a-zA-Z0-9._-+:"
 allowed_filename_chars_set = {}
 map(allowed_filename_chars_set.setdefault, map(chr, range(ord('a'), ord('z')+1)))
@@ -259,6 +261,7 @@ qahelp={
        "KEYWORDS.stupid":"Ebuilds that use KEYWORDS=-* instead of package.mask", 
        "LICENSE.missing":"Ebuilds that have a missing or empty LICENSE variable",
        "DESCRIPTION.missing":"Ebuilds that have a missing or empty DESCRIPTION variable",
+       "DESCRIPTION.toolong":"DESCRIPTION line is over 80 characters",
        "EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
        "SLOT.missing":"Ebuilds that have a missing or empty SLOT variable",
        "HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable",
@@ -320,6 +323,7 @@ qawarnings=[
 "DEPEND.badmasked","RDEPEND.badmasked","PDEPEND.badmasked",
 "DEPEND.badindev","RDEPEND.badindev","PDEPEND.badindev",
 "DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev",
+"DESCRIPTION.toolong",
 "IUSE.invalid",
 "KEYWORDS.stupid",
 "KEYWORDS.missing",
@@ -1286,6 +1290,13 @@ for x in scanlist:
                                stats[myqakey]=stats[myqakey]+1
                                fails[myqakey].append(x+"/"+y+".ebuild")
 
+               # 14 is the length of DESCRIPTION=""
+               if len(myaux['DESCRIPTION']) > max_desc_len:
+                       stats['DESCRIPTION.toolong'] += 1
+                       fails['DESCRIPTION.toolong'].append(
+                               "%s: DESCRIPTION is %d characters (max %d)" % \
+                               (relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+
                keywords = myaux["KEYWORDS"].split()
                stable_keywords = []
                for keyword in keywords: