summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2021-03-15 04:20:36 +0000
committerNorbert Preining <preining@logic.at>2021-03-15 04:20:36 +0000
commit6c4d4a1cc74733d66d0186b68b25bf15d8c029fe (patch)
tree7c9f6c97cb470ba05ed96acfa2c44f88d8385e4b
parentbc09a1001f80b2ea1ed069e1e5a28470afe0f97a (diff)
infra: allow overriding catalogue data in tlpsrc
git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58382 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm14
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm10
2 files changed, 17 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index b35421bfb9a..ca37c284c5e 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -851,13 +851,13 @@ sub update_from_catalogue {
$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 @@ sub update_from_catalogue {
# 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)) {
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index d25f4803135..c3a731fe84b 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -222,6 +222,9 @@ sub from_file {
} 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 @@ sub make_tlpobj {
$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 @@ sub catalogue {
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'} } = @_ }