From 76b7a41cefbf7fed421b6ddf746859c4c1d9ebe2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 18 Jun 2011 00:09:42 +0000 Subject: (action_dumptlpdb): force exactly one of --local and --remote; always restore $::machinereadable; update doc. git-svn-id: svn://tug.org/texlive/trunk@23036 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 72 +++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 32 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index dc2603b9f77..2cb13c9acf7 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -1037,7 +1037,7 @@ sub action_path { } } else { # that should not happen - tlwarn("\nShould not happen, action_path what=$what"); + tlwarn("\ntlmgr: Should not happen, action_path what=$what"); exit 1; } return; @@ -1047,21 +1047,25 @@ sub action_path { # sub action_dumptlpdb { init_local_db(); - # set machine readable to 1 + + # we are basically doing machine-readable output. my $savemr = $::machinereadable; $::machinereadable = 1; - if ($opts{"local"}) { - # since we want to be consistent we write out the location of - # the installation, too, in the format as it is done when - # dumping the remote tlpdb + + if ($opts{"local"} && !$opts{"remote"}) { + # for consistency we write out the location of the installation, + # too, in the same format as when dumping the remote tlpdb print "location-url\t", $localtlpdb->root, "\n"; $localtlpdb->writeout; - return; - } - if ($opts{"remote"}) { + + } elsif ($opts{"remote"} && !$opts{"local"}) { init_tlmedia(); $remotetlpdb->writeout; + + } else { + tlwarn("tlmgr dump-tlpdb: need exactly one of --local and --remote.\n"); } + $::machinereadable = $savemr; return; } @@ -5804,48 +5808,52 @@ L below for details. =back -=head2 dump-tlpdb [I] +=head2 list [--only-installed] [collections|schemes|I...] -Dumps local or remote TLPDB as is to stdout. +With no argument, lists all packages available at the package +repository, prefixing those already installed with C. -Options: +With the single word C or C as the argument, lists +the request type. -=over 4 +With anything else as arguments, operates as the C action. -=item B<--local> +If the option C<--only-installed> is given, the installation source will +not be used; only locally installed packages, collections, or schemes +are listed. -Dumps the local tlpdb. -=item B<--remote> +=head2 dump-tlpdb [--local|--remote] -Dumps the remote tlpdb. +Dump complete local or remote TLPDB to standard output, as-is. The +output is analogous to the C<--machine-readable> output; see +L section. -=back +Options: -If both B<--local> and B<--remote> is given, only the local tlpdb is dumped -out. If none is given then nothing is dumped. +=over 4 -In the line before the dump of the tlpdb the location is specified on -a line: +=item B<--local> - location-url TAB +Dump the local tlpdb. +=item B<--remote> +Dump the remote tlpdb. +=back -=head2 list [--only-installed] [collections|schemes|I...] +Exactly one of C<--local> and C<--remote> must be given. -With no argument, lists all packages available at the package -repository, prefixing those already installed with C. +In either case, the first line of the output specifies the repository +location, in this format: -With the single word C or C as the argument, lists -the request type. + "location-url" "\t" location -With anything else as arguments, operates as the C action. +where C is the literal field name, followed by a tab, and +I is the file or url to the repository. -If the option C<--only-installed> is given, the installation source will -not be used; only locally installed packages, collections, or schemes -are listed. +Line endings may be either LF or CRLF depending on the current platform. =head2 check [I