From 57cb67ae7c5220468344a53f91e761209f2befd0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 24 Dec 2014 00:12:32 +0000 Subject: ctanify (23dec14) git-svn-id: svn://tug.org/texlive/trunk@35888 c570f23f-e606-0410-a88d-b1316a301751 --- .../texk/texlive/linked_scripts/ctanify/ctanify | 14 +- .../texk/texlive/linked_scripts/texlive/tlmgr.pl | 411 ++++----------------- Master/texmf-dist/doc/latex/ctanify/README | 2 +- Master/texmf-dist/doc/latex/ctanify/ctanify.pdf | Bin 14747 -> 175732 bytes Master/texmf-dist/doc/man/man1/ctanify.1 | 57 +-- Master/texmf-dist/doc/man/man1/ctanify.man1.pdf | Bin 15625 -> 15543 bytes Master/texmf-dist/scripts/ctanify/ctanify | 14 +- Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/bin/tlpkginfo | 22 +- 9 files changed, 145 insertions(+), 377 deletions(-) diff --git a/Build/source/texk/texlive/linked_scripts/ctanify/ctanify b/Build/source/texk/texlive/linked_scripts/ctanify/ctanify index 5fa852a8ca7..aa731ea4532 100755 --- a/Build/source/texk/texlive/linked_scripts/ctanify/ctanify +++ b/Build/source/texk/texlive/linked_scripts/ctanify/ctanify @@ -19,7 +19,7 @@ use warnings; use strict; # Define some global variables. -our $VERSION = "1.4"; # ctanify version number +our $VERSION = "1.5"; # ctanify version number my $progname = basename $0; # Name of this program my $pkgname; # Base name of the package to create my $miscify = 0; # 1=replace singletons with misc; 0=don't @@ -40,18 +40,24 @@ my $tdsoutdir; # Directory name where to output TDS tree # Associate file extensions with TDS directories. "%s" is replaced # with the package name. my %ext2tds = - ("afm" => "fonts/afm/public/%s", - "README" => "doc/latex/%s", + ("README" => "doc/latex/%s", + "afm" => "fonts/afm/public/%s", "bat" => "scripts/%s", + "bbx" => "tex/latex/%s", "bib" => "bibtex/bib/%s", "bst" => "bibtex/bst/%s", + "cbx" => "tex/latex/%s", "cls" => "tex/latex/%s", "dtx" => "source/latex/%s", "dvi" => "doc/latex/%s", "fd" => "tex/latex/%s", "ins" => "source/latex/%s", + "map" => "fonts/map/dvips/%s", "mf" => "fonts/source/public/%s", "mp" => "metapost/%s", + "ofm" => "fonts/ofm/public/%s", + "ovf" => "fonts/ovf/public/%s", + "ovp" => "fonts/ovp/public/%s", "pdf" => "doc/latex/%s", "pfb" => "fonts/type1/public/%s", "pfm" => "fonts/type1/public/%s", @@ -660,7 +666,7 @@ Scott Pakin, I =head1 COPYRIGHT AND LICENSE -Copyright 2013 Scott Pakin +Copyright 2014 Scott Pakin This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either S of this diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 808e9b21ccd..47aa78664d1 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,12 +1,12 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 35700 2014-11-30 18:34:08Z karl $ +# $Id: tlmgr.pl 35841 2014-12-16 19:11:15Z karl $ # # Copyright 2008-2014 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. -my $svnrev = '$Revision: 35700 $'; -my $datrev = '$Date: 2014-11-30 19:34:08 +0100 (Sun, 30 Nov 2014) $'; +my $svnrev = '$Revision: 35841 $'; +my $datrev = '$Date: 2014-12-16 20:11:15 +0100 (Tue, 16 Dec 2014) $'; my $tlmgrrevision; my $prg; if ($svnrev =~ m/: ([0-9]+) /) { @@ -130,6 +130,8 @@ sub main { "gui" => 1, "gui-lang" => "=s", "debug-translation" => 1, + "h|?" => 1, + "help" => 1, "location|repository|repo" => "=s", "machine-readable" => 1, "no-execute-actions" => 1, @@ -141,81 +143,71 @@ sub main { "usermode|user-mode" => 1, "usertree|user-tree" => "=s", "version" => 1, - "help" => 1, - "h|?" => 1); + ); my %actionoptions = ( - "get-mirror" => { }, - "option" => { }, - "conf" => { "conffile" => "=s", - "delete" => 1 }, - "version" => { }, - "repository" => { }, - "candidate" => { }, - "backup" => { "backupdir" => "=s", + "backup" => { "all" => 1, + "backupdir" => "=s", "clean" => ":-99", - "all" => 1, "dry-run|n" => 1 }, + "candidate" => { }, "check" => { "use-svn" => 1 }, - "generate" => { "localcfg" => "=s", - "dest" => "=s", + "conf" => { "conffile" => "=s", + "delete" => 1 }, + "dump-tlpdb" => { "local" => 1, + "remote" => 1 }, + "generate" => { "dest" => "=s", + "localcfg" => "=s", "rebuild-sys" => 1 }, + "get-mirror" => { }, "gui" => { "load" => 1 }, - "install" => { "no-depends" => 1, - "no-depends-at-all" => 1, + "info" => { "list" => 1, + "only-installed" => 1 }, + "install" => { "dry-run|n" => 1, "file" => 1, - "reinstall" => 1, "force" => 1, - "dry-run|n" => 1 }, + "no-depends" => 1, + "no-depends-at-all" => 1, + "reinstall" => 1}, + "option" => { }, "paper" => { "list" => 1 }, "path" => { "w32mode" => "=s" }, "pinning" => { "all" => 1 }, "platform" => { "dry-run|n" => 1 }, - "postaction" => { "w32mode" => "=s", - "all" => 1, - "fileassocmode" => "=i" }, + "postaction" => { "all" => 1, + "fileassocmode" => "=i", + "w32mode" => "=s"}, "recreate-tlpdb"=> { "platform|arch" => "=s" }, - "remove" => { "no-depends" => 1, - "no-depends-at-all" => 1, + "remove" => { "dry-run|n" => 1, "force" => 1, - "dry-run|n" => 1 }, + "no-depends" => 1, + "no-depends-at-all" => 1 }, "repository" => { "with-platforms" => 1 }, - "restore" => { "backupdir" => "=s", + "restore" => { "all" => 1, + "backupdir" => "=s", "dry-run|n" => 1, - "all" => 1, - "force" => 1 }, - "search" => { "global" => 1, - "word" => 1, + "force" => 1, }, + "search" => { "all" => 1, "file" => 1, - "keyword" => 1, - "list" => 1, - "all" => 1, - "characterization" => 1, - "functionality" => 1, - "taxonomy" => 1 }, - "info" => { "list" => 1, - "taxonomy" => 1, - "keyword" => 1, - "characterization" => 1, - "functionality" => 1, - "only-installed" => 1 }, - "dump-tlpdb" => { "local" => 1, - "remote" => 1 }, + "global" => 1, + "word" => 1 }, + "repository" => { }, "uninstall" => { "force" => 1 }, - "update" => { "no-depends" => 1, - "no-depends-at-all" => 1, - "all" => 1, - "self" => 1, + "update" => { "all" => 1, + "backup" => 1, + "backupdir" => "=s", + "dry-run|n" => 1, + "exclude" => "=s@", + "force" => 1, "list" => 1, "no-auto-remove" => 1, "no-auto-install" => 1, + "no-depends" => 1, + "no-depends-at-all" => 1, "reinstall-forcibly-removed" => 1, - "force" => 1, - "backupdir" => "=s", - "backup" => 1, - "exclude" => "=s@", - "dry-run|n" => 1 }, - ); + "self" => 1 }, + "version" => { }, + ); my %optarg; for my $k (keys %globaloptions) { @@ -1191,15 +1183,7 @@ sub action_dumptlpdb { # sub action_info { init_local_db(); - my $taxonomy; - if ($opts{"taxonomy"} || $opts{"characterization"} || $opts{"functionality"} - || $opts{"keyword"}) { - $taxonomy = load_taxonomy_datafile(); - if (!defined($taxonomy)) { - tlwarn("$prg: Cannot load taxonomy file, showing taxonomies not supported.\n"); - } - } - my ($what, @todo) = @ARGV; + my ($what,@todo) = @ARGV; # # tlmgr info # tlmgr info collection @@ -1213,7 +1197,7 @@ sub action_info { # we are still here, so $what is defined and neither collection nor scheme, # so assume the arguments are package names foreach my $ppp ($what, @todo) { - my ($pkg, $tag) = split '@', $ppp, 2; + my ($pkg, $tag) = split ('@', $ppp, 2); my $tlpdb = $localtlpdb; my $source_found; my $tlp = $localtlpdb->get_package($pkg); @@ -1365,36 +1349,6 @@ sub action_info { print "cat-license: ", $tlp->cataloguedata->{'license'}, "\n" if $tlp->cataloguedata->{'license'}; print "collection: ", @colls, "\n" if (@colls); - if ($opts{"keyword"} || $opts{"taxonomy"}) { - print "keywords: "; - if (defined($taxonomy->{'by-package'}{'keyword'}{$pkg})) { - print join(', ',@{$taxonomy->{'by-package'}{'keyword'}{$pkg}}), "\n"; - } else { - print "(none found)\n"; - } - } - if ($opts{"functionality"} || $opts{"taxonomy"}) { - print "function: "; - if (defined($taxonomy->{'by-package'}{'functionality'}{$pkg})) { - print join(', ',@{$taxonomy->{'by-package'}{'functionality'}{$pkg}}), "\n"; - } else { - print "(none found)\n"; - } - } - if ($opts{"characterization"} || $opts{"taxonomy"}) { - print "primary characterization: "; - if (defined($taxonomy->{'by-package'}{'primary'}{$pkg})) { - print $taxonomy->{'by-package'}{'primary'}{$pkg}, "\n"; - } else { - print "(none found)\n"; - } - print "secondary characterization: "; - if (defined($taxonomy->{'by-package'}{'secondary'}{$pkg})) { - print $taxonomy->{'by-package'}{'secondary'}{$pkg}, "\n"; - } else { - print "(none found)\n"; - } - } if ($opts{"list"}) { if ($tlp->category eq "Collection" || $tlp->category eq "Scheme") { # in the case of collections of schemes we list the deps @@ -1453,83 +1407,26 @@ sub action_info { } - -# taxonomy subroutines -# -sub load_taxonomy_datafile { - init_local_db(); - my $taxonomy; - my $fpath = $localtlpdb->root - . "/texmf-dist/scripts/texlive/var/texcatalogue.keywords"; - if (! -r $fpath) { - tlwarn("$prg: taxonomy file $fpath not readable: $!\n"); - return; - } - if (!open (TAXF, $fpath)) { - tlwarn("$prg: taxonomy file $fpath cannot be opened: $!\n"); - return; - } - # suck in the whole file contents - my @foo = ; - close(TAXF); - my $foo = "@foo"; - no strict "vars"; - # the no strict "vars" is *ABSOLUTELY* necessary otherwise the file is - # not evaluated, no idea why! - eval "$foo"; - use strict "vars"; - return $taxonomy; -} - -sub walk_level_tree { - my $cp = shift; - my $prestring = shift; - my $print_packages = shift; - if (defined($cp->{'_packages_'})) { - print "$prestring\n"; - if ($print_packages) { - my @pkgs = sort @{$cp->{'_packages_'}}; - print "\t@pkgs\n"; - } - } - for my $cz (keys %$cp) { - if ($cz ne '_packages_') { - my $nextstring = "$prestring > $cz"; - my $np = $cp->{$cz}; - &walk_level_tree($np,$nextstring); - } - } -} - # SEARCH # sub action_search { - my $r = shift @ARGV; + my ($r) = @ARGV; my $ret = ""; my $tlpdb; - my $taxonomy; - # - if (!$opts{"list"} && (!defined($r) || !$r)) { - - tlwarn("$prg: nothing to search for.\n"); - return; - } - if ($opts{"extended"}) { - tlwarn("$prg: sorry, extended searching not implemented by now.\n"); - return; - } # check the arguments my $search_type_nr = 0; $search_type_nr++ if $opts{"file"}; - $search_type_nr++ if $opts{"taxonomy"}; - $search_type_nr++ if $opts{"characterization"}; - $search_type_nr++ if $opts{"functionality"}; - $search_type_nr++ if $opts{"keyword"}; $search_type_nr++ if $opts{"all"}; if ($search_type_nr > 1) { - tlwarn("$prg: please specify only one thing to search for!\n"); + tlwarn("$prg: please specify only one thing to search for\n"); + return; + } + # + if (!defined($r) || !$r) { + tlwarn("$prg: nothing to search for.\n"); return; } + init_local_db(); if ($opts{"global"}) { init_tlmedia_or_die(); @@ -1537,49 +1434,9 @@ sub action_search { } else { $tlpdb = $localtlpdb; } - my $search_characterization = - $opts{"characterization"} || $opts{"taxonomy"} || $opts{"all"}; - my $search_functionality = - $opts{"functionality"} || $opts{"taxonomy"} || $opts{"all"}; - my $search_keyword = - $opts{"keyword"} || $opts{"taxonomy"} || $opts{"all"}; - my $search_tlpdb = - $opts{"all"} || - !($opts{"taxonomy"} || $opts{"characterization"} || - $opts{"functionality"} || $opts{"keyword"}); - if ($opts{"all"} || $opts{"taxonomy"} || $opts{"characterization"} - || $opts{"functionality"} || $opts{"keyword"}) { - $taxonomy = load_taxonomy_datafile(); - if (!defined($taxonomy)) { - tlwarn("$prg: Cannot load taxonomy file;", - " searching/listing for taxonomies not supported.\n"); - return; - } - if ($opts{"list"}) { - if ($search_keyword) { - print "\f Keywords:\n"; - for (sort keys %{$taxonomy->{'by-taxonomy'}{'keyword'}}) { - print "\t$_\n"; - } - print "\n"; - } - if ($search_functionality) { - print "\f Functionalities:\n"; - &walk_level_tree($taxonomy->{'by-taxonomy'}{'functionality'}, "", 0); - print "\n"; - } - if ($search_characterization) { - # Assume all possible characterizations occur under the primary ones! - print "\f Characterizations:\n"; - &walk_level_tree($taxonomy->{'by-taxonomy'}{'primary'}, "", 0); - print "\n"; - } - return; - } - } foreach my $pkg ($tlpdb->list_packages) { my $tlp = $tlpdb->get_package($pkg); - if ($opts{"file"}) { + if ($opts{"file"} || $opts{"all"}) { my @files = $tlp->all_files; if ($tlp->relocated) { for (@files) { s:^$RelocPrefix/:$RelocTree/:; } @@ -1593,36 +1450,14 @@ sub action_search { } } else { next if ($pkg =~ m/\./); - # the other searching is done together - my $t = ""; - if ($search_keyword) { - $t = $t . join('\n', @{$taxonomy->{'by-package'}{'keyword'}{$pkg}}) - if (defined($taxonomy->{'by-package'}{'keyword'}{$pkg})); - } - if ($search_functionality) { - $t = $t.join('\n', @{$taxonomy->{'by-package'}{'functionality'}{$pkg}}) - if (defined($taxonomy->{'by-package'}{'functionality'}{$pkg})); - } - if ($search_characterization) { - $t = "$t$taxonomy->{'by-package'}{'primary'}{$pkg}\n" - if (defined($taxonomy->{'by-package'}{'primary'}{$pkg})); - $t = "$t$taxonomy->{'by-package'}{'secondary'}{$pkg}\n" - if (defined($taxonomy->{'by-package'}{'secondary'}{$pkg})); - } - if ($search_tlpdb) { - $t .= "$pkg\n"; - $t = "$t" . $tlp->shortdesc . "\n" - if (defined($tlp->shortdesc)); - $t = "$t" . $tlp->longdesc . "\n" - if (defined($tlp->longdesc)); - } - my $shortdesc = $tlp->shortdesc; - $shortdesc |= ""; + # glom description strings together for one search + my $t = "$pkg\n"; + $t = $t . $tlp->shortdesc . "\n" if (defined($tlp->shortdesc)); + $t = $t . $tlp->longdesc . "\n" if (defined($tlp->longdesc)); my $pat = $r; - if ($opts{"word"}) { - $pat = '\W' . $r . '\W'; - } + $pat = '\W' . $r . '\W' if ($opts{"word"}); if ($t =~ m/$pat/i) { + my $shortdesc = $tlp->shortdesc || ""; $ret .= " $pkg - $shortdesc\n"; } } @@ -6587,18 +6422,6 @@ not be used; only locally installed packages, collections, or schemes are listed. (Does not work for listing of packages for now) -=item B<--taxonomy> - -=item B<--keyword> - -=item B<--functionality> - -=item B<--characterization> - -In addition to the normal data displayed, also display information for -given packages from the corresponding taxonomy (or all of them). See -L below for details. - =back @@ -7038,66 +6861,35 @@ otherwise, all operations will fail! =head3 search [I