[tex-live] Missing shortdesc

Alexander Cherepanov cherepan at mccme.ru
Sat Oct 3 20:56:09 CEST 2009


Hi!
On Wed, 30 Sep 2009 23:17:53 +0400, "Alexander Cherepanov" <cherepan at mccme.ru> wrote:

>> I will do the rebuild of all packages in tlnet to take advantage of this
>> (and all the other various Catalogue-related things) in another day or
>> two.

> Maybe you would want to wait till tomorrow. I have started to go
> manually through some remaining packages but realized that most of the
> work is probably already done by ctan maintainers -- the
> correspondence between texcat and texlive packages is already in
> texlive element in the catalogue entries. I will try tomorrow to look
> how it could be used and to what extent.

Well, patch follows. For now it just adds texlive names from the catalogue 
when there is only one catalogue entry which maps to this name. 
Catches 38 more packages. Down to 172 names in texlive.tlpdb without 
shortdesc.

diff -ur TeXLive.orig/TeXCatalogue.pm TeXLive/TeXCatalogue.pm
--- TeXLive.orig/TeXCatalogue.pm        2009-09-30 04:34:28.000000000 +0400
+++ TeXLive/TeXCatalogue.pm     2009-10-03 22:19:07.000000000 +0400
@@ -169,6 +169,7 @@
   bless $self, $class;
   if (defined($self->{'location'})) {
     $self->initialize();
+    $self->quest4texlive();
   }
   return $self;
 }
@@ -191,6 +192,34 @@
   chdir($cwd) || die ("Cannot change back to $cwd: $!");
 }
 
+# Copy every catalogue $entry under the name $entry->{'texlive'}
+# if it makes sense
+sub quest4texlive {
+  my $self = shift;
+
+  my $texcat = $self->{'entries'};
+
+  # In catalogue there is a partial mapping from catatlogue entries to 
+  # texlive packages: $id --> $texcat->{$id}{'texlive'}
+  
+  # Try to build the inverse mapping
+  my (%inv, %count);
+  for my $id (keys %{$texcat}) {
+    if (defined($texcat->{$id}{'texlive'})) {
+      $count{$texcat->{$id}{'texlive'}}++;
+      $inv{$texcat->{$id}{'texlive'}} = $id;
+    }
+  }
+  # Go through texlive names
+  for my $name (keys %inv) {
+    # If this name is free and there is only one corresponding catalogue
+    # entry then copy the entry under this name
+    if (!exists($texcat->{$name}) && $count{$name} == 1) {
+      $texcat->{$name} = $texcat->{$inv{$name}};
+    }    
+  }
+}
+
 sub location {
   my $self = shift;
   if (@_) { $self->{'location'} = shift }

Alexander Cherepanov




More information about the tex-live mailing list