summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-09-10 14:57:40 +0000
committerNorbert Preining <preining@logic.at>2010-09-10 14:57:40 +0000
commit75030959fe7e9e18a4237090b4173052d10e1740 (patch)
tree4a722e5572b8f233674dccdd4e6ed40ad3ab6374 /Master/tlpkg/TeXLive
parent6e00b8d5b304a09a59b4e7d2fa2535dbd831af7e (diff)
tlmgr/installer: allow separating options for desktop shortcuts and
menu shortcuts. Currently the installer option "desktop_integration" maps to both menu shortcuts and desktop shortcuts. With this change we can make that two independent options. git-svn-id: svn://tug.org/texlive/trunk@19639 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLMedia.pm8
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm20
2 files changed, 20 insertions, 8 deletions
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");