From e7ae14141c41671d4a4b32cecf36f86f09fd9573 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 1 Dec 2017 00:16:32 +0000 Subject: tlmgr info --data --only-installed: don't load remote git-svn-id: svn://tug.org/texlive/trunk@45957 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 73662615f9b..caba3ae8858 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -1514,16 +1514,23 @@ sub action_info { # output format is changed to csv with " as quotes # we need to determine the fields @datafields = split(',', $opts{'data'}); - # check for correctness of data fields + # check for correctness of data fields and whether remote is necessary + my $load_remote = 0; for my $d (@datafields) { + $load_remote = 1 if ($d eq "remoterev"); if ($d !~ m/name|category|localrev|remoterev|shortdesc|longdesc|size|installed|relocatable|depends|cat-version|cat-date|cat-license/) { tlwarn("unknown data field: $d\n"); return($F_ERROR); } } $fmt = "csv"; - # the 1 is the silent mode! - init_tlmedia_or_die(1); + if ($load_remote) { + if ($opts{"only-installed"}) { + tlwarn("requesting only-installed with data field remoterev, loading remote anyway!\n"); + $opts{"only-installed"} = 0; + } + # loading of tlpdb is done below + } } else { $fmt = "detail"; } @@ -3774,11 +3781,15 @@ sub show_one_package_csv { my ($p, @datafields) = @_; my @out; my $loctlp = $localtlpdb->get_package($p); - my $remtlp = $remotetlpdb->get_package($p); + my $remtlp = $remotetlpdb->get_package($p) unless ($opts{'only-installed'}); my $is_installed = (defined($loctlp) ? 1 : 0); my $is_available = (defined($remtlp) ? 1 : 0); if (!($is_installed || $is_available)) { - tlwarn("$prg: package $p not found neither locally nor remote!\n"); + if ($opts{'only-installed'}) { + tlwarn("$prg: package $p not locally!\n"); + } else { + tlwarn("$prg: package $p not found neither locally nor remote!\n"); + } return($F_WARNING); } my $tlp = ($is_installed ? $loctlp : $remtlp); -- cgit v1.2.3