From 4c5a86b6e3aa31a7649675d3efefac6c364c3db0 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 12 Jul 2007 10:45:17 +0000 Subject: add a function $TLPDB->list_packages that returns a list of all installed packages git-svn-id: svn://tug.org/texlive/trunk@4571 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLPDB.pm | 13 ++++++++++++- Master/tlpkg/doc/Perl-API.txt | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index cc426df6dcb..a20bf491ba7 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -26,6 +26,7 @@ TeXLive::TLPDB - a database of TeX Live Packages $tlpdb->generate_listfiles([$destdir]); $tlpdb->add_objpkg($tlpobj); $tlpdb->get_package("packagename"); + $tlpdb->list_packages; $tlpdb->package_revision("packagename"); =head1 DESCRIPTION @@ -145,7 +146,17 @@ sub get_package { =pod -The C functions returns the the revision of the +The C function returns the list of all included packages. + +=cut +sub list_packages { + my $self = shift; + return (sort keys %{$self->{'tlps'}}); +} + +=pod + +The C function returns the the revision of the package named in the first argument. =cut diff --git a/Master/tlpkg/doc/Perl-API.txt b/Master/tlpkg/doc/Perl-API.txt index b3e2eb139b5..b27c75f9229 100644 --- a/Master/tlpkg/doc/Perl-API.txt +++ b/Master/tlpkg/doc/Perl-API.txt @@ -241,6 +241,9 @@ Input/Output to TLDB->listdir) (could be more than one for packages with binary files) + $tldb->list_packages + returns all packages installed + TLP interface $tldb->add_tlpobj($tlp) -- cgit v1.2.3