From 375ce45529dbb82b8d404a7ce310c5d96227e208 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 24 Jun 2015 21:30:31 +0000 Subject: sync git-svn-id: svn://tug.org/texlive/trunk@37656 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/tests/TeXLive/TLConfig.pm | 17 ++++++++++++++++- Build/source/texk/tests/TeXLive/TLUtils.pm | 12 +++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'Build/source/texk/tests') diff --git a/Build/source/texk/tests/TeXLive/TLConfig.pm b/Build/source/texk/tests/TeXLive/TLConfig.pm index 1a4424c8e82..4f9cee081c1 100644 --- a/Build/source/texk/tests/TeXLive/TLConfig.pm +++ b/Build/source/texk/tests/TeXLive/TLConfig.pm @@ -5,7 +5,7 @@ package TeXLive::TLConfig; -my $svnrev = '$Revision: 36787 $'; +my $svnrev = '$Revision: 37643 $'; my $_modulerevision; if ($svnrev =~ m/: ([0-9]+) /) { $_modulerevision = $1; @@ -48,6 +48,7 @@ BEGIN { %TLPDBConfigs $NetworkTimeout $PartialEngineSupport + $F_OK $F_WARNING $F_ERROR $F_NOPOSTACTION ); @EXPORT = @EXPORT_OK; } @@ -197,6 +198,20 @@ our $PartialEngineSupport = "luajittex"; # timeout for network connections (wget, LWP) in seconds our $NetworkTimeout = 30; +# Flags for error handling across the scripts and modules +# all fine +our $F_OK = 0; +# +# some warnings, but we still try to run post actions +our $F_WARNING = 1; +# +# error, terminating +our $F_ERROR = 2; +# +# all fine, but no need to run post actions +our $F_NOPOSTACTION = 4; + + 1; diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm index 8763d3dbf6a..2fc4a3992b9 100644 --- a/Build/source/texk/tests/TeXLive/TLUtils.pm +++ b/Build/source/texk/tests/TeXLive/TLUtils.pm @@ -5,7 +5,7 @@ package TeXLive::TLUtils; -my $svnrev = '$Revision: 36818 $'; +my $svnrev = '$Revision: 37234 $'; my $_modulerevision; if ($svnrev =~ m/: ([0-9]+) /) { $_modulerevision = $1; @@ -1875,9 +1875,15 @@ sub _do_postaction_shortcut { # $cmd can be an URL, in which case we do NOT want to convert it to # w32 paths! if ($cmd !~ m!^\s*(http://|ftp://)!) { + if (!(-e $cmd) or !(-r $cmd)) { + tlwarn("Target of shortcut action does not exist: $cmd\n") + if $cmd =~ /\.(exe|bat|cmd)$/i; + # if not an executable, just omit shortcut silently + return 0; + } $cmd = conv_to_w32_path($cmd); } - if ($type eq "menu") { + if ($type eq "menu" ) { TeXLive::TLWinGoo::add_menu_shortcut( $TeXLive::TLConfig::WindowsMainMenuName, $name, $icon, $cmd, $args, $hide); @@ -3521,7 +3527,7 @@ sub conv_to_w32_path { my $p = shift; # we need absolute paths, too my $pabs = tl_abs_path($p); - if (not defined $pabs) { + if (not $pabs) { $pabs = $p; tlwarn ("sorry, could not determine absolute path of $p!\n". "using original path instead"); -- cgit v1.2.3