Re: DEP5 to SPDX wrapper in perl
On Monday 17 March 2014 12:29:55 Jeremiah C. Foster wrote:
> Since I've seen that you've already written tools to parse and read
> DEP5 format, I wonder what your advice would be for me to use from
> your selection of modules for the best code re-use. I imagine you have
> a bit better view of the subject matter than I do. My first goal is to
> parse a Debian Copyright file that is DEP5 compliant and the next step
> would be to map the DEP5 entries to SPDX entries.
debian/copyright parser is provided by libconfig-model-dpkg-perl. with this
module you will get the whole content of the copyright file in a data
structure (the configuration tree which can also be dumped in a Perl data structure).
Next step would be to create a configuration model for spdx. See
This spdx model can be minimal and feature only items that are extracted from Dpkg::copyright.
Now the trick is to link these 2 models to be able to translate from one
format to another. This can be implemented with:
* a bigger model than would contain Dpkg::Copyright and SPDX models (a bit like Dpkg model that
contain Dpkg::Control and Dpkg::Copyright)
* this bigger model would augment  SPDX to add migration instruction to
reuse Dpkg::Copyright and translate them to spdx.
* a dedicated cme sub command so user can type 'cme translate dpkg-copyright spdx' (there's also
a plugin mechanism for subcommands)
You may later need to beef up spdx model if:
* you want to check or edit spdx files with 'cme edit spdx'
* you want to update an existing spdx file with data contained in a debian/copyright file
> I understand that you may have moved on to other things, but a pointer
> or two from you would be very valuable in any work I manage to do.
No problem. I still maintain Dpkg model, and I would definitely support you
to get started with spdx and to create the translator from dpkg to spdx.
All the best
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org