diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 2e559b710a3..5b56d107b4a 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -73,7 +73,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::time_estimate($totalsize, $donesize, $starttime) 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, $do_fileassocs, $do_shortcuts, $do_script); + TeXLive::TLUtils::do_postaction($how, $tlpobj, $do_fileassocs, $do_menu, $do_desktop, $do_script); TeXLive::TLUtils::announce_execute_actions($how, @executes); TeXLive::TLUtils::add_symlinks($root, $arch, $sys_bin, $sys_man, $sys_info); TeXLive::TLUtils::remove_symlinks($root, $arch, $sys_bin, $sys_man, $sys_info); @@ -1468,11 +1468,11 @@ sub install_package { return 1; } -=item C<do_postaction($how, $tlpobj, $do_fileassocs, $do_shortcuts, $do_script)> +=item C<do_postaction($how, $tlpobj, $do_fileassocs, $do_menu, $do_desktop, $do_script)> Evaluates the C<postaction> fields in the C<$tlpobj>. The first parameter can be either C<install> or C<remove>. The second gives the TLPOBJ whos -postactions should be evaluated, and the last three arguments specify +postactions should be evaluated, and the last four arguments specify what type of postactions should (or shouldn't) be evaluated. Returns 1 on success, and 0 on failure. @@ -1480,7 +1480,7 @@ Returns 1 on success, and 0 on failure. =cut sub do_postaction { - my ($how, $tlpobj, $do_fileassocs, $do_shortcuts, $do_script) = @_; + my ($how, $tlpobj, $do_fileassocs, $do_menu, $do_desktop, $do_script) = @_; my $ret = 1; if (!defined($tlpobj)) { tlwarn("do_postaction: didn't get a tlpobj\n"); @@ -1490,8 +1490,7 @@ sub do_postaction { if $tlpobj->postactions; for my $pa ($tlpobj->postactions) { if ($pa =~ m/^\s*shortcut\s+(.*)\s*$/) { - next unless $do_shortcuts; - $ret &&= _do_postaction_shortcut($how, $tlpobj, $1); + $ret &&= _do_postaction_shortcut($how, $tlpobj, $do_menu, $do_desktop, $1); } elsif ($pa =~ m/\s*filetype\s+(.*)\s*$/) { next unless $do_fileassocs; $ret &&= _do_postaction_filetype($how, $tlpobj, $1); @@ -1635,7 +1634,7 @@ sub _do_postaction_script { } sub _do_postaction_shortcut { - my ($how, $tlpobj, $pa) = @_; + my ($how, $tlpobj, $do_menu, $do_desktop, $pa) = @_; return 1 unless win32(); my ($errors, %keyval) = parse_into_keywords($pa, qw/type name icon cmd args hide/); @@ -1656,6 +1655,13 @@ sub _do_postaction_shortcut { return 0; } + if (($type eq "menu") && !$do_menu) { + return 1; + } + if (($type eq "desktop") && !$do_desktop) { + return 1; + } + # name can be an arbitrary string if (!defined($keyval{'name'})) { tlwarn("name of shortcut postaction not given\n"); |