summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLTREE.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-07-05 18:05:05 +0000
committerKarl Berry <karl@freefriends.org>2018-07-05 18:05:05 +0000
commitc0df6a1395f65645200563c3586fb2c4b73e0630 (patch)
tree10fe86145cf7ce86806e3f0654773c8a9a0a60ff /Master/tlpkg/TeXLive/TLTREE.pm
parentf74e45dee03fbaac6d3286f99943105b3a9fd2ba (diff)
TLPSRC.pm: check for unexpanded variables and more duplicate directives;
simplify case statement handling lines. TLTREE.pm (get_matching_files): propagate warnings from the eval, for the sake of undefined variables. TLPDB.pm: doc. tl-update-tlpdb: distinguish $tlpdb->writeout from $tlpdb->save in msg. git-svn-id: svn://tug.org/texlive/trunk@48144 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLTREE.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLTREE.pm24
1 files changed, 14 insertions, 10 deletions
diff --git a/Master/tlpkg/TeXLive/TLTREE.pm b/Master/tlpkg/TeXLive/TLTREE.pm
index 5b67de191d1..95d304b18e7 100644
--- a/Master/tlpkg/TeXLive/TLTREE.pm
+++ b/Master/tlpkg/TeXLive/TLTREE.pm
@@ -7,12 +7,7 @@
package TeXLive::TLTREE;
my $svnrev = '$Revision$';
-my $_modulerevision;
-if ($svnrev =~ m/: ([0-9]+) /) {
- $_modulerevision = $1;
-} else {
- $_modulerevision = "unknown";
-}
+my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
use TeXLive::TLUtils;
@@ -326,11 +321,20 @@ sub get_matching_files {
my $ARCH = $arch;
my $PKGNAME = $pkg;
my $newp;
- eval "\$newp = \"$p\"";
- if (!defined($newp)) {
- print "Huuu: cannot generate newp from p: p=$p, pkg=$pkg, arch=$arch, type=$type\n";
+ {
+ my $warnstr = "";
+ local $SIG{__WARN__} = sub { $warnstr = $_[0]; };
+ eval "\$newp = \"$p\"";
+ if (!defined($newp)) {
+ die "cannot set newp from p: p=$p, pkg=$pkg, arch=$arch, type=$type";
+ }
+ if ($warnstr) {
+ tlwarn("Warning `$warnstr' while evaluating: $p "
+ . "(pkg=$pkg, arch=$arch, type=$type), returning empty list\n");
+ return ();
+ }
}
- return($self->_get_matching_files($type,$newp));
+ return $self->_get_matching_files($type,$newp);
}