diff options
author | Norbert Preining <preining@logic.at> | 2009-06-08 14:57:10 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-06-08 14:57:10 +0000 |
commit | 95eb7ead780f7de930d678a7ba295b27fa6d587e (patch) | |
tree | 6d06b40304d8b7a7c3dabda132d982900c73b7ed /Master/tlpkg/TeXLive/TLUtils.pm | |
parent | de09651f8c907cf30b668e414ff9da7b1f232a6e (diff) |
rework execute action handling so that it actually works, hopefully
that means that:
- handle_ret_hash is renamed to handle_execute_actions
- make_ret_hash_from_execute is gone and replaced by
TLUtils::announce_execute_actions
git-svn-id: svn://tug.org/texlive/trunk@13671 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 78f622506dd..e58eefc7d37 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -60,6 +60,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::install_packages($from_tlpdb,$media,$to_tlpdb,$what,$opt_src, $opt_doc)>); TeXLive::TLUtils::install_package($what, $filelistref, $target, $platform); TeXLive::TLUtils::do_postaction($how, $tlpobj); + TeXLive::TLUtils::announce_execute_actions($how, @executes); =head2 Miscellaneous @@ -121,6 +122,7 @@ BEGIN { &tlmd5 &xsystem &run_cmd + &announce_execute_actions ); @EXPORT = qw(setup_programs download_file process_logging_options tlwarn info log debug ddebug dddebug debug_hash @@ -1621,6 +1623,54 @@ sub parse_into_keywords { return($error, %ret); } +=item C<announce_execute_actions($how, $tlpobj)> + +Announces that the actions given in C<$tlpobj> should be executed +after all packages have been unpacked. + +=cut + +sub announce_execute_actions { + my ($type, $tlp) = @_; + if (defined($type) && ($type eq "regenerate-formats")) { + $::regenerate_all_formats = 1; + return; + } + if (defined($type) && ($type eq "files-changed")) { + $::files_changed = 1; + return; + } + if (!defined($type) || (($type ne "enable") && ($type ne "disable"))) { + die "announce_execute_actions: enable or disable, not type $type"; + } + my (@maps, @formats, @dats); + if ($tlp->runfiles || $tlp->srcfiles || $tlp->docfiles) { + $::files_changed = 1; + } + foreach my $e ($tlp->executes) { + if ($e =~ m/^add((Mixed)?Map)\s+([^\s]+)\s*$/) { + $::execute_actions{$type}{'maps'}{$3} = "$1"; + } elsif ($e =~ m/^AddFormat\s+(.*)\s*$/) { + my %r = TeXLive::TLUtils::parse_AddFormat_line("$1"); + if (defined($r{"error"})) { + tlwarn ("$r{'error'} in parsing $e for return hash\n"); + } else { + $::execute_actions{$type}{'formats'}{$r{'name'}} = \%r; + } + } elsif ($e =~ m/^AddHyphen\s+(.*)\s*$/) { + my %r = TeXLive::TLUtils::parse_AddHyphen_line("$1"); + if (defined($r{"error"})) { + tlwarn ("$r{'error'} in parsing $e for return hash\n"); + } else { + $::execute_actions{$type}{'hyphens'}{$r{'name'}} = \%r; + } + } else { + tlwarn("Unknown execute $e in ", $self->name, "\n"); + } + } +} + + =item C<untar($tarfile,$targetdir, $remove_tarfile)> Unpacked C<$tarfile> in C<$targetdir> (changing directories to |