[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tpm2licenses



Norbert Preining <preining@logic.at> wrote:

> Dear Frank!
>
> During the weekend I could hack the tpm2licenses file a bit. I will
> attach the full fill, but also include a annotated (+-)diff here.
>
> The main changes are:
> - new config variables:
>   --listallfiles
>     used to list all files even if no license information is present
>   --texmfPath
>     replaces the manual setting of the texmfPath variable in the script
> - tpm files can be used without changes straight from the texlive tree
[...]
> - Coverage check: After going through the listing of licenses per file,
>   a list of files which is not covered by one of the above statemnents
>   is given
> - texlive is not treated specifically, it also uses the TpmFileGlob

That sounds all very good.

> - the catalogue config variable can be file:xyz, in this case the
>   file xyz should cotain tpm:licline lines (tpm without the leading .tpm)

Fine.  Is there also an option to *generate* those files?
> - missing directories are just next-ed and not died upon
>   Reason behind at least for me: Some directories are just not present
>   in the install-tree as the have been blacklisted in tpm2deb.cfg.
>   I don't want tpm2licenses die here, maybe we can make it an option.
>   I want to use it in the debian/rules file to generate the license text
>   for all each package specifically (this works already in the depot).

Fine with me.

> Please Frank, could you test whether this works for the tetex packages,
> too? For the texmfPath variable no change should be necessary as the
> default is "." which is what is necessary for tetex. Same for the
> listallfiles which is new and without it the script should work as
> before.

Did you check it into the svn repository?

> TODO, or what I would like from tpm2licenses (and I didn't come around
> to implement):
> - treatment of the special cases of tpm2deb.cfg hacks (only for me)
> - list of missing files (present in the tpm but not in the file system) 
>   (do we need this is the License statement?)

It's good to get that list (currently we have it on stderr already), but
I wouldn't include it in the copyright file, which is already too long.

> Check the coverage. I have no idea how one can give MORE than one debian
> package, but I use it atm always only for one, so what the foreach
> (@debian_pacakge) is for I hae no idea.
>
> +  CheckCoverage();

which "foreach (@debian_package)" do you mean?  I can't find it.

> The following is the trick to get around the bad hashed problem in as-is
> tpm files. The idea is the following: Iff (if and only if) the {text}
> key was missing, also the {size} key is missing in the original hash.
> The getTextEntry (or so) sets the {text} key in any case, but we can
> check whether it was present in the original case by checking for the
> {size} key, and if this one is missing, setting the {text} value to the
> empty string (where before was the bad bad hash).

Aha.  Sounds as if it works, although it's all but nice... Your comment
should help us remember how it works.

> If you know a better way, tell me ;-) memq I would use with lisp!
>
> +  sub in_list {
> +    my ($what, @list) = @_;
> +    foreach (@list) { 
> +      if ($what eq $_) { return 1; }
> +    }
> +    return 0;
> +  }

Maybe there's some easier way in the FAQ.  But TMTOWTDI, and if it
works... Performance or memory consumption isn't our problem here.

> I wanted to be sure that the texmfPath is not shadowed, but keep the
> original layout, so renamed the variable funny. We can just remove the
> second variable if we don't need it.
> (BTW: why not CheckFileExistence($_,@texmfPath) followed by
> my ($file,@texmfPath) = @_? Wouldn't it be simpler? Ok but slower
> because an array instead of a reference is handled, but how man items we
> have?)

A misconception by me.  Since the arguments are passed to the subroutine
in one flat list, I assumed that it's not possible to gather "all but
the first" into one list, which is wrong.  And your suggestion is much
easier to read, which is more important here.

> Here is the part about killing if a directory is not found.
>
> @@ -374,7 +405,8 @@
>  	  $fullDir =  ( $_ . "/" . $dirname );
>  	};
>        };
> -      $fullDir or die "This should not happen: no directory $dirname, nowhere.";
> +      $fullDir or next;
> +      #$fullDir or die "This should not happen: no directory $dirname, nowhere.";

I really want an error message, something like

$fulldir or print STDERR "This should not happen: no directory $dirname, nowhere.";
$fulldir or next;

Regards, Frank
-- 
Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX)



Reply to: