From 6a986d630f3f92d340491998eb58bba51a9c1b29 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 May 2010 18:59:21 +0000 Subject: output schemes and collections too, what the heck git-svn-id: svn://tug.org/texlive/trunk@18169 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tl-dump-for-ctan | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'Master') diff --git a/Master/tlpkg/bin/tl-dump-for-ctan b/Master/tlpkg/bin/tl-dump-for-ctan index 4975767c89e..a0d24951da0 100755 --- a/Master/tlpkg/bin/tl-dump-for-ctan +++ b/Master/tlpkg/bin/tl-dump-for-ctan @@ -3,10 +3,9 @@ # This file is licensed under the GNU General Public License version 2 # or any later version. # -# From an email from Karl: -# Jim Hefferon could use a dump of TL packages for CTAN with one line per -# package, showing the package name, collection it belongs to, and all its -# schemes. +# Output a dump of TL packages with one line per package, showing the +# package name, collection it belongs to, and all its schemes. This is +# used on the CTAN web pages. Run from cron. my $mydir; @@ -43,32 +42,38 @@ sub main } } foreach my $pkg ($tlpdb->list_packages) { - next if ($pkg =~ m/^00texlive/); - # ignore *all* arch dep pacakges (also tlpsv etc etc) + next if ($pkg =~ m/^00texlive/); # ignore internal pkgs. + # ignore *all* arch dep pacakges (also tlpsv etc.) next if ($pkg =~ m/\./); + my $tlp = $tlpdb->get_package($pkg); if (!defined($tlp)) { - printf STDERR "strange, $pkg not found but listed, continuing anyway.\n"; + warn "strange, $pkg not found but listed, continuing anyway"; + next; + } + + # For schemes and collections, output their dependencies. + if ($tlp->category =~ /^(Scheme|Collection)$/) { + my @depends = $tlp->depends; + print "$pkg @depends\n"; next; } - next if ($tlp->category eq "Scheme"); - next if ($tlp->category eq "Collection"); - # TODO ??? What to do with TLCore??? - # get the list of packages that depend on that one: + + # For regular packages, output the collection/schemes which include them. my @deps = $tlpdb->needed_by($pkg); my @schemes; my $collection = undef; for my $p (@deps) { my $tlpo = $tlpdb->get_package($p); if (!defined($tlpo)) { - printf STDERR "$p seems to depend on $pkg, but $p cannot be found?\n"; + warn "$p seems to depend on $pkg, but $p cannot be found?"; next; } if ($tlpo->category eq "Scheme") { push @schemes, $p; } elsif ($tlpo->category eq "Collection") { if (defined($collection)) { - printf STDERR "$pkg is asked for in more than one collection: $collection, $p\n"; + warn "$pkg asked for in more than one collection: $collection, $p"; next; } else { $collection = $p; @@ -82,11 +87,14 @@ sub main push @schemes, @{$col_to_schemes{$collection}}; } @schemes = TeXLive::TLUtils::sort_uniq(@schemes); + + my $catname = $tlp->catalogue; # so ctan can map back to their names + print "($catname)" if $catname; + print "$pkg $collection @schemes\n"; } } - __END__ ### Local Variables: -- cgit v1.2.3