[ccan] qs_parse

Rusty Russell rusty at rustcorp.com.au
Thu Jan 6 12:43:30 EST 2011


On Wed, 5 Jan 2011 09:29:08 am Bart Grantham wrote:
> I've attached a tarball of a HTTP query string parser for ccan.  I
> migrated the tests over to the ccan way of doing things and built the
> _info file.  I get a 25/31 score, but it's giving me a big ol' FAIL
> for license info, even though I've tagged the license in the _info
> file and created a symlink to ../../licenses/BSD-MIT.  It's ready to
> be added to the set as soon as those are resolved (and I'd love to
> know why it fails, too :).

Hi Bart!

    ccanlint can be pernickity sometimes, and its parsing is pretty
rough.  Turns out that it thinks this line starts a new section:

 *         - Better for repeated lookups of k/v pairs

And then misses the next tag.  I've patched that for the moment (though
it could trip on other cases; the parsing should be made more robust).

Next problem:

License in _info is unknown 'License: BSD (2 clause, ie. MIT)', but LICENSE symlink is '../../licenses/BSD-MIT'

Indeed: " * License: License: BSD (2 clause, ie. MIT)"

Removing the extra "License:" still fails:

Module has license: FAIL
License in _info is unknown 'BSD (2 clause, ie. MIT)', but LICENSE symlink is '../../licenses/BSD-MIT'

Indeed, ccanlint doesn't recognize this license string.

I see I used the same thing in daemonize, and that fails in the same way.
Fixed and uploaded...

Thanks for the feedback!
Rusty.

commit b06cf2a67593d4101d1c20b86c5864f062df4a5b
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Thu Jan 6 11:26:47 2011 +1030

    ccanlint: fix parsing bug which believes lines starting with - are a section header.

diff --git a/tools/doc_extract-core.c b/tools/doc_extract-core.c
index 2862eed..07d31c7 100644
--- a/tools/doc_extract-core.c
+++ b/tools/doc_extract-core.c
@@ -82,9 +82,10 @@ static unsigned int is_summary_line(const char *line)
 	id_len = strspn(line, IDENT_CHARS" ");
 	if (id_len == 0)
 		return 0;
+	if (strspn(line, " ") == id_len)
+		return 0;
 	if (!strstarts(line + id_len-1, " - "))
 		return 0;
-
 	return id_len - 1;
 }
 

commit 0b26111530a6eb35420b7075b2cd58390cb2af14
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Thu Jan 6 12:07:05 2011 +1030

    ccanlint: allow BSD-MIT for MIT license.
    
    There are a large number of BSD variants out there, be explicit.

diff --git a/tools/ccanlint/tests/license.c b/tools/ccanlint/tests/license.c
index 9140f98..35a4d39 100644
--- a/tools/ccanlint/tests/license.c
+++ b/tools/ccanlint/tests/license.c
@@ -50,6 +50,7 @@ static const char *expected_link(const struct manifest *m,
 	    || streq(d->lines[0], "LGPL (2 or any later version)"))
 		return "../../licenses/LGPL-2.1";
 	if (streq(d->lines[0], "BSD")
+	    || streq(d->lines[0], "BSD-MIT")
 	    || streq(d->lines[0], "MIT"))
 		return "../../licenses/BSD-MIT";
 	return NULL;

commit 58f929a3cf0a2e17d75baa0f754ef9969a18be3e
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Thu Jan 6 12:07:37 2011 +1030

    daemonize: use BSD-MIT as License: string in _info
    
    The parenthesized thing is confusing and ccanlint dislikes it.

diff --git a/ccan/daemonize/_info b/ccan/daemonize/_info
index 64b08ed..f0e55bc 100644
--- a/ccan/daemonize/_info
+++ b/ccan/daemonize/_info
@@ -35,7 +35,7 @@
  *		exit(0);
  *	}
  *
- * License: BSD (2 clause, ie. MIT)
+ * License: BSD-MIT
  */
 int main(int argc, char *argv[])
 {


More information about the ccan mailing list