diff options
author | Norbert Preining <preining@logic.at> | 2007-10-18 05:20:00 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-10-18 05:20:00 +0000 |
commit | 13ef27983d15dfd066b507cc4c11ece10c111417 (patch) | |
tree | 0f3f1e02d8e3e4e9ccd386003f03af9a0a650739 /Master | |
parent | fa80b1bc352f0e2c84257074f7e7f0317b4199ef (diff) |
new module TLConfig and use it
git-svn-id: svn://tug.org/texlive/trunk@5224 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLConfig.pm | 100 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 3 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPOBJ.pm | 16 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPSRC.pm | 10 |
4 files changed, 120 insertions, 9 deletions
diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm new file mode 100644 index 00000000000..8edac0d3517 --- /dev/null +++ b/Master/tlpkg/TeXLive/TLConfig.pm @@ -0,0 +1,100 @@ +# $Id: TLConfig.pm 5044 2007-09-25 18:34:12Z karl $ +# TeXLive::TLConfig.pm - module exporting configuration stuff +# Copyright 2007 Norbert Preining +# This file is licensed under the GNU General Public License version 2 +# or any later version. + +package TeXLive::TLConfig; + +BEGIN { + use Exporter (); + use vars qw( @ISA @EXPORT_OK ); + @ISA = qw(Exporter); + @EXPORT_OK = qw( + @MetaCategories + @NormalCategories + @Categories + $CategoriesRegexp + $DefaultCategory + ); +} + +# Meta Categories do not ship files, but call only for other packages +our @MetaCategories = qw/Collection Scheme/; +# Normal Categories contain actial files and do not depend on other things. +our @NormalCategories = qw/Package TLCore Documentation/; + +# list of all Categories +our @Categories = (@MetaCategories, @NormalCategories); + +our $CategoriesRegexp = '(Collection|Scheme|Package|TLCore|Documentation)'; + +our $DefaultCategory = "Package"; + +1; + + +=head1 NAME + +C<TeXLive::TLConfig> -- TeX Live Configurations + +=head1 SYNOPSIS + + use TeXLive::TLConfig; + +=head1 DESCRIPTION + +The L<TeXLive::TLConfig> module contains definitions of variables +configuring all of TeX Live. + +=over 6 + +=head1 EXPORTED VARIABLES + +All of the following variables can be pulled into the callers namespace +(i.e., are declared EXPORT_OK). + +=item C<@TeXLive::TLConfig::MetaCategories> + +The list of meta categories, i.e., those categories whose packages only +depend on other packages, but don't ship any files. Currently +C<Collection> and <Scheme>. + +=item C<@TeXLive::TLConfig::NormalCategories> + +The list of normal categories, i.e., those categories whose packages do +ship files. Currently C<TLCore>, C<Documentation>, C<Package>. + +=item C<@TeXLive::TLConfig::Categories> + +The list of all categories, i.e., the union of the above. + +=item C<$TeXLive::TLConfig::CategoriesRegexp> + +A regexp matching any category. + +=item C<$TeXLive::TLConfig::DefaultCategory> + +The default category used when creating new packages. + +=back + +=head1 SEE ALSO + +The modules L<TeXLive::TLUtils>, L<TeXLive::TLPSRC>, +L<TeXLive::TLPDB>, L<TeXLive::TLTREE>, L<TeXLive::TeXCatalogue>. + +=head1 AUTHORS AND COPYRIGHT + +This script and its documentation were written for the TeX Live +distribution (L<http://tug.org/texlive>) and both are licensed under the +GNU General Public License Version 2 or later. + +=cut + +### Local Variables: +### perl-indent-level: 2 +### tab-width: 2 +### indent-tabs-mode: nil +### End: +# vim:set tabstop=2 expandtab: # diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 183ea35c93d..e90124f57f0 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -36,6 +36,7 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages =cut +use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory); use TeXLive::TLUtils; use TeXLive::TLPOBJ; @@ -241,6 +242,7 @@ installers. This function will probably go away. sub generate_listfiles { my ($self,$destdir) = @_; + die "NEEDS TO BE REWRITTEN USING TLConfig!!!\n"; if (not(defined($destdir))) { $destdir = TeXLive::TLPDB->listdir; } @@ -273,6 +275,7 @@ sub _generate_listfile { &mkpath("$destdir") if (! -d "$destdir"); my (@lop, @lot); foreach my $d ($tlp->depends) { + die "NEED TO BE ADJUSTED\n"; if ($d =~ m/^(Package|Documentation|TLCore)\/(.*)$/) { push @lop, $2; } elsif ($d =~ m/^Collection\/(.*)$/) { diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index 21614f12f36..d964b4177d3 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -6,8 +6,8 @@ package TeXLive::TLPOBJ; +use TeXLive::TLConfig qw($DefaultCategory $CategoriesRegexp); use TeXLive::TLUtils; -#use TeXLive::TeXCatalogue; -- we only want to require XML::DOM at update time. use File::Path; use Cwd; use TeXLive::TLTREE; @@ -23,7 +23,7 @@ sub new { my %params = @_; my $self = { name => $params{'name'}, - category => defined($params{'category'}) ? $params{'category'} : "Package", + category => defined($params{'category'}) ? $params{'category'} : $DefaultCategory, shortdesc => $params{'shortdesc'}, longdesc => $params{'longdesc'}, catalogue => $params{'catalogue'}, @@ -109,7 +109,7 @@ sub from_fh { } $lastcmd = "longdesc"; next; - } elsif ($line =~ /^category\s+(Scheme|Collection|Package|TLCore|Documentation)$/) { + } elsif ($line =~ /^category\s+$CategoriesRegexp$/) { $self->{'category'} = "$1"; $lastcmd = "category"; next; @@ -484,8 +484,14 @@ sub update_from_catalogue { if (defined($entry->version)) { $self->cataloguedata->{'version'} = $entry->version; } - if (defined($entry->url)) { - $self->cataloguedata->{'url'} = $entry->url; + if (defined($entry->ctan)) { + $self->cataloguedata->{'ctan'} = $entry->ctan; + } + if (defined($entry->caption)) { + $self->{'shortdesc'} = $entry->caption; + } + if (defined($entry->description)) { + $self->{'longdesc'} = $entry->description; } # # we need to do the following: diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm index 22c0d077b08..f1afcbdc550 100644 --- a/Master/tlpkg/TeXLive/TLPSRC.pm +++ b/Master/tlpkg/TeXLive/TLPSRC.pm @@ -8,6 +8,7 @@ package TeXLive::TLPSRC; use FileHandle; +use TeXLive::TLConfig qw($CategoriesRegexp); use TeXLive::TLPOBJ; use TeXLive::TLTREE; @@ -19,7 +20,7 @@ sub new my %params = @_; my $self = { name => $params{'name'}, - category => defined($params{'category'}) ? $params{'category'} : "Package", + category => defined($params{'category'}) ? $params{'category'} : $DefaultCategory, shortdesc => $params{'shortdesc'}, longdesc => $params{'longdesc'}, catalogue => $params{'catalogue'}, @@ -86,7 +87,7 @@ sub from_file if ($line =~ /^shortdesc\s*(.*)$/) { $shortdesc = "$1"; next; - } elsif ($line =~ /^category\s+(Collection|Scheme|Package|TLCore|Documentation)$/) { + } elsif ($line =~ /^category\s+$CategoriesRegexp$/) { $category = "$1"; next; } elsif ($line =~ /^longdesc\s+(.*)$/) { @@ -449,7 +450,8 @@ identifies the package, C<value> must consist only of C<[-_a-zA-Z0-9]>. =item C<category> identifies the category into which this package belongs. Possible categories -are C<Collection>, C<Scheme>, C<TLCore>, C<Documentation>, C<Package>. +are defined in C<TeXLive::TLConfig>, but are currently +C<Collection>, C<Scheme>, C<TLCore>, C<Documentation>, C<Package>. Note that there is no inherent checking whether a C<tlpsrc> file called C<collection-something> actually belongs to the category C<Collection>. Most packages will fall into the C<Package> category. @@ -683,7 +685,7 @@ enrich it which the actual content from C<$tltree> to a C<TLPOBJ> object. =head1 SEE ALSO -The modules L<TeXLive::TLUtils>, L<TeXLive::TLPOBJ>, +The modules L<TeXLive::TLConfig>, L<TeXLive::TLUtils>, L<TeXLive::TLPOBJ>, L<TeXLive::TLPDB>, L<TeXLive::TLTREE>. =head1 AUTHORS AND COPYRIGHT |