summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-06 17:34:06 +0000
committerNorbert Preining <preining@logic.at>2007-11-06 17:34:06 +0000
commit019dcae3879d68beab6c736fe63e90f2e4e77f0c (patch)
tree6fc707c7a43d14f7c5dd57cecd72be2d1a302b4a
parent3f1d85a5192dc2b66772fa9cb114b8b6a9cb2c6e (diff)
- change TLPOBJ->make_zip to take a simple path instead of a TLTREE as first
argument, it is not necessary - add a new program tlpdb2zip which generates zip files for all/specified packages git-svn-id: svn://tug.org/texlive/trunk@5371 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm18
-rwxr-xr-xMaster/tlpkg/bin/tlpdb2zip91
-rwxr-xr-xMaster/tlpkg/bin/tlpsrc2zip2
3 files changed, 102 insertions, 9 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 2de48ace3b5..dcd22ff99eb 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -353,7 +353,7 @@ sub writeout_simple {
sub make_zip {
- my ($self,$tltree,$destdir,$zipname) = @_;
+ my ($self,$instroot,$destdir,$zipname) = @_;
my $zipn;
if (not(defined($zipname))) {
$zipname = $self->name . ".zip";
@@ -361,9 +361,9 @@ sub make_zip {
if (not(defined($destdir))) {
$destdir = TeXLive::TLPOBJ->zipdir;
}
- die("Undefined tltree argument!") if (not(defined($tltree)));
+ die("Undefined instroot argument!") if (not(defined($instroot)));
# first build the arch independent part
- $self->_make_zip($tltree,$destdir,$zipname,"all");
+ $self->_make_zip($instroot,$destdir,$zipname,"all");
# now the $pkg.$arch.zip
if ($self->is_arch_dependent) {
foreach my $t (keys %{$self->{'binfiles'}}) {
@@ -373,14 +373,13 @@ sub make_zip {
} else {
$zipn = "$zipname.$t.zip";
}
- $self->_make_zip($tltree,$destdir,$zipn,$t);
+ $self->_make_zip($instroot,$destdir,$zipn,$t);
}
}
}
sub _make_zip {
- my ($self,$tltree,$destdir,$zipname,$arch) = @_;
- my $root = $tltree->svnroot;
+ my ($self,$instroot,$destdir,$zipname,$arch) = @_;
my @files = ();
my $zipcmd;
if ($arch ne "all") {
@@ -414,7 +413,7 @@ sub _make_zip {
$destdir = "$cwd/$destdir";
}
&mkpath("$destdir") if (! -d "$destdir");
- chdir($tltree->svnroot);
+ chdir($instroot);
if ($arch eq "all") {
# we add the .tlpobj into the .tlpobj directory
my $removetlpobjdir = 0;
@@ -909,7 +908,7 @@ or the filehandle if given:
debugging function for comparison with C<tpm>/C<tlps>, will go away.
-=item C<make_zip($tltree[, $destdir[, $zipname]])>
+=item C<make_zip($instroot[, $destdir[, $zipname]])>
creates a zip file of the arch B<independent> files in the C<TLPOBJ>
in C<$destdir> (if not defined then C<< TLPOBJ->zipdir >> is used).
@@ -924,6 +923,9 @@ All the arch independent zip files B<also> contain the respective
C<TLPOBJ> file in C<.tlpobj/$name.tlpobj> so C<$zipname.zip> does
contain this tlpobj file, while C<$zipname.$arch.zip> does NOT.
+The argument C<$instroot> specifies the root of the installation from
+which the files should be taken.
+
=item C<recompute_sizes($tltree)>
recomputes the sizes based on the information present in C<$tltree>.
diff --git a/Master/tlpkg/bin/tlpdb2zip b/Master/tlpkg/bin/tlpdb2zip
new file mode 100755
index 00000000000..d74cabb5a97
--- /dev/null
+++ b/Master/tlpkg/bin/tlpdb2zip
@@ -0,0 +1,91 @@
+#!/usr/bin/env perl
+# $Id: tlpdb2zip 5188 2007-10-14 20:32:44Z karl $
+# Copyright 2007 Norbert Preining
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+# Generate a zip file for the packages specified on the cmdline, or
+# for -all
+
+BEGIN {
+ $^W = 1;
+ ($mydir = $0) =~ s,/[^/]*$,,;
+ unshift (@INC, "$mydir/..");
+}
+
+use strict;
+
+use TeXLive::TLPOBJ;
+use TeXLive::TLPDB;
+use Getopt::Long;
+use Pod::Usage;
+use File::Path;
+
+my $opt_all = 0;
+our $mydir;
+our $opt_debug = 0;
+my $opt_outputdir = "./zip";
+my $help = 0;
+
+GetOptions("outputdir=s", "all!", "debug!", "help|?" => \$help) or pod2usage(1);
+
+pod2usage(-exitstatus => 0, -verbose => 2) if $help;
+
+exit (&main ());
+
+sub main
+{
+ # get the db.
+ chomp (my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default
+ my $tlpdb_path = "$Master/texlive.tlpdb";
+ my $tlpdb = TeXLive::TLPDB->new ("location" => $tlpdb_path);
+
+ my @packs;
+ if ($opt_all) {
+ @packs = $tlpdb->list_packages;
+ } else {
+ @packs = @ARGV;
+ }
+ # get list of packages.
+ my %maps;
+ for my $pkg (@packs) {
+ my $obj = $tlpdb->get_package ($pkg);
+ die "$0: no TeX Live package named $pkg in $tlpdb_path.\n" if ! $obj;
+ $obj->make_zip($Master,$opt_outputdir);
+ }
+}
+
+
+
+__END__
+
+=head1 NAME
+
+tlpdb2zip - generate zip files from an installation
+
+=head1 SYNOPSIS
+
+tlpdb2zip [OPTION]...
+
+=head1 OPTIONS
+
+The standard options C<-help> and C<-debug> are accepted.
+See the tlpfiles documentation for details.
+
+=head1 DESCRIPTION
+
+
+=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: #
diff --git a/Master/tlpkg/bin/tlpsrc2zip b/Master/tlpkg/bin/tlpsrc2zip
index ed4c2db3a9d..50d4f715088 100755
--- a/Master/tlpkg/bin/tlpsrc2zip
+++ b/Master/tlpkg/bin/tlpsrc2zip
@@ -96,7 +96,7 @@ sub main
$tlp->update_from_catalogue ($tlc);
}
- $tlp->make_zip($tltree,$opt_outputdir);
+ $tlp->make_zip($opt_master,$opt_outputdir);
}
warn "\n";