From 5fe30c01fb51adcd9854f4ed120b53a1d5cdfb46 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 10 May 2008 14:57:14 +0000 Subject: support force and no-depends in GUI git-svn-id: svn://tug.org/texlive/trunk@8023 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf/scripts/texlive/tlmgrgui/do_listframe.pl | 12 +++++++- Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl | 32 ++++++++++++++++++---- 2 files changed, 38 insertions(+), 6 deletions(-) (limited to 'Master') diff --git a/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl b/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl index 8f7a77bed49..c9222d93e9f 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl @@ -79,7 +79,7 @@ sub update_info_window { } sub do_listframe { - my ($f, $title, $listref, $buttonsref) = @_; + my ($f, $title, $listref, $buttonsref, $with_force, $with_deps) = @_; # row 1, column 1-2 my $f_title = $f->Frame(-relief => 'ridge', -borderwidth => 2); @@ -161,6 +161,16 @@ sub do_listframe { $f_buttonf->grid(-row => 3, -column => 2, -padx => "2m", -pady => "2m", -sticky => "we"); + my $f_buttonf_optionsf = $f_buttonf->Frame(); + $f_buttonf_optionsf->Checkbutton(-text => "force", + -variable => \$opt_force + )->pack(-side => 'left') + if ($with_force); + $f_buttonf_optionsf->Checkbutton(-text => "without depends", + -variable => \$opt_nodepends + )->pack(-side => 'left') + if ($with_deps); + $f_buttonf_optionsf->pack; foreach my $k (keys %$buttonsref) { $f_buttonf->Button(-text => $buttonsref->{$k}{'-text'}, -command => sub { my @l = $f_listf_lb->curselection; diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl index 139ae6f4fa5..7b1a7c95aae 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl @@ -39,11 +39,15 @@ my $opt_debug = 0; my $opt_netarchive; my $opt_diskarchive; my $opt_screen; +our $opt_force = 0; +our $opt_nodepends = 0; GetOptions("location=s" => \$opt_location, "netarchive=s" => \$NetArchive, "diskarchive=s" => \$DiskArchive, "screen=s" => \$opt_screen, + "force" => \$opt_force, + "no-depends" => \$opt_nodepends, "debug!" => \$opt_debug) or die("Unsupported argument!"); our @update_function_list; @@ -116,7 +120,8 @@ do_listframe($back_f1, "Adding packages", \@allpackages, { install => { -text => "Install selected", - -command => \&install_selected_packages}} + -command => \&install_selected_packages}}, + 0,1 ); # update screen our $back_up = $back->add("update", -label => "Update"); @@ -130,7 +135,8 @@ do_listframe($back_up, }, updatesel => { -text => "Update selected", -command => \&update_selected_packages - }} + }}, + 0,0 ); # remove screen our $back_f2 = $back->add("remove", -label => "Remove"); @@ -139,7 +145,8 @@ do_listframe($back_f2, "Removing packages", \@alllocalpackages, { remove => { -text => "Remove selected", - -command => \&remove_selected_packages}} + -command => \&remove_selected_packages}}, + 1,1 ); # uninstall screen require("gui-uninstall.pl"); @@ -242,7 +249,13 @@ Please wait, the output will appear here when ready.\n"); sub install_selected_packages { if (@_) { - run_program_show_output("tlmgr", "--location", "$location", "install", @_); + my @execlist; + push @execlist, "tlmgr", "--location", "$location", "install"; + if ($opt_nodepends) { + push @execlist, "--no-depends"; + } + push @execlist, @_; + run_program_show_output(@execlist); reinit_local_tlpdb(); } } @@ -256,7 +269,16 @@ sub update_selected_packages { sub remove_selected_packages { if (@_) { - run_program_show_output("tlmgr", "remove", @_); + my @execlist; + push @execlist, "tlmgr", "remove"; + if ($opt_nodepends) { + push @execlist, "--no-depends"; + } + if ($opt_force) { + push @execlist, "--force"; + } + push @execlist, @_; + run_program_show_output(@execlist); reinit_local_tlpdb(); } } -- cgit v1.2.3