Control: tags -1 patch On Mon, Oct 21, 2019 at 05:17:59PM +0200, Dominique Dumont wrote: > The data contained in debian/copyright is mapped to a tree structure inside > cme. You can have a view of this structure by running 'cme dump dpkg- > copyright' or get a graphical view with 'cme edit dpkg-copyright' > > The instructions specified in fix.scanned.copyright are steps to walk in that > tree and alter the values when specified.
Aha, now this is coming together. > > Things that I'd find helpful: > > - what is the general form of these lines? If that's too complex, examples > > covering more use-cases would be helpful. > > In fact, I've found that tweaking debian/fill.copyright.blanks.yml often > provide better results. All in all, I've found very few cases where tweaking > d/fix.scanned.copyright provided better results than tweaking debian/ > fill.copyright.blanks.yml Makes sense - though am I correct to think that fix.scanned.copyright is for fixing extractions that include html entities, weird chars from upstream, etc? > I understand that Config::Model::Loader synopsis is for only for Perl > programmer. > > On the other hand, the "load string syntax" section was intended to provide > instructions usable for non-perl programmers. Was that section overwhelming > as well ? It was originally, but after your message, it's much more clear. There's not nearly as much to learn as it originally looked like. > In any case, I may need to split this man page... What do you think ? No, I don't think that's necessary anymore. Maybe a few more words of description, and some pointers to the Config::Model::Loader section. Possible patches are attached that use the explanations you sent me. Ross
diff --git a/lib/App/Cme/Command/update.pm b/lib/App/Cme/Command/update.pm index b4a36ea..997cc3d 100644 --- a/lib/App/Cme/Command/update.pm +++ b/lib/App/Cme/Command/update.pm @@ -103,6 +103,13 @@ Update a configuration file. The update is done scanning external resource. For the update of dpkg-copyright is done by scanning the headers of source files. (Actually, only dpkg-copyright model currently supports updates) +The data contained in debian/copyright is mapped to a tree structure inside cme. You can have +a view of this structure by running 'cme dump dpkg-copyright' or get a graphical view with +'cme edit dpkg-copyright'. + +Sometimes the output will need adjusting. See the section "Tweak results" in +Config::Model::Dpkg::Copyright for ways to control cme's output. + Example: cme update dpkg-copyright
diff --git a/lib/Config/Model/Dpkg/Copyright.pm b/lib/Config/Model/Dpkg/Copyright.pm index 961cc360..272734c0 100644 --- a/lib/Config/Model/Dpkg/Copyright.pm +++ b/lib/Config/Model/Dpkg/Copyright.pm @@ -423,8 +423,14 @@ based on comments, the result is sometimes lackluster. Your may specify instruction to alter or set specific copyright entries in C<debian/fix.scanned.copyright> file (or C<< debian/<source-package>.fix.scanned.copyright >>). -Each line of this file will be handled -by L<Config::Model::Loader> to modify copyright information. + +cme stores the copyright information in a tree. Entries in +fix.scanned.copyright provide instructions for traversing the cme tree +and modifying entries. You can have a view of debian/copyright file +translated in this syntax by running 'cme dump --format cml +dpkg-copyright'. Each line of this file will be handled by +L<Config::Model::Loader> to modify copyright information; the full +syntax is documented in the "load string syntax" section. =head2 Example @@ -464,6 +470,12 @@ Here's another more complex example: # and modify the copyright entry with a Perl substitution ! Files:~/^3rdparty/ Copyright=~s/@/(at)/ +Sometimes, you might want to find an entry that spans multiple lines. +You can do this by double quoting the whole value: + + ! Files:"uulib/crc32.h + uulib/uustring.h" Copyright="2019 John Doe" + =head1 Under the hood This section explains how cme merges the information from the existing