diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2008-07-12 16:08:20 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2008-07-12 16:08:20 +0000 |
commit | 8a355d83a825e4ee9ba240cefb43fbbeb2772c32 (patch) | |
tree | c9f0805e56870abfbd07c15c9590ca3eea9d1509 /Master/tlpkg/TeXLive | |
parent | 726e84a6008c3e3f7c38782990a8a34297e83b67 (diff) |
Fix regression: accept e.g. line catalogue-ctan without parameter in TLPOBJ.pm
git-svn-id: svn://tug.org/texlive/trunk@9478 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPOBJ.pm | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index 8d02a27ef71..acd68a50f78 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -16,7 +16,7 @@ use TeXLive::TLTREE; our $_tmp; my $_containerdir; -sub new { +sub new { my $class = shift; my %params = @_; my $self = { @@ -64,7 +64,7 @@ sub from_file { open(TMP,"<$_[0]") || die("Cannot open tlpobj file: $_[0]"); $self->from_fh(\*TMP); } - + sub from_fh { my ($self,$fh,$multi) = @_; my $started = 0; @@ -222,6 +222,8 @@ sub from_fh { next; } elsif ($line =~ /^catalogue-([^\s]+)\s+(.*)\s*/o) { $self->{'cataloguedata'}{$1} = "$2"; + } elsif ($line =~ /^catalogue-([^\s]+)\s*/o) { + 1; # ignore e.g. catalogue-ctan without parameter } elsif ($line =~ /^shortdesc\s+(.*)\s*/o) { $self->{'shortdesc'} .= "$1"; $lastcmd = "shortdesc"; @@ -271,7 +273,7 @@ sub _recompute_size { $nrivblocks += int($s/$TeXLive::TLConfig::BlockSize); $nrivblocks++ if (($s%$TeXLive::TLConfig::BlockSize) > 0); } - } + } } else { if (defined($self->{"${type}files"}) && (@{$self->{"${type}files"}})) { foreach $f (@{$self->{"${type}files"}}) { @@ -414,7 +416,7 @@ sub writeout_simple { } } -### +### ### OLD VERSION WITH zip SUPPORT AND WITHOUT USING $::progs ### sub make_container { ### my ($self,$type,$instroot,$destdir,$containername,$relative) = @_; @@ -462,7 +464,7 @@ sub writeout_simple { ### chdir($instroot); ### # in the relative case we have to chdir to the respective tltree ### # and put the tlpobj into the root! -### if ($relative) { +### if ($relative) { ### chdir("./$tltree"); ### $tlpobjdir = "."; ### } @@ -506,7 +508,7 @@ sub writeout_simple { ### chdir($cwd); ### tllog($::LOG_DDDEBUG, "Done $containername\n"); ### } -### +### sub make_container { my ($self,$type,$instroot,$destdir,$containername,$relative) = @_; @@ -555,7 +557,7 @@ sub make_container { chdir($instroot); # in the relative case we have to chdir to the respective tltree # and put the tlpobj into the root! - if ($relative) { + if ($relative) { chdir("./$tltree"); $tlpobjdir = "."; } @@ -588,7 +590,7 @@ sub make_container { unlink("$destdir/$tarname"); if (win32()) { # we have to hack around this stupid win32 ... - open ZIP, "|$tar -c -f \"$destdir/$tarname\" --files-from=-" + open ZIP, "|$tar -c -f \"$destdir/$tarname\" --files-from=-" or die "Cannot open container program $tar -c -f \"$destdir/$tarname\" --files-from=-: $!"; } else { open ZIP, "|-", @cmdline or die "Cannot open container program @cmdline: $!"; @@ -649,7 +651,7 @@ sub update_from_catalogue { my ($self, $tlc) = @_; my $tlcname = $self->name; if (defined($self->catalogue)) { - $tlcname = $self->catalogue; + $tlcname = $self->catalogue; } elsif ($tlcname =~ m/^bin-(.*)$/) { my $shortname = $1; if (!defined($tlc->entries->{$tlcname})) { @@ -685,7 +687,7 @@ sub update_from_catalogue { if (defined($entry->description)) { $self->{'longdesc'} = $entry->description; } - # + # # we need to do the following: # - take the href entry for a documentation file entry in the TC # - remove the 'ctan:' prefix @@ -726,7 +728,7 @@ sub is_meta_package { my $self = shift; if ($self->category =~ /^$MetaCategoriesRegexp$/) { return 1; - } + } return 0; } @@ -783,7 +785,7 @@ sub split_bin_package { # Helpers. -# +# sub add_files { my ($self,$type,@files) = @_; die("Cannot use add_files for binfiles, we need that arch!") @@ -818,12 +820,12 @@ sub contains_file { sub all_files { my ($self) = shift; my @ret = (); - + push (@ret, $self->docfiles); push (@ret, $self->runfiles); push (@ret, $self->srcfiles); push (@ret, $self->allbinfiles); - + return @ret; } @@ -834,7 +836,7 @@ sub allbinfiles { foreach my $arch (keys %binfiles) { push (@ret, @{$binfiles{$arch}}); } - + return @ret; } @@ -1086,7 +1088,7 @@ files describing a self-contained package. Please see L<TeXLive::TLPSRC> documentation for the specification. The only differences are that the various C<*pattern> keys are invalid, and instead there are the respective C<*files> keys described below. Furthermore -some more I<keys> is allowed: C<revision> which specifies the maximum of +some more I<keys> is allowed: C<revision> which specifies the maximum of all last changed revision of files contained in the package, and anything starting with C<catalogue-> specifying information coming from the TeX Catalogue. @@ -1171,7 +1173,7 @@ For any of the I<keys> a function $tlpobj->key is available, which returns the current value when called without an argument, -and sets the respective value when called with an argument. For the +and sets the respective value when called with an argument. For the TeX Catalogue Data the function $tlpobj->cataloguedata @@ -1197,11 +1199,11 @@ The size values are handled with these functions: $tlpobj->binsize("arch1" => size1, "arch2" => size2, ...) which set or get the current value of the respective sizes. Note that also -the C<binsize> function returns (and takes as argument) a hash with the +the C<binsize> function returns (and takes as argument) a hash with the architectures as keys, similar to the C<runfiles> functions (see above). Futhermore, if the tlpobj is contained ina tlpdb which describes a media -where the files are distributed in packed format (usually as .tar.lzma), +where the files are distributed in packed format (usually as .tar.lzma), there are 6 more possible keys: $tlpobj->containersize @@ -1211,7 +1213,7 @@ there are 6 more possible keys: $tlpobj->doccontainermd5 $tlpobj->srccontainermd5 -describing the respective sizes and md5sums in bytes and as hex string, resp. +describing the respective sizes and md5sums in bytes and as hex string, resp. The latter two are only present if src/doc file container splitting is activated for that install medium. @@ -1277,13 +1279,13 @@ C<TLPOBJ> file in C<tlpkg/tlpobj/$name.tlpobj>. The argument C<$instroot> specifies the root of the installation from which the files should be taken. -If the argument C<$relative> is present and true (perlish true) AND the -packages does not span multiple texmf trees (i.e., all the first path +If the argument C<$relative> is present and true (perlish true) AND the +packages does not span multiple texmf trees (i.e., all the first path components of all files are the same) then a relative packages is created, i.e., the first path component is stripped. In this case the tlpobj file -is placed into the root of the installation. +is placed into the root of the installation. -This is used to distribute packages which can be installed in any arbitrary +This is used to distribute packages which can be installed in any arbitrary texmf tree (of other distributions, too). @@ -1301,7 +1303,7 @@ contain files) also have revision number. =item C<update_from_catalogue($texcatalogue)> -adds information from a C<TeXCatalogue> object +adds information from a C<TeXCatalogue> object (currently license, version, url, and updates docfiles with details and languages tags if present in the Catalogue). @@ -1317,11 +1319,11 @@ depend on "name.ARCH" is added. Note that the ARCH is a placeholder. =item C<docfiles_package> -splits off the srcfiles or docfiles of C<TLPOBJ> into new independent +splits off the srcfiles or docfiles of C<TLPOBJ> into new independent C<TLPOBJ> with -the original name plus ".sources". The source/doc files are +the original name plus ".sources". The source/doc files are B<not> removed from the original package, since these functions are only -used for the creation of split containers. +used for the creation of split containers. =item C<is_arch_dependent> @@ -1360,7 +1362,7 @@ adds or removes files for the given type (only for C<run>, C<src>, C<doc>). =item C<contains_file($filename)> returns the list of files matching $filename which are contained in -the package. If $filename contains a / the matching is only anchored +the package. If $filename contains a / the matching is only anchored at the end with $. Otherwise it is prefix with a / and anchored at the end. =item C<all_files> |