diff options
author | Norbert Preining <preining@logic.at> | 2022-02-05 06:45:52 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2022-02-05 06:45:52 +0000 |
commit | 2fd334e136d88dde3f606ea0eb1939a99f7f8d9d (patch) | |
tree | 41c0558fcc3c97f63bab460446e38983d2f92d85 /Master | |
parent | 85728486b3d1832f3bc2ccc5d4e0211e970941bf (diff) |
Add tl-print-dependencies
git-svn-id: svn://tug.org/texlive/trunk@61887 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/tlpkg/bin/tl-print-dependencies | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/tl-print-dependencies b/Master/tlpkg/bin/tl-print-dependencies new file mode 100755 index 00000000000..2a18a9dd536 --- /dev/null +++ b/Master/tlpkg/bin/tl-print-dependencies @@ -0,0 +1,66 @@ +#!/usr/bin/env perl +# $Id$ +# Originally written by Norbert Preining and Karl Berry, 2015. Public domain. +# +# Recursively give dependencies of a given package + +my $vc_id = '$Id$'; +my $Master; + +BEGIN { + chomp ($mydir = `dirname $0`); # we are in Master/tlpkg/bin + unshift (@INC, "$mydir/.."); +} + +use TeXLive::TLPDB; +use TeXLive::TLUtils; + +my $prg = TeXLive::TLUtils::basename($0); + +my @print_packages; +my $tlpdb; +my %done; + +exit (&main()); + + +sub main { + chomp ($Master = `cd $mydir/../.. && pwd`); + $tlpdb = TeXLive::TLPDB->new ("root" => $Master); + die "Cannot find tlpdb in $Master!" unless defined $tlpdb; + + @print_packages = @ARGV; + print_next(); + exit(0); +} + +sub print_next { + return if (!@print_packages); + my $pkg = shift @print_packages; + # skip packages we have already printed + if (!$done{$pkg}) { + my $tlp = $tlpdb->get_package($pkg); + if ($tlp) { + # mark as done + $done{$pkg} = 1; + my @deps = $tlp->depends; + # drop .ARCH deps + @deps = grep(!/\.ARCH$/, @deps); + # only print a line when there are deps + if (@deps) { + push @print_packages, @deps; + print "$pkg: @deps\n"; + } + } else { + print "$pkg: MISSING\n"; + } + } + print_next(); +} + +# Local Variables: +# perl-indent-level: 2 +# tab-width: 2 +# indent-tabs-mode: nil +# End: +# vim: sw=2 expandtab |