diff options
author | Norbert Preining <preining@logic.at> | 2007-11-12 15:17:48 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-11-12 15:17:48 +0000 |
commit | 898e6800b1731128534e7ee8e1b54e836d425b62 (patch) | |
tree | 6fd6f30692a8cae1fec2a92c8f1ea1c61f61151d /Master | |
parent | c9f9a5d52d853d226984e92cdc88ebf4773935bb (diff) |
call it make_container, not make_zip
git-svn-id: svn://tug.org/texlive/trunk@5411 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPOBJ.pm | 73 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpdb2container (renamed from Master/tlpkg/bin/tlpdb2zip) | 10 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpsrc2zip | 32 | ||||
-rw-r--r-- | Master/tlpkg/man/TeXLive-TLPOBJ.1 | 30 |
4 files changed, 80 insertions, 65 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index e51421d8bbf..0a3b47e8daa 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -16,7 +16,7 @@ use Text::ParseWords; use File::Basename; my $_tmp; -my $_zipdir; +my $_containerdir; sub new { my $class = shift; @@ -41,7 +41,7 @@ sub new { revision => $params{'revision'}, cataloguedata => defined($params{'cataloguedata'}) ? $params{'cataloguedata'} : {}, }; - $_zipdir = $params{'zipdir'} if defined($params{'zipdir'}); + $_containerdir = $params{'containerdir'} if defined($params{'containerdir'}); bless $self, $class; return $self; } @@ -356,31 +356,30 @@ sub writeout_simple { } } -sub make_zip { - my ($self,$type,$instroot,$destdir,$zipname) = @_; - my $zipn; - if (not(defined($zipname))) { - $zipname = $self->name; +sub make_container { + my ($self,$type,$instroot,$destdir,$containername) = @_; + if (not(defined($containername))) { + $containername = $self->name; } if (not(defined($destdir))) { - $destdir = TeXLive::TLPOBJ->zipdir; + $destdir = TeXLive::TLPOBJ->containerdir; } die("Undefined instroot argument!") if (not(defined($instroot))); # first build the arch independent part - $self->_make_zip($type,$instroot,$destdir,$zipname,"all"); + $self->_make_container($type,$instroot,$destdir,$containername,"all"); # now the $pkg.$arch.zip if ($self->is_arch_dependent) { foreach my $t (keys %{$self->{'binfiles'}}) { &TeXLive::TLUtils::debug("arch=$t"); - $self->_make_zip($type,$instroot,$destdir,"$zipname.$t",$t); + $self->_make_container($type,$instroot,$destdir,"$containername.$t",$t); } } } -sub _make_zip { - my ($self,$type,$instroot,$destdir,$zipname,$arch) = @_; +sub _make_container { + my ($self,$type,$instroot,$destdir,$containername,$arch) = @_; my @files = (); - my $zipcmd; + my $compresscmd; my $tlpobjdir = "$InfraLocation/tlpobj"; if ($arch ne "all") { push @files, @{$self->{'binfiles'}{$arch}}; @@ -402,12 +401,12 @@ sub _make_zip { } @files = TeXLive::TLUtils::sort_uniq(@files); if (!@files) { - &TeXLive::TLUtils::debug("Not creating empty container file for $zipname"); + &TeXLive::TLUtils::debug("Not creating empty container file for $containername"); return; } my $cwd = &getcwd; if ("$destdir" !~ m@^/@) { - # we have an relative zipdir, so we have to make it absolute + # we have an relative containerdir, so we have to make it absolute $destdir = "$cwd/$destdir"; } &mkpath("$destdir") if (! -d "$destdir"); @@ -427,19 +426,19 @@ sub _make_zip { if ($type eq "zip") { $zipname .= ".zip"; if ($^O =~ /MSWin32/) { - $zipcmd = "| zip -9\@or $destdir/$zipname > $nul" + $compresscmd = "| zip -9\@or $destdir/$zipname > $nul" } else { - $zipcmd = "| zip -9\@ory $destdir/$zipname > $nul" + $compresscmd = "| zip -9\@ory $destdir/$zipname > $nul" } } elsif ($type eq "lzma") { - $zipname .= ".tar.lzma"; - $zipcmd = "| tar --create --files-from=- | lzma -c > $destdir/$zipname "; + $containername .= ".tar.lzma"; + $compresscmd = "| tar --create --files-from=- | lzma -c > $destdir/$containername "; } else { die("Container method $type unknown!\n"); } - unlink($zipname); - print "$zipcmd\n" if ($::opt_debug); - open ZIP, $zipcmd ; + unlink("$destdir/$containername"); + print "$compresscmd\n" if ($::opt_debug); + open ZIP, $compresscmd ; map { if (! -f $_) { print STDERR "!!!Error: non-existent $_\n"; @@ -454,7 +453,7 @@ sub _make_zip { rmdir("$tlpobjdir") if $removetlpobjdir; } chdir($cwd); - print "Done $zipname\n" if ($::opt_debug); + print "Done $containername\n" if ($::opt_debug); } sub is_arch_dependent { @@ -723,10 +722,10 @@ sub executes { if (@_) { @{ $self->{'executes'} } = @_ } return @{ $self->{'executes'} }; } -sub zipdir { +sub containerdir { my @self = shift; - if (@_) { $_zipdir = $_[0] } - return $_zipdir; + if (@_) { $_containerdir = $_[0] } + return $_containerdir; } sub cataloguedata { my $self = shift; @@ -836,10 +835,10 @@ with C<|> characters inserted to show the indentation: =head1 PACKAGE VARIABLES -TeXLive::TLPOBJ has one package wide variable which is C<zipdir> where -generated zip files are saved (if not otherwise specified. +TeXLive::TLPOBJ has one package wide variable which is C<containerdir> where +generated container files are saved (if not otherwise specified. - TeXLive::TLPOBJ->zipdir("path/to/zip/dir"); + TeXLive::TLPOBJ->containerdir("path/to/container/dir"); =head1 MEMBER ACCESS FUNCTIONS @@ -919,27 +918,27 @@ or the filehandle if given: debugging function for comparison with C<tpm>/C<tlps>, will go away. -=item C<make_zip($type,$instroot[, $destdir[, $zipname]])> +=item C<make_container($type,$instroot[, $destdir[, $containername]])> creates a container file of the arch B<independent> files in the C<TLPOBJ> -in C<$destdir> (if not defined then C<< TLPOBJ->zipdir >> is used). +in C<$destdir> (if not defined then C<< TLPOBJ->containerdir >> is used). The C<$type> variable specifies the type of container to be used. Currently only C<zip> or C<lzma> are allowed, and are generating zip files and tar.lzma files, respectively. -The file name of the created container file is C<$zipname.extension>, +The file name of the created container file is C<$containername.extension>, where extension is either C<.zip> or C<.tar.lzma>, depending on the -setting of C<$type>. If no C<$zipname> is specified the package name +setting of C<$type>. If no C<$containername> is specified the package name is used. If the package contains C<"binfiles">, then container files for all archs containing B<only> the binfiles are created, and -those container files name is C<$zipname.$arch.$extension> +those container files name is C<$containername.$arch.$extension> -All the arch independent zip files B<also> contain the respective -C<TLPOBJ> file in C<tlpkg/tlpobj/$name.tlpobj> so C<$zipname.$extension> does -contain this tlpobj file, while C<$zipname.$arch.$extension> does NOT. +All the arch independent container files B<also> contain the respective +C<TLPOBJ> file in C<tlpkg/tlpobj/$name.tlpobj> so C<$containername.$extension> does +contain this tlpobj file, while C<$containername.$arch.$extension> does NOT. The argument C<$instroot> specifies the root of the installation from which the files should be taken. diff --git a/Master/tlpkg/bin/tlpdb2zip b/Master/tlpkg/bin/tlpdb2container index 83393e64cde..6467ec84e2d 100755 --- a/Master/tlpkg/bin/tlpdb2zip +++ b/Master/tlpkg/bin/tlpdb2container @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: tlpdb2zip 5188 2007-10-14 20:32:44Z karl $ +# $Id: tlpdb2container 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. @@ -55,7 +55,7 @@ sub main 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($opt_type,$Master,$opt_outputdir); + $obj->make_container($opt_type,$Master,$opt_outputdir); } } @@ -65,11 +65,11 @@ __END__ =head1 NAME -tlpdb2zip - generate container files (zip,tar.lzma) of a package +tlpdb2container - generate container files (zip,tar.lzma) of a package =head1 SYNOPSIS -tlpdb2zip [OPTION]... +tlpdb2container [OPTION]... =head1 OPTIONS @@ -97,7 +97,7 @@ To distribute packages over the network and on installation media the packages are wrapped into container files. These container are either simple zip files or tar.lzma file containing all the files of the package. -B<tlpdb2zip> generates container files from a TeX Live Database and the +B<tlpdb2container> generates container files from a TeX Live Database and the respective installation. =head1 AUTHORS AND COPYRIGHT diff --git a/Master/tlpkg/bin/tlpsrc2zip b/Master/tlpkg/bin/tlpsrc2zip index 50d4f715088..51f5f3400bf 100755 --- a/Master/tlpkg/bin/tlpsrc2zip +++ b/Master/tlpkg/bin/tlpsrc2zip @@ -26,6 +26,7 @@ use File::Path; my $opt_all = 0; chomp (my $opt_master = `cd $::mydir/../.. && pwd`); my $opt_catalogue = ""; +my $opt_type = "zip"; my $opt_outputdir = "./zip"; our $opt_debug = 0; my $help = 0; @@ -35,6 +36,7 @@ GetOptions( "master=s" => \$opt_master, # location of the tree "catalogue=s" => \$opt_catalogue, # location of the TeX Catalogue "outputdir=s" => \$opt_outputdir, + "type=s" => \$opt_type, "debug!", "help|?" => \$help) or pod2usage(1); pod2usage(-exitstatus => 0, -verbose => 2) if $help; @@ -96,7 +98,7 @@ sub main $tlp->update_from_catalogue ($tlc); } - $tlp->make_zip($opt_master,$opt_outputdir); + $tlp->make_container($opt_type,$opt_master,$opt_outputdir); } warn "\n"; @@ -111,7 +113,7 @@ tlpsrc2zip - create zip file(s) from tlpsrc files =head1 SYNOPSIS -tlpsrc2zip [OPTION]... [TLPSRC]... +tlpsrc2container [OPTION]... [TLPSRC]... =head1 OPTIONS @@ -120,29 +122,41 @@ tlpsrc2zip [OPTION]... [TLPSRC]... =item B<-all> Generate zip files for all .tlpsrc files in C<Master/tlpkg/tlpsrc/*.tlpsrc>. +=item B<-outputdir> I<outputdir> +The location where created container files are placed, defaults to ./zip. + =item B<-master> I<Master_dir> The location given by B<-master> must point to a valid svn repository of TeX Live Master direcory. Defaults to C<../..> of C<$0>. -=item B<-outputdir> I<output_dir> -Specifies the location where zip files are created. Defaults to C<./zip>. +=item B<-catalogue> I<Catalogue_dir> +The location given by B<-catalogue> must point to a valid TeX Catalogue. +No default value. If given, the included tlpobj files will contain information +gathered from the TeX Catalogue. + +=item B<-type> I<zip|lzma> +Specifies the type of container to be used. C<zip> generates zip files, +while C<lzma> generates .tar.lzma files. =back The standard options C<-help> and C<-debug> are also accepted. See the tlpfiles documentation for details. + =head1 DESCRIPTION -B<tlpsrc2zip> converts TeX Live Package Source files (tlpsrc) into zip -files containing all the files in the package. +To distribute packages over the network and on installation media the +packages are wrapped into container files. These container are either +simple zip files or tar.lzma file containing all the files of the package. + +B<tlpsrc2container> converts TeX Live Package Source files (tlpsrc) into +container files containing all the files in the package. If a TeX Catalogue hierarchy is specified, additional information from the catalogue are merged into the database (see L<TeXLive::TLPOBJ> for the list of included information from the TeX Catalogue). -Note that a copy of the created TeX Live Package Object file (.tlpobj) -is always included in the zip file in .tlpobj/NAME.tlpobj. =head1 AUTHORS AND COPYRIGHT @@ -150,6 +164,8 @@ 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. +=back + =cut ### Local Variables: diff --git a/Master/tlpkg/man/TeXLive-TLPOBJ.1 b/Master/tlpkg/man/TeXLive-TLPOBJ.1 index df21ce1e566..b2ec946fc5c 100644 --- a/Master/tlpkg/man/TeXLive-TLPOBJ.1 +++ b/Master/tlpkg/man/TeXLive-TLPOBJ.1 @@ -128,8 +128,8 @@ .rm #[ #] #H #V #F C .\" ======================================================================== .\" -.IX Title "TLPOBJ 3" -.TH TLPOBJ 3 "2007-11-12" "perl v5.8.8" "User Contributed Perl Documentation" +.IX Title "TeXLive::TLPOBJ 3" +.TH TeXLive::TLPOBJ 3 "2007-11-12" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" \&\f(CW\*(C`TeXLive::TLPOBJ\*(C'\fR \-\- TeX Live Package Object access module .SH "SYNOPSIS" @@ -225,11 +225,11 @@ with \f(CW\*(C`|\*(C'\fR characters inserted to show the indentation: .Ve .SH "PACKAGE VARIABLES" .IX Header "PACKAGE VARIABLES" -TeXLive::TLPOBJ has one package wide variable which is \f(CW\*(C`zipdir\*(C'\fR where -generated zip files are saved (if not otherwise specified. +TeXLive::TLPOBJ has one package wide variable which is \f(CW\*(C`containerdir\*(C'\fR where +generated container files are saved (if not otherwise specified. .PP .Vb 1 -\& TeXLive::TLPOBJ\->zipdir("path/to/zip/dir"); +\& TeXLive::TLPOBJ\->containerdir("path/to/container/dir"); .Ve .SH "MEMBER ACCESS FUNCTIONS" .IX Header "MEMBER ACCESS FUNCTIONS" @@ -317,28 +317,28 @@ or the filehandle if given: .el .IP "\f(CWwriteout_simple\fR" 4 .IX Item "writeout_simple" debugging function for comparison with \f(CW\*(C`tpm\*(C'\fR/\f(CW\*(C`tlps\*(C'\fR, will go away. -.ie n .IP """make_zip($type,$instroot[, $destdir[, $zipname]])""" 4 -.el .IP "\f(CWmake_zip($type,$instroot[, $destdir[, $zipname]])\fR" 4 -.IX Item "make_zip($type,$instroot[, $destdir[, $zipname]])" +.ie n .IP """make_container($type,$instroot[, $destdir[, $containername]])""" 4 +.el .IP "\f(CWmake_container($type,$instroot[, $destdir[, $containername]])\fR" 4 +.IX Item "make_container($type,$instroot[, $destdir[, $containername]])" creates a container file of the arch \fBindependent\fR files in the \f(CW\*(C`TLPOBJ\*(C'\fR -in \f(CW$destdir\fR (if not defined then \f(CW\*(C`TLPOBJ\->zipdir\*(C'\fR is used). +in \f(CW$destdir\fR (if not defined then \f(CW\*(C`TLPOBJ\->containerdir\*(C'\fR is used). .Sp The \f(CW$type\fR variable specifies the type of container to be used. Currently only \f(CW\*(C`zip\*(C'\fR or \f(CW\*(C`lzma\*(C'\fR are allowed, and are generating zip files and tar.lzma files, respectively. .Sp -The file name of the created container file is \f(CW\*(C`$zipname.extension\*(C'\fR, +The file name of the created container file is \f(CW\*(C`$containername.extension\*(C'\fR, where extension is either \f(CW\*(C`.zip\*(C'\fR or \f(CW\*(C`.tar.lzma\*(C'\fR, depending on the -setting of \f(CW$type\fR. If no \f(CW$zipname\fR is specified the package name +setting of \f(CW$type\fR. If no \f(CW$containername\fR is specified the package name is used. .Sp If the package contains \f(CW"binfiles"\fR, then container files for all archs containing \fBonly\fR the binfiles are created, and -those container files name is \f(CW\*(C`$zipname.$arch.$extension\*(C'\fR +those container files name is \f(CW\*(C`$containername.$arch.$extension\*(C'\fR .Sp -All the arch independent zip files \fBalso\fR contain the respective -\&\f(CW\*(C`TLPOBJ\*(C'\fR file in \f(CW\*(C`tlpkg/tlpobj/$name.tlpobj\*(C'\fR so \f(CW\*(C`$zipname.$extension\*(C'\fR does -contain this tlpobj file, while \f(CW\*(C`$zipname.$arch.$extension\*(C'\fR does \s-1NOT\s0. +All the arch independent container files \fBalso\fR contain the respective +\&\f(CW\*(C`TLPOBJ\*(C'\fR file in \f(CW\*(C`tlpkg/tlpobj/$name.tlpobj\*(C'\fR so \f(CW\*(C`$containername.$extension\*(C'\fR does +contain this tlpobj file, while \f(CW\*(C`$containername.$arch.$extension\*(C'\fR does \s-1NOT\s0. .Sp The argument \f(CW$instroot\fR specifies the root of the installation from which the files should be taken. |