From 9ee10541783a9ff8e1e378499fa3fc1c65363b72 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 5 May 2008 13:15:34 +0000 Subject: support location, netarchive, diskarchive in gui and transfer of options git-svn-id: svn://tug.org/texlive/trunk@7859 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 24 ++++++++++++++++++++--- Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl | 22 +++++++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) (limited to 'Master') diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 3f682efb65d..70fdadc9e44 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -66,10 +66,12 @@ my $location; my $opt_location; my $opt_help = 0; my $opt_debug = 0; +my $opt_netarchive; +my $opt_diskarchive; GetOptions("location=s" => \$opt_location, - "netarchive=s" => \$NetArchive, - "diskarchive=s" => \$DiskArchive, + "netarchive=s" => \$opt_netarchive, + "diskarchive=s" => \$opt_diskarchive, "debug!", "h|help|?" => \$opt_help) or pod2usage(1); my $action = shift; @@ -82,13 +84,24 @@ if (defined($action) && ($action =~ m/^help/i)) { $opt_help = 1; } +$NetArchive = $opt_netarchive if (defined($opt_netarchive)); +$DiskArchive = $opt_diskarchive if (defined($opt_diskarchive)); + if (defined($action) && ($action =~ m/^gui/i)) { my $perlbin = "perl"; if ($^O=~/^MSWin(32|64)$/i) { $ENV{'PERL5LIB'} = "$Master/tlpkg/tlperl/lib"; $perlbin = "$Master/tlpkg/tlperl/bin/perl.exe"; } - exec($perlbin, "$Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl"); + my @cmdline; + push @cmdline, $perlbin, "$Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl"; + push @cmdline, "--location", "$opt_location" + if (defined($opt_location)); + push @cmdline, "--netarchive", "$opt_netarchive" + if (defined($opt_netarchive)); + push @cmdline, "--diskarchive", "$opt_diskarchive" + if (defined($opt_diskarchive)); + exec(@cmdline); die("Cannot execute the GUI script\n"); } @@ -910,6 +923,11 @@ tlmgr [OPTIONS] ACTION ... Gives this help page. +=item B + +Starts the GUI. Currently not all options of the cmd line version are +supported in the GUI. + =item B Install all packages given on the cmdline. By default this installs all diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl index fe355347049..9dc6341fef8 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl @@ -18,11 +18,21 @@ BEGIN { use TeXLive::TLMedia; use TeXLive::TLPDB; +use TeXLive::TLConfig; use TeXLive::TLUtils qw(setup_programs); - +use Getopt::Long qw(:config no_autoabbrev require_order); use Tk; use Tk::Dialog; +my $opt_location; +my $opt_debug = 0; +my $opt_netarchive; +my $opt_diskarchive; + +GetOptions("location=s" => \$opt_location, + "netarchive=s" => \$NetArchive, + "diskarchive=s" => \$DiskArchive, + "debug!" => \$opt_debug) or die("Unsupported argument!"); our $back_f1; our $back_f2; @@ -32,7 +42,15 @@ die("cannot find tlpdb!") unless (defined($localtlpdb)); our @alllocalpackages = setup_list(0,$localtlpdb->list_packages); setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform); -our $location = $localtlpdb->option_location; +our $location; +my $loc = $localtlpdb->option_location; +if (defined($loc)) { + $location = $loc; +} +if (defined($opt_location)) { + $location = $opt_location; +} +# our $location = $localtlpdb->option_location; our $tlmediasrc; our $tlmediatlpdb; -- cgit v1.2.3