summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-12-23 21:38:57 +0000
committerNorbert Preining <preining@logic.at>2007-12-23 21:38:57 +0000
commite8d394853e5aa3f38f3767070afb6f60624132b0 (patch)
tree46d35ce5fa68243b59b3edb5144072f1fa3f1dd3 /Master/tlpkg/TeXLive
parent4852626f4cf33604cd1fb3f3e6a910ef3c79944e (diff)
src and doc splitting
options setting via texlive.config meta package update texlive.tlpdb for that git-svn-id: svn://tug.org/texlive/trunk@5846 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm93
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm33
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm2
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm32
4 files changed, 144 insertions, 16 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 0fb2400518b..3e5c6e482cb 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -35,6 +35,9 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages
$tlpdb->language_dat_lines;
$tlpdb->package_revision("packagename");
$tlpdb->location;
+ $tlpdb->config_src_container;
+ $tlpdb->config_doc_container;
+ $tlpdb->config_container_format;
TeXLive::TLPDB->listdir([$dir]);
$tlpdb->generate_listfiles([$destdir]);
@@ -497,23 +500,78 @@ sub location {
=pod
-
-=pod
-
=item C<< $tlpdb->listdir >>
The function C<listdir> allows to read and set the packages variable
specifiying where generated list files are created.
=cut
+
sub listdir {
my $self = shift;
if (@_) { $_listdir = $_[0] }
return $_listdir;
}
-=back
+=pod
+
+=item C<< $tlpdb->config_src_container >>
+Returns 1 if the the texlive config option for src files splitting on
+container level is set. See Options below.
+
+=cut
+
+sub config_src_container {
+ my $self = shift;
+ if (defined($self->{'tlps'}{'texlive.config'})) {
+ foreach my $d ($self->{'tlps'}{'texlive.config'}->depends) {
+ if ($d eq "container_split_src_files") {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+=item C<< $tlpdb->config_doc_container >>
+
+Returns 1 if the the texlive config option for doc files splitting on
+container level is set. See Options below.
+
+=cut
+
+sub config_doc_container {
+ my $self = shift;
+ if (defined($self->{'tlps'}{'texlive.config'})) {
+ foreach my $d ($self->{'tlps'}{'texlive.config'}->depends) {
+ if ($d eq "container_split_doc_files") {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+=item C<< $tlpdb->config_doc_container >>
+
+Returns the currently set default container format. See Options below.
+
+=cut
+
+sub config_container_format {
+ my $self = shift;
+ if (defined($self->{'tlps'}{'texlive.config'})) {
+ foreach my $d ($self->{'tlps'}{'texlive.config'}->depends) {
+ if ($d =~ m!^container_format/(.*)$!) {
+ return "$1";
+ }
+ }
+ }
+ return "";
+}
+
+=pod
=item C<< $tlpdb->fmtutil_cnf_lines >>
@@ -627,6 +685,33 @@ sub language_dat_lines {
=pod
+=head1 OPTIONS
+
+Options regarding the full TeX Live installation to be described are saved
+in a package C<texlive.config> as values of C<depend> lines. This special
+package C<texlive.config> does not contain any files, only depend lines
+which set one or more of the following options:
+
+=over 6
+
+=item C<container_split_src_files>
+
+=item C<container_split_doc_files>
+
+These options specify that at container generation time the source and
+documentation files for a package have been put into a separate container
+named C<package.source.extension> and C<package.doc.extension>.
+
+=item C<container_format/I<format>>
+
+This option specifies a format for containers. The currently supported
+formats are C<lzma> and C<zip>. But note that C<zip> is untested.
+
+=back
+
+To set these options the respective lines should be added to
+C<texlive.config.tlpsrc>.
+
=head1 SEE ALSO
The modules L<TeXLive::TLPSRC>, L<TeXLive::TLPOBJ>,
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index e44bf2c2543..0d2fdea3af1 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -512,10 +512,6 @@ sub make_container {
$nul = "/dev/null";
}
@files = TeXLive::TLUtils::sort_uniq(@files);
- if (!@files) {
- &TeXLive::TLUtils::debug("Not creating empty container file for $containername");
- return;
- }
# we do relative packages ONLY if the files do NOT span multiple
# texmf trees. check this here
my $tltree;
@@ -694,17 +690,32 @@ sub is_meta_package {
return 0;
}
+sub split_doc_package {
+ my $self = shift;
+ if (not($self->docfiles)) { return ; }
+ my $tlp = new TeXLive::TLPOBJ;
+ $tlp->name($self->name . ".doc");
+ $tlp->shortdesc("doc files of " . $self->name);
+ $tlp->revision($self->revision);
+ $tlp->category($self->category);
+ $tlp->add_docfiles($self->docfiles);
+ $tlp->docsize($self->docsize);
+ $self->clear_docfiles();
+ $self->docsize(0);
+ return($tlp);
+}
+
sub split_src_package {
my $self = shift;
if (not($self->srcfiles)) { return ; }
my $tlp = new TeXLive::TLPOBJ;
- $tlp->name($self->name . ".SOURCES");
+ $tlp->name($self->name . ".source");
$tlp->shortdesc("source files of " . $self->name);
$tlp->revision($self->revision);
$tlp->category($self->category);
$tlp->add_srcfiles($self->srcfiles);
$tlp->srcsize($self->srcsize);
- $self->clearsrcfiles();
+ $self->clear_srcfiles();
$self->srcsize(0);
return($tlp);
}
@@ -726,7 +737,7 @@ sub split_bin_package {
if (keys(%binf)) {
push @{$self->{'depends'}}, $self->name . ".ARCH";
}
- $self->clearbinfiles();
+ $self->clear_binfiles();
return(@retlist);
}
@@ -822,7 +833,7 @@ sub srcsize {
if (@_) { $self->{'srcsize'} = shift }
return ( defined($self->{'srcsize'}) ? $self->{'srcsize'} : 0 );
}
-sub clearsrcfiles {
+sub clear_srcfiles {
my $self = shift;
$self->{'srcfiles'} = [ ] ;
}
@@ -839,7 +850,7 @@ sub docfiles {
if (@_) { $self->{'docfiles'} = [ @_ ] }
return @{ $self->{'docfiles'} };
}
-sub cleardocfiles {
+sub clear_docfiles {
my $self = shift;
$self->{'docfiles'} = [ ] ;
}
@@ -862,7 +873,7 @@ sub binfiles {
if (@_) { $self->{'binfiles'} = \%newfiles }
return $self->{'binfiles'};
}
-sub clearbinfiles {
+sub clear_binfiles {
my $self = shift;
$self->{'binfiles'} = { };
}
@@ -891,7 +902,7 @@ sub runfiles {
if (@_) { $self->{'runfiles'} = [ @_ ] }
return @{ $self->{'runfiles'} };
}
-sub clearrunfiles {
+sub clear_runfiles {
my $self = shift;
$self->{'runfiles'} = [ ] ;
}
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index 646b9dd32b2..e0ed89aaee5 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -78,7 +78,7 @@ sub from_file
if ($line =~ /^ /) {
die "$srcfile: continuation line not allowed in tlpsrc: $line\n";
}
- if ($line =~ /^name\s*([-\w]+)$/) {
+ if ($line =~ /^name\s*([-\w]+|texlive\.config)$/) {
$name = "$1";
$started && die("$srcfile: tlpsrc cannot have two name directives");
$started = 1;
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 52b8443b64c..4e14b054cd0 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -499,6 +499,8 @@ installed (currently implemented only for installation from DVD).
sub install_packages {
my ($fromtlpdb,$totlpdb,$what,$netarchs,$opt_src,$opt_doc) = @_;
+ my $container_src_split = $fromtlpdb->config_src_container;
+ my $container_doc_split = $fromtlpdb->config_doc_container;
foreach my $package (@$what) {
print "INSTALL $package\n";
my $tlpobj=$fromtlpdb->get_package($package);
@@ -540,6 +542,35 @@ sub install_packages {
$container = "$::texlive_url/$::netarchive/$package.$DefaultContainerExtension";
}
install_package($container,\@installfiles,$totlpdb->root,$vars{'this_platform'});
+ # if we are installing from CD or NET we have to fetch the respective
+ # source and doc packages $pkg.source and $pkg.doc and install them, too
+ if ((&media eq 'NET') || (&media eq 'CD')) {
+ # we install split containers under the following conditions:
+ # - the container were split generated
+ # - src/doc files should be installed
+ # - the package is not already a split one (like .i386-linux)
+ # - there are actually src/doc files present
+ if ($container_src_split && $opt_src &&
+ ($package !~ m/\./) && $tlpobj->srcfiles) {
+ my $srccontainer = $container;
+ $srccontainer =~ s/(.tar.lzma|.zip)/.source$1/;
+ install_package($srccontainer,\@installfiles,$totlpdb->root,$vars{'this_platform'});
+ }
+ if ($container_doc_split && $opt_doc &&
+ ($package !~ m/\./) && $tlpobj->docfiles) {
+ my $doccontainer = $container;
+ $doccontainer =~ s/(.tar.lzma|.zip)/.doc$1/;
+ install_package($doccontainer,\@installfiles,$totlpdb->root,$vars{'this_platform'});
+ }
+ }
+ # we don't want to have wrong information in the tlpdb, so remove the
+ # src/doc files if they are not installed ...
+ if (!$opt_src) {
+ $tlpobj->clear_srcfiles;
+ }
+ if (!$opt_doc) {
+ $tlpobj->clear_docfiles;
+ }
$totlpdb->add_tlpobj($tlpobj);
}
$totlpdb->save;
@@ -807,6 +838,7 @@ sub additional_architectures_available_from_net {
while (<WGET>) {
chop;
my $line=$_;
+ push @::pkgverlines,$line;
next unless /-1$/;
($platform, undef)=split " ", $line;
unless (defined $vars->{"diskbin_$platform"}) {