summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TeXCatalogue.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-05-16 18:27:55 +0000
committerKarl Berry <karl@freefriends.org>2011-05-16 18:27:55 +0000
commit417e91d078352571aefe2bffd3cc2c1e5cc08f60 (patch)
tree5ff0763cb3062bb1527744c0a3e989d72a5ea7dd /Master/tlpkg/TeXLive/TeXCatalogue.pm
parent7e20b5c1b0433cf03f5a823a225eb847df52bb65 (diff)
TLPOBJ.pm (from_fh): do not remove trailing whitespace; turns out this
takes consequential time, and the creation programs should not ever produce it. Also added trailing-whitespace check to cron job for master tlpdb creation. With this change, tlpdb-read-test time is reduced from ~2.4sec to ~1.2sec. TeXCatalogue.pm (beautify): remove trailing whitespace. Looks like this can matter in <caption>s which we turn into shortdescs, but nowhere else. dev/tlpdb-read-test: trivial test script to read tlpdb and nothing else. git-svn-id: svn://tug.org/texlive/trunk@22498 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TeXCatalogue.pm')
-rw-r--r--Master/tlpkg/TeXLive/TeXCatalogue.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/Master/tlpkg/TeXLive/TeXCatalogue.pm b/Master/tlpkg/TeXLive/TeXCatalogue.pm
index 95ba60442a1..34f7a7f512b 100644
--- a/Master/tlpkg/TeXLive/TeXCatalogue.pm
+++ b/Master/tlpkg/TeXLive/TeXCatalogue.pm
@@ -1,6 +1,6 @@
# $Id$
# TeXLive::TeXCatalogue - module for accessing the TeX Catalogue
-# Copyright 2007, 2008, 2009, 2010 Norbert Preining
+# Copyright 2007, 2008, 2009, 2010, 2011 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
@@ -88,15 +88,15 @@ sub initialize {
}
}
-sub beautify
-{
+sub beautify {
my ($txt) = @_;
- $txt =~ s/\n/ /g;
- $txt =~ s/^[[:space:]]*//g;
- $txt =~ s/[[:space:]][[:space:]]*/ /g;
+ $txt =~ s/\n/ /g; # make one line
+ $txt =~ s/^\s+//g; # rm leading whitespace
+ $txt =~ s/\s+$//g; # rm trailing whitespace
+ $txt =~ s/\s\s+/ /g; # multiple spaces to one
# transliterate to ascii: it allows the final tlpdb to be pure ascii,
# avoiding problems since we don't control the user's terminal encoding
- return(Text::Unidecode::unidecode($txt));
+ return Text::Unidecode::unidecode($txt);
}
sub name {
@@ -197,8 +197,7 @@ sub initialize {
# Copy every catalogue $entry under the name $entry->{'texlive'}
# if it makes sense.
#
-sub quest4texlive
-{
+sub quest4texlive {
my $self = shift;
# The catalogue has a partial mapping from catalogue entries to