Skip to content

Commit

Permalink
expltools (16jan25)
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@73477 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
kberry committed Jan 16, 2025
1 parent efed03a commit 03f5a93
Showing 1 changed file with 65 additions and 41 deletions.
106 changes: 65 additions & 41 deletions texk/texlive/linked_scripts/texlive/tlmgr.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# $Id: tlmgr.pl 72848 2024-11-14 15:14:04Z karl $
# $Id: tlmgr.pl 73459 2025-01-15 04:24:52Z preining $
# Copyright 2008-2024 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
Expand All @@ -8,8 +8,8 @@

use strict; use warnings;

my $svnrev = '$Revision: 72848 $';
my $datrev = '$Date: 2024-11-14 16:14:04 +0100 (Thu, 14 Nov 2024) $';
my $svnrev = '$Revision: 73459 $';
my $datrev = '$Date: 2025-01-15 05:24:52 +0100 (Wed, 15 Jan 2025) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
Expand Down Expand Up @@ -213,6 +213,7 @@ BEGIN
"list" => 1,
"only-installed" => 1,
"only-remote" => 1,
"only-files" => 1,
"json" => 1
},
"run-post" => 0,
Expand Down Expand Up @@ -4368,6 +4369,17 @@ sub show_one_package_detail {
}
}
}
if ($opts{"only-files"}) {
print "$pkg\n";
return show_one_package_detail3($tlpdb, $pkg, $tlp, $source_found, $installed, 1, @colls);
} else {
return show_one_package_detail2($tlpdb, $pkg, $tlp, $source_found, $installed, 0, @colls);
}
}

sub show_one_package_detail2 {
my ($tlpdb, $pkg, $tlp, $source_found, $installed, @colls) = @_;
my $ret = $F_OK;
# {
# require Data::Dumper;
# print Data::Dumper->Dump([\$tlp], [qw(tlp)]);
Expand Down Expand Up @@ -4464,48 +4476,55 @@ sub show_one_package_detail {
}
}
print "Included files, by type:\n";
# if the package has a .ARCH dependency we also list the files for
# those packages
my @todo = $tlpdb->expand_dependencies("-only-arch", $tlpdb, ($pkg));
for my $d (sort @todo) {
my $foo = $tlpdb->get_package($d);
if (!$foo) {
tlwarn ("$prg: Should not happen, no dependent package $d\n");
return($F_WARNING);
}
if ($d ne $pkg) {
print "depending package $d:\n";
}
if ($foo->runfiles) {
print "run files:\n";
for my $f (sort $foo->runfiles) { print " $f\n"; }
}
if ($foo->srcfiles) {
print "source files:\n";
for my $f (sort $foo->srcfiles) { print " $f\n"; }
}
if ($foo->docfiles) {
print "doc files:\n";
for my $f (sort $foo->docfiles) {
print " $f";
my $dfd = $foo->docfiledata;
if (defined($dfd->{$f})) {
for my $k (keys %{$dfd->{$f}}) {
print " $k=\"", $dfd->{$f}->{$k}, '"';
}
$ret |= show_one_package_detail3($tlpdb, $pkg, $tlp, $source_found, $installed, 0, @colls);
}
print "\n";
return($ret);
}

sub show_one_package_detail3 {
my ($tlpdb, $pkg, $tlp, $source_found, $installed, $silent, @colls) = @_;
my $ret = $F_OK;
# if the package has a .ARCH dependency we also list the files for
# those packages
my @todo = $tlpdb->expand_dependencies("-only-arch", $tlpdb, ($pkg));
for my $d (sort @todo) {
my $foo = $tlpdb->get_package($d);
if (!$foo) {
tlwarn ("$prg: Should not happen, no dependent package $d\n");
return($F_WARNING);
}
if ($d ne $pkg && !$silent) {
print "depending package $d:\n";
}
if ($foo->runfiles) {
print "run files:\n" if (!$silent);
for my $f (sort $foo->runfiles) { print " $f\n"; }
}
if ($foo->srcfiles) {
print "source files:\n" if (!$silent);
for my $f (sort $foo->srcfiles) { print " $f\n"; }
}
if ($foo->docfiles) {
print "doc files:\n" if (!$silent);
for my $f (sort $foo->docfiles) {
print " $f";
my $dfd = $foo->docfiledata;
if (defined($dfd->{$f})) {
for my $k (keys %{$dfd->{$f}}) {
print " $k=\"", $dfd->{$f}->{$k}, '"';
}
print "\n";
}
}
# in case we have them
if ($foo->allbinfiles) {
print "bin files (all platforms):\n";
for my $f (sort $foo->allbinfiles) { print " $f\n"; }
print "\n";
}
}
# in case we have them
if ($foo->allbinfiles) {
print "bin files (all platforms):\n" if (!$silent);
for my $f (sort $foo->allbinfiles) { print " $f\n"; }
}
}
print "\n";
return($ret);
return $ret;
}

# PINNING
Expand Down Expand Up @@ -8818,6 +8837,11 @@ package version, as approximations only, due to timing skew of the
When given with schemes and collections, C<--list> outputs their
dependencies in a similar way.
=item B<--only-files>
If this option is given, only the files for a given package are listed,
no further information.
=item B<--only-installed>
If this option is given, the installation source will not be used; only
Expand Down Expand Up @@ -10591,7 +10615,7 @@ =head1 AUTHORS AND COPYRIGHT
distribution (L<https://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
$Id: tlmgr.pl 72848 2024-11-14 15:14:04Z karl $
$Id: tlmgr.pl 73459 2025-01-15 04:24:52Z preining $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
Expand Down

0 comments on commit 03f5a93

Please sign in to comment.