diff options
author | Norbert Preining <preining@logic.at> | 2007-11-06 17:34:06 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-11-06 17:34:06 +0000 |
commit | 019dcae3879d68beab6c736fe63e90f2e4e77f0c (patch) | |
tree | 6fc707c7a43d14f7c5dd57cecd72be2d1a302b4a /Master/tlpkg/bin | |
parent | 3f1d85a5192dc2b66772fa9cb114b8b6a9cb2c6e (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
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-x | Master/tlpkg/bin/tlpdb2zip | 91 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpsrc2zip | 2 |
2 files changed, 92 insertions, 1 deletions
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"; |