diff options
author | Karl Berry <karl@freefriends.org> | 2014-11-23 18:05:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-11-23 18:05:32 +0000 |
commit | bf026a233643ee44ad14a8dcdc7a003f10b3af7b (patch) | |
tree | 8c78d177d07b199c764a79b0e4cd61f5477d7986 /Master/tlpkg/TeXLive | |
parent | 9e696bd1663d7bd2f02ab39e0e22b63459100a9f (diff) |
* install-tl (run_postinst_cmd): new fn.
(do_postinst_stuff): call it; accumulate error count.
* TLUtils.pm (wsystem): call system and warn if failure.
* tl-update-tlnet: reimplement --no-consistency.
git-svn-id: svn://tug.org/texlive/trunk@35647 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 2b77add8f67..7668697c4c8 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -27,7 +27,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure use TeXLive::TLUtils; -=head2 Platform Detection +=head2 Platform detection TeXLive::TLUtils::platform(); TeXLive::TLUtils::platform_name($canonical_host); @@ -35,17 +35,18 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::win32(); TeXLive::TLUtils::unix(); -=head2 System Tools +=head2 System tools TeXLive::TLUtils::getenv($string); TeXLive::TLUtils::which($string); TeXLive::TLUtils::get_system_tmpdir(); TeXLive::TLUtils::tl_tmpdir(); TeXLive::TLUtils::xchdir($dir); + TeXLive::TLUtils::wsystem($msg,@args); TeXLive::TLUtils::xsystem(@args); TeXLive::TLUtils::run_cmd($cmd); -=head2 File Utilities +=head2 File utilities TeXLive::TLUtils::dirname($path); TeXLive::TLUtils::basename($path); @@ -65,7 +66,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::nulldev(); TeXLive::TLUtils::get_full_line($fh); -=head2 Installer Functions +=head2 Installer functions TeXLive::TLUtils::make_var_skeleton($path); TeXLive::TLUtils::make_local_skeleton($path); @@ -175,6 +176,7 @@ BEGIN { &create_mirror_list &extract_mirror_entry &tlmd5 + &wsystem &xsystem &run_cmd &announce_execute_actions @@ -207,8 +209,8 @@ use TeXLive::TLConfig; $::opt_verbosity = 0; # see process_logging_options - -=head2 Platform Detection + +=head2 Platform detection =over 4 @@ -483,7 +485,7 @@ sub get_system_tmpdir { =item C<tl_tmpdir> -Create a temporary directory which is cleaned up as soon as the program +Create a temporary directory which is removed when the program is terminated. =cut @@ -505,9 +507,28 @@ sub xchdir { } +=item C<wsystem($msg, @args)> + +Call C<info> about what is being done starting with C<$msg>, then run +C<system(@args)>; C<tlwarn> if unsuccessful and return the exit status. + +=cut + +sub wsystem { + my ($msg,@args) = @_; + info("$msg @args ...\n"); + my $status = system(@args); + if ($status != 0) { + tlwarn("$0: command failed: @args: $!\n"); + } + return $status; +} + + =item C<xsystem(@args)> -Run C<system(@args)> and die if unsuccessful. +Call C<ddebug> about what is being done, then run C<system(@args)>, and +die if unsuccessful. =cut @@ -524,7 +545,7 @@ sub xsystem { =item C<run_cmd($cmd)> -runs shell CMD and captures its output. Returns a list with CMD's +Run shell command C<$cmd> and captures its output. Returns a list with CMD's output as the first element and the return value (exit code) as second. =cut @@ -542,8 +563,6 @@ sub run_cmd { } - - =back =head2 File Utilities @@ -1045,9 +1064,6 @@ sub touch { } } - - - =item C<collapse_dirs(@files)> @@ -2352,7 +2368,6 @@ sub read_file_ignore_cr { return $ret; } - =item C<setup_programs($bindir, $platform)> @@ -2673,7 +2688,7 @@ sub get_full_line { return $line . $cont; } - + =back =head2 Installer Functions @@ -2728,7 +2743,6 @@ sub make_local_skeleton { mkdirhier "$prefix/web2c"; } - =item C<create_fmtutil($tlpdb, $dest, $localconf)> @@ -3074,7 +3088,7 @@ sub parse_AddFormat_line { return %ret; } - + =back =head2 Miscellaneous @@ -3930,8 +3944,6 @@ sub sort_archs ($$) { $aa cmp $bb ; } -############################################# -# # Taken from Text::ParseWords # sub quotewords { @@ -4086,7 +4098,6 @@ sub mktexupd { return $hash; } - =back =cut 1; |