texlive[58384] Master/tlpkg/TeXLive: infra: allow overriding

commits+preining at tug.org commits+preining at tug.org
Mon Mar 15 05:22:13 CET 2021


Revision: 58384
          http://tug.org/svn/texlive?view=revision&revision=58384
Author:   preining
Date:     2021-03-15 05:22:12 +0100 (Mon, 15 Mar 2021)
Log Message:
-----------
infra: allow overriding catalogue data in tlpsrc

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
    trunk/Master/tlpkg/TeXLive/TLPSRC.pm

Modified: trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2021-03-15 04:21:17 UTC (rev 58383)
+++ trunk/Master/tlpkg/TeXLive/TLPOBJ.pm	2021-03-15 04:22:12 UTC (rev 58384)
@@ -851,13 +851,13 @@
       $self->catalogue($entry->entry->{'id'});
     }
     if (defined($entry->license)) {
-      $self->cataloguedata->{'license'} = $entry->license;
+      $self->cataloguedata->{'license'} ||= $entry->license;
     }
     if (defined($entry->version) && $entry->version ne "") {
-      $self->cataloguedata->{'version'} = $entry->version;
+      $self->cataloguedata->{'version'} ||= $entry->version;
     }
     if (defined($entry->ctan) && $entry->ctan ne "") {
-      $self->cataloguedata->{'ctan'} = $entry->ctan;
+      $self->cataloguedata->{'ctan'} ||= $entry->ctan;
     }
     # TODO TODO TODO
     # we should rewrite the also fields to TeX Live package names ...
@@ -865,17 +865,17 @@
     # warning, we expect that cataloguedata entries are strings, 
     # so stringify these lists
     if (@{$entry->also}) {
-      $self->cataloguedata->{'also'} = "@{$entry->also}";
+      $self->cataloguedata->{'also'} ||= "@{$entry->also}";
     }
     if (@{$entry->alias}) {
-      $self->cataloguedata->{'alias'} = "@{$entry->alias}";
+      $self->cataloguedata->{'alias'} ||= "@{$entry->alias}";
     }
     if (@{$entry->topics}) {
-      $self->cataloguedata->{'topics'} = "@{$entry->topics}";
+      $self->cataloguedata->{'topics'} ||= "@{$entry->topics}";
     }
     if (%{$entry->contact}) {
       for my $k (keys %{$entry->contact}) {
-        $self->cataloguedata->{"contact-$k"} = $entry->contact->{$k};
+        $self->cataloguedata->{"contact-$k"} ||= $entry->contact->{$k};
       }
     }
     #if (defined($entry->texlive)) {

Modified: trunk/Master/tlpkg/TeXLive/TLPSRC.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2021-03-15 04:21:17 UTC (rev 58383)
+++ trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2021-03-15 04:22:12 UTC (rev 58384)
@@ -222,6 +222,9 @@
     } elsif ($line =~ /^tlpsetvar\s+([-_a-zA-Z0-9]+)\s+(.*)$/) {
       $tlpvars{$1} = $2;
 
+    } elsif ($line =~ /^catalogue-(.+)\s*(.*)$/o) {
+      $self->{'cataloguedata'}{$1} = $2 if defined $2;
+
     } else {
       die "$srcfile:$lineno: unknown tlpsrc directive, fix: $line\n";
     }
@@ -335,6 +338,7 @@
   $tlp->shortdesc($self->{'shortdesc'}) if (defined($self->{'shortdesc'}));
   $tlp->longdesc($self->{'longdesc'}) if (defined($self->{'longdesc'}));
   $tlp->catalogue($self->{'catalogue'}) if (defined($self->{'catalogue'}));
+  $tlp->cataloguedata(%{$self->{'cataloguedata'}}) if (defined($self->{'cataloguedata'}));
   $tlp->executes(@{$self->{'executes'}}) if (defined($self->{'executes'}));
   $tlp->postactions(@{$self->{'postactions'}}) if (defined($self->{'postactions'}));
   $tlp->depends(@{$self->{'depends'}}) if (defined($self->{'depends'}));
@@ -688,6 +692,12 @@
   if (@_) { $self->{'catalogue'} = shift }
   return $self->{'catalogue'};
 }
+sub cataloguedata {
+  my $self = shift;
+  my %ct = @_;
+  if (@_) { $self->{'cataloguedata'} = \%ct }
+  return $self->{'cataloguedata'};
+}
 sub srcpatterns {
   my $self = shift;
   if (@_) { @{ $self->{'srcpatterns'} } = @_ }



More information about the tex-live-commits mailing list.