summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/install-tl3
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl7
-rw-r--r--Master/texmf/scripts/texlive/uninstall-win32.pl1
-rw-r--r--Master/tlpkg/TeXLive/TLMedia.pm8
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm20
5 files changed, 28 insertions, 11 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 5e25f5e1e09..3ab7cfe60f4 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -861,12 +861,15 @@ operations might be disturbed.\n\n";
sub do_tlpdb_postactions {
info ("running package specific postactions\n");
# Run the post installation code in the postaction tlpsrc entries
+ # For now the option_desktop_integrations maps to both desktop
+ # and menu entries, but we can split that later
my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
foreach my $package ($usedtlpdb->list_packages) {
&TeXLive::TLUtils::do_postaction("install",
$usedtlpdb->get_package($package),
$vars{'option_file_assocs'},
$vars{'option_desktop_integration'},
+ $vars{'option_desktop_integration'},
$vars{'option_post_code'});
}
info ("finished with package specific postactions\n");
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 0d939e5297f..5718438d16e 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -4009,7 +4009,8 @@ sub action_postaction {
if (!defined($tlp)) {
tlwarn("$p is not installed, ignoring it.\n");
} else {
- TeXLive::TLUtils::do_postaction($how, $tlp, 0, 1, 0);
+ # run all shortcut actions, desktop and menu integration
+ TeXLive::TLUtils::do_postaction($how, $tlp, 0, 1, 1, 0);
}
}
} elsif ($type =~ m/^fileassoc$/i) {
@@ -4030,7 +4031,7 @@ sub action_postaction {
if (!defined($tlp)) {
tlwarn("$p is not installed, ignoring it.\n");
} else {
- TeXLive::TLUtils::do_postaction($how, $tlp, $fa, 0, 0);
+ TeXLive::TLUtils::do_postaction($how, $tlp, $fa, 0, 0, 0);
}
}
} elsif ($type =~ m/^script$/i) {
@@ -4039,7 +4040,7 @@ sub action_postaction {
if (!defined($tlp)) {
tlwarn("$p is not installed, ignoring it.\n");
} else {
- TeXLive::TLUtils::do_postaction($how, $tlp, 0, 0, 1);
+ TeXLive::TLUtils::do_postaction($how, $tlp, 0, 0, 0, 1);
}
}
} else {
diff --git a/Master/texmf/scripts/texlive/uninstall-win32.pl b/Master/texmf/scripts/texlive/uninstall-win32.pl
index 8f81f9e9bfd..2b96b41e29b 100644
--- a/Master/texmf/scripts/texlive/uninstall-win32.pl
+++ b/Master/texmf/scripts/texlive/uninstall-win32.pl
@@ -58,6 +58,7 @@ sub doit {
&TeXLive::TLUtils::do_postaction("remove", $localtlpdb->get_package($pkg),
$localtlpdb->option("file_assocs"),
$localtlpdb->option("desktop_integration"),
+ $localtlpdb->option("desktop_integration"),
$localtlpdb->option("post_code"));
}
}
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm
index 99eb234d896..3b72fa48b54 100644
--- a/Master/tlpkg/TeXLive/TLMedia.pm
+++ b/Master/tlpkg/TeXLive/TLMedia.pm
@@ -272,9 +272,12 @@ sub install_package {
if (win32() && admin() && !$totlpdb->option("w32_multi_user")) {
non_admin();
}
+ # for now desktop_integration maps to both installation
+ # of desktop shortcuts and menu items, but we can split them later
&TeXLive::TLUtils::do_postaction("install", $tlpobj,
$totlpdb->option("file_assocs"),
$totlpdb->option("desktop_integration"),
+ $totlpdb->option("desktop_integration"),
$totlpdb->option("post_code"));
}
}
@@ -489,7 +492,8 @@ sub remove_package {
if (defined($opts{'nopostinstall'}) && $opts{'nopostinstall'}) {
&TeXLive::TLUtils::do_postaction("remove", $tlp,
0, # option_file_assocs,
- 0, # option_desktop_integration,
+ 0, # option_desktop_integration, menu part
+ 0, # option_desktop_integration, desktop part
$localtlpdb->option("post_code"));
}
#
@@ -519,10 +523,12 @@ sub remove_package {
# Run the post installation code in the postaction tlpsrc entries
# the postaction code part cannot be evaluated now since the
# files are already removed.
+ # Again, desktop integration maps to desktop and menu links
if (!$nopostinstall) {
&TeXLive::TLUtils::do_postaction("remove", $tlp,
$localtlpdb->option("file_assocs"),
$localtlpdb->option("desktop_integration"),
+ $localtlpdb->option("desktop_integration"),
0);
}
}
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");