diff options
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 20 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLTREE.pm | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 10e377ec05e..2a621fa741d 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -8,6 +8,7 @@ package TeXLive::TLPDB; =pod + =head1 NAME C<TeXLive::TLPDB> -- A database of TeX Live Packages @@ -24,6 +25,7 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages $tlpdb->writeout; $tlpdb->writeout(FILEHANDLE); $tlpdb->save; + $tlpdb->available_architectures(); $tlpdb->add_objpkg($tlpobj); $tlpdb->get_package("packagename"); $tlpdb->list_packages; @@ -165,6 +167,24 @@ sub save { =pod +=item C<< $tlpdb->available_architectures >> + +The C<available_architectures> functions returns the list of available +architectures by checking for binfiles in the "bin-tex" TLPOBJ. If this +package does not exist, die. + +=cut + +sub available_architectures { + my $self = shift; + my $bintex = $self->get_package("bin-tex"); + die "TLPDB->available_architectures: no bin-tex packages, huuu?" + if (not(defined($bintex))); + return keys(%{$bintex->binfiles}); +} + +=pod + =item C<< $tlpdb->get_package("packagename") >> The C<get_package> function returns a reference to a C<TLPOBJ> object diff --git a/Master/tlpkg/TeXLive/TLTREE.pm b/Master/tlpkg/TeXLive/TLTREE.pm index 01c56cdfa25..652894ef06b 100644 --- a/Master/tlpkg/TeXLive/TLTREE.pm +++ b/Master/tlpkg/TeXLive/TLTREE.pm @@ -18,6 +18,7 @@ sub new { my %params = @_; my $self = { svnroot => $params{'svnroot'}, + archs => $params{'archs'}, # private stuff _allfiles => {}, _dirtree => {}, @@ -55,6 +56,7 @@ sub init_from_files { sub _initialize_lines { my $self = shift; my @lines = @_; + my %archs; # we first chdir to the svn root, we need it for file tests my $oldpwd = `pwd`; chomp($oldpwd); @@ -66,6 +68,10 @@ sub _initialize_lines { my $lastchanged = ($8 eq "?" ? 1 : $8); my $entry = "$10"; next if -d $entry; # TODO: what to do with links??? + # collect architectures + if ($entry =~ m,Master/bin/(.*)/tex.*$,) { + $archs{$1} = 1; + } $self->{'_allfiles'}{$entry}{'lastchangedrev'} = $lastchanged; $self->{'_allfiles'}{$entry}{'size'} = (lstat $entry)[7]; my $fn = TeXLive::TLUtils::basename($entry); @@ -77,6 +83,8 @@ sub _initialize_lines { #die("Cannot read svn status output line:\n $l\n"); } } + # save list of architectures + $self->archs(keys(%archs)); # now do some magic # - create list of top level dirs with a list of full path names of # the respective dir attached @@ -311,6 +319,12 @@ sub architectures { if (@_) { @Architectures = @_ } return @Architectures; } +sub archs { + my $self = shift; + if (@_) { @{ $self->{'archs'} } = @_ } + return @{ $self->{'archs'} }; +} + 1; |