summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-06-16 13:43:22 +0000
committerNorbert Preining <preining@logic.at>2018-06-16 13:43:22 +0000
commitdd5ac5fd8d23e602e90804dcc41a7c2da9ad92b6 (patch)
tree63601f816b3704740ced52cebdec52d9d444d1d0 /Master
parent38d5ec4e6a6998c83716db4ae2a16d2e894295ea (diff)
tlmgr info --only-remote
git-svn-id: svn://tug.org/texlive/trunk@48030 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/scripts/texlive/NEWS5
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl37
2 files changed, 37 insertions, 5 deletions
diff --git a/Master/texmf-dist/scripts/texlive/NEWS b/Master/texmf-dist/scripts/texlive/NEWS
index a862306ecdf..31605520dc3 100644
--- a/Master/texmf-dist/scripts/texlive/NEWS
+++ b/Master/texmf-dist/scripts/texlive/NEWS
@@ -1,6 +1,11 @@
(This file public domain. Originally written by Norbert Preining and
Karl Berry, 2010.)
+<p><b>tlmgr NNNNN (released DDmmmYY):</b>
+<li>tlmgr info now allows listing only packages from the remote
+ repository using <tt>--only-remote</tt>.
+
+
<p><b>tlmgr 47951 (released 07jun18):</b>
<li>Backup removal for non-xz.
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 02fe6c016fc..262b525d3a7 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -215,7 +215,8 @@ my %action_specification = (
"data" => "=s",
"all" => 1,
"list" => 1,
- "only-installed" => 1
+ "only-installed" => 1,
+ "only-remote" => 1
},
"run-post" => 0,
"function" => \&action_info
@@ -1547,6 +1548,10 @@ sub action_dumptlpdb {
# INFO
#
sub action_info {
+ if ($opts{'only-installed'} && $opts{'only-remote'}) {
+ tlwarn("Are you joking? --only-installed and --only-remote cannot both be specified!\n");
+ return($F_ERROR);
+ }
init_local_db();
my ($what,@todo) = @ARGV;
my $ret = $F_OK | $F_NOPOSTACTION;
@@ -1613,8 +1618,10 @@ sub action_info {
} else {
@whattolist = $tlm->list_packages;
}
- # add also the local packages
- TeXLive::TLUtils::push_uniq(\@whattolist, $localtlpdb->list_packages);
+ if (!$opts{'only-remote'}) {
+ # add also the local packages
+ TeXLive::TLUtils::push_uniq(\@whattolist, $localtlpdb->list_packages);
+ }
} else {
@whattolist = ($what, @todo);
}
@@ -3938,18 +3945,31 @@ sub show_one_package_csv {
sub show_one_package_list {
my ($p, @rest) = @_;
+ my @out;
+ my $loctlp = $localtlpdb->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)) {
+ 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);
my $tlm;
if ($opts{"only-installed"}) {
$tlm = $localtlpdb;
} else {
$tlm = $remotetlpdb;
}
- if (defined($localtlpdb->get_package($p))) {
+ if ($is_installed) {
print "i ";
} else {
print " ";
}
- my $tlp = $tlm->get_package($p);
if (!$tlp) {
if ($remotetlpdb->is_virtual) {
# we might have the case that a package is present in a
@@ -8038,6 +8058,13 @@ dependencies in a similar way.
If this option is given, the installation source will not be used; only
locally installed packages, collections, or schemes are listed.
+=item B<--only-remote>
+
+Only list packages from the remote repository. Useful when checking what
+is available in a remote repository using
+C<tlmgr --repo ... --only-remote info>. Note that
+C<--only-installed> and C<--only-remote> cannot both be specified.
+
=item B<--data C<item1,item2,...>>
If the option C<--data> is given, its argument must be a comma separated