diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-03-23 02:50:40 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-03-29 14:13:24 +0300 |
commit | 95ff7fea38070dbe9219172aecb043ddea659ead (patch) | |
tree | 82df63c986f5ccdf04b8b131257d32022a6245a2 | |
parent | 13d133e800946d7b339f2e3bf82b36e12ef686ca (diff) |
Fix sdesc which end with '.'
Don't just warn, also fix any sdesc which end with '.'
Update tests
9 files changed, 13 insertions, 12 deletions
@@ -180,9 +180,6 @@ def setup_hint_parse(fn): if key in hints: errors.append('duplicate key %s' % (key)) - # store the key:value - hints[key] = value - # check the value meets any key-specific constraints if (key in valkeys) and (len(value) == 0): errors.append('%s has empty value' % (key)) @@ -202,10 +199,11 @@ def setup_hint_parse(fn): if not (value.startswith('"') and value.endswith('"')): errors.append("%s value '%s' should be quoted" % (key, value)) - # warn if sdesc ends with a '.' + # if sdesc ends with a '.', warn and fix it if key == 'sdesc': if re.search(r'\."$', value): warnings.append("sdesc ends with '.'") + value = re.sub(r'\."$', '"', value) # warn if sdesc contains ' ' if key == 'sdesc': @@ -224,6 +222,9 @@ def setup_hint_parse(fn): # warn if value starts with a quote followed by whitespace if re.match(r'^"[ \t]+', value): warnings.append('value for key %s starts with quoted whitespace' % (key)) + + # store the key:value + hints[key] = value else: errors.append("unknown setup construct '%s' at line %d" % (item, i)) diff --git a/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.6-1 b/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.6-1 index 42b3a8e..a6c9d6c 100644 --- a/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.6-1 +++ b/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.6-1 @@ -1,5 +1,5 @@ <html> -<h1>base-cygwin: Initial base installation helper script. (installed binaries and support files)</h1> +<h1>base-cygwin: Initial base installation helper script (installed binaries and support files)</h1> <tt><pre> 2015-10-11 14:45 26 test/test.1 2015-10-11 14:45 31 test/test.2 diff --git a/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.8-1 b/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.8-1 index 42b3a8e..a6c9d6c 100644 --- a/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.8-1 +++ b/testdata/htdocs.expected/x86/base-cygwin/base-cygwin-3.8-1 @@ -1,5 +1,5 @@ <html> -<h1>base-cygwin: Initial base installation helper script. (installed binaries and support files)</h1> +<h1>base-cygwin: Initial base installation helper script (installed binaries and support files)</h1> <tt><pre> 2015-10-11 14:45 26 test/test.1 2015-10-11 14:45 31 test/test.2 diff --git a/testdata/htdocs.expected/x86/packages.inc b/testdata/htdocs.expected/x86/packages.inc index 484f797..cd5e235 100755 --- a/testdata/htdocs.expected/x86/packages.inc +++ b/testdata/htdocs.expected/x86/packages.inc @@ -7,7 +7,7 @@ <br> <table class="pkglist"> <tr><td><a href="x86/arc">arc</a></td><td>The ARC archive utility</td></tr> -<tr><td><a href="x86/base-cygwin">base-cygwin</a></td><td>Initial base installation helper script.</td></tr> +<tr><td><a href="x86/base-cygwin">base-cygwin</a></td><td>Initial base installation helper script</td></tr> <tr><td><a href="x86/cygwin">cygwin</a></td><td>The UNIX emulation engine</td></tr> <tr><td><a href="x86/cygwin-debuginfo">cygwin-debuginfo</a></td><td>Debug info for cygwin</td></tr> <tr><td><a href="x86/cygwin-devel">cygwin-devel</a></td><td>Core development files</td></tr> diff --git a/testdata/inifile/setup.ini.expected b/testdata/inifile/setup.ini.expected index 6140c5d..6b241ef 100644 --- a/testdata/inifile/setup.ini.expected +++ b/testdata/inifile/setup.ini.expected @@ -23,7 +23,7 @@ '6de201dfed1d45412509c65deb34690dc2d09c6aafccfe491fd2f440f92842b9c755b61dc7bcdd4cc0c9f18cf46c2b3a1241e99c4c2a33fff5555e7b2f0b6348\n' '\n' '@ base-cygwin\n' - 'sdesc: "Initial base installation helper script."\n' + 'sdesc: "Initial base installation helper script"\n' 'ldesc: "Initial base installation helper script."\n' 'category: Base\n' 'version: 3.8-1\n' diff --git a/testdata/x86.hints/release/base-cygwin/expected b/testdata/x86.hints/release/base-cygwin/expected index e3409a1..7505632 100644 --- a/testdata/x86.hints/release/base-cygwin/expected +++ b/testdata/x86.hints/release/base-cygwin/expected @@ -1,4 +1,4 @@ -{'sdesc': '"Initial base installation helper script."', +{'sdesc': '"Initial base installation helper script"', 'ldesc': '"Initial base installation helper script."', 'category': 'Base', 'requires': '', diff --git a/testdata/x86.hints/release/mingw64-i686-binutils/expected b/testdata/x86.hints/release/mingw64-i686-binutils/expected index bc0368d..114e53c 100644 --- a/testdata/x86.hints/release/mingw64-i686-binutils/expected +++ b/testdata/x86.hints/release/mingw64-i686-binutils/expected @@ -1,6 +1,6 @@ {'category': 'Devel', 'requires': 'cygwin libintl8 zlib0', - 'sdesc': '"The GNU Binutils are a collection of binary tools. This package\n is capable of targeting win32."', + 'sdesc': '"The GNU Binutils are a collection of binary tools. This package\n is capable of targeting win32"', 'ldesc': '"Binutils for MinGW-w64 Win32 toolchain"', 'parse-errors': ['key sdesc has multi-line value'], 'parse-warnings': ["sdesc ends with '.'", 'sdesc is much longer than ldesc']} diff --git a/testdata/x86.hints/release/mingw64-i686-binutils/mingw64-i686-binutils-debuginfo/expected b/testdata/x86.hints/release/mingw64-i686-binutils/mingw64-i686-binutils-debuginfo/expected index d925953..c936ff6 100644 --- a/testdata/x86.hints/release/mingw64-i686-binutils/mingw64-i686-binutils-debuginfo/expected +++ b/testdata/x86.hints/release/mingw64-i686-binutils/mingw64-i686-binutils-debuginfo/expected @@ -2,6 +2,6 @@ 'requires': 'cygwin-debuginfo', 'external-source': 'mingw64-i686-binutils', 'ldesc': '"Debug info for mingw64-i686-binutils"', - 'sdesc': '"This package contains files necessary for debugging the\nmingw64-i686-binutils package with gdb."', + 'sdesc': '"This package contains files necessary for debugging the\nmingw64-i686-binutils package with gdb"', 'parse-errors': ['key sdesc has multi-line value'], 'parse-warnings': ["sdesc ends with '.'", 'sdesc is much longer than ldesc']} diff --git a/testdata/x86.hints/release/splint/expected b/testdata/x86.hints/release/splint/expected index 8c0b6c4..5667e4b 100644 --- a/testdata/x86.hints/release/splint/expected +++ b/testdata/x86.hints/release/splint/expected @@ -1,4 +1,4 @@ -{'sdesc': '"Check C programs for security vulnerabilities and programming\nmistakes."', +{'sdesc': '"Check C programs for security vulnerabilities and programming\nmistakes"', 'ldesc': '"Program does many of the traditional lint checks including\n' 'unused declarations, type inconsistencies, use before definition,\n' 'unreachable code, ignored return values, execution paths with no\n' |