Re: Using Config::Model to compare files
On Tuesday 10 July 2012 02:16:48 Felipe Sateler wrote:
> I think we need something more elaborate. I'm not sure if cme could
> handle this or a new executable on top of config::model would be in
> order, but here is my idea of how a specific copyright file comparer
> would work:
>
> Read copyright file 1 and parse it
> Read copyright file 2 and parse it
> Walk the directory tree and for each file, compare the license from
> file 1 and file 2.
>
> Maybe config model is not the right tool for this. The copyright file
> cannot be understood on its own: the source tree is needed to
> determine the copyright file's meaning. I believe this is not the
> usual thing for configuration files.
this would require a new executable.
cme can indeed parse copyright file 1 and 2. But the third part is harder.
It requires:
1. walking down the directory tree
2. foreach file found in there, find the correct entry in the Files: section
(must take into account wild cards)
3. foreach file, infer the copyright and license (if any).
4. track unused entries in copyright file 1 and 2
Step 3. is the hardest as the information is not structured, often missing.
/usr/bin/licensecheck does a decent jobs of it but it's not directly usable
within config::model.
All the best
--
https://github.com/dod38fr/config-model/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
Reply to: