summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-05-07 20:22:14 +0000
committerNorbert Preining <preining@logic.at>2008-05-07 20:22:14 +0000
commite798aef81e5f88c5abe56cdb54995c605ba35b84 (patch)
tree99e7523b33424edafa0362c042fc7096435c9d93 /Master
parent7d1215fe8376e0f557f904bbca99b7a0593bf322 (diff)
support --gui option and tlmgr --gui update (etc) will pop you directly
into the respective gui screen. git-svn-id: svn://tug.org/texlive/trunk@7918 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl117
1 files changed, 68 insertions, 49 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 5d0a5daf1d4..c5c30c374ee 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -6,25 +6,9 @@
# or any later version.
#
# TODO:
-# - (idea/problem) every time we re-generate the updmap/fmtutil files
-# with generate ... we destroy everything the admin/user might have
-# added via --enable or --disable. That is bad.
-# What about doing *all* (i.e., at installation time and at update
-# time) via enable/disable calls?
# - ordering or collections removal (see below for details)
# - (?) removal does not remove created format files from TEXMFSYSVAR
# - other features: dependency check?, ...?
-# - cmd
-# default <key> <value>
-# sets the options in texlive.tlpdb
-# done for location
-# change that????????
-# default show location
-# default show docfiles
-# default show ....
-#
-# default set location ....
-# default set docfiles ....
my $Master;
@@ -73,13 +57,7 @@ GetOptions("location=s" => \$opt_location,
"gui" => \$opt_gui,
"debug!", "h|help|?" => \$opt_help) or pod2usage(2);
-my $action;
-if ($opt_gui) {
- $action = "gui";
- # ignore all other things
-} else {
- $action = shift;
-}
+my $action = shift;
if (!defined($action) && !$opt_help) {
print "missing action\ntry 'tlmgr help' for more information.\n";
@@ -93,38 +71,12 @@ if (defined($action) && ($action =~ m/^help/i)) {
$NetArchive = $opt_netarchive if (defined($opt_netarchive));
$DiskArchive = $opt_diskarchive if (defined($opt_diskarchive));
-if (defined($action) && ($action =~ m/^gui/i)) {
- my $perlbin = "perl";
- my $perlbinquote = "perl";
- my $perlscript = "$Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl";
- if ($^O=~/^MSWin(32|64)$/i) {
- $ENV{'PERL5LIB'} = "$Master/tlpkg/tlperl/lib";
- $perlbin = "$Master/tlpkg/tlperl/bin/perl.exe";
- $perlbinquote = "\"$Master/tlpkg/tlperl/bin/perl.exe\"";
- $perlbinquote =~ s!/!\\!g;
- $perlscript = "\"$perlscript\"";
- $perlscript =~ s!/!\\!g;
- }
- my @cmdline;
- push @cmdline, $perlbinquote, $perlscript;
- 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));
- push @cmdline, @ARGV;
- exec $perlbin @cmdline;
- die("Cannot execute the GUI script\n");
-}
-
if ($^O=~/^MSWin(32|64)$/i) {
pod2usage(-exitstatus => 0, -verbose => 2, -noperldoc => 1) if $opt_help;
} else {
pod2usage(-exitstatus => 0, -verbose => 2) if $opt_help;
}
-
if ($opt_debug) {
$::LOGLEVELFILE = $::LOG_DDDEBUG;
$::LOGLEVELTERMINAL = $::LOG_DDDEBUG;
@@ -134,6 +86,8 @@ my %ret;
if ($action =~ m/^generate$/i) {
merge_into(\%ret, action_generate());
+} elsif ($action =~ m/^gui$/i) {
+ action_gui();
} elsif ($action =~ m/^arch$/i) {
merge_into(\%ret, action_arch());
} elsif ($action =~ m/^option$/i) {
@@ -159,6 +113,9 @@ if ($action =~ m/^generate$/i) {
} elsif (($action eq "paper") || ($action eq "dvips") || ($action eq "xdvi") ||
($action eq "pdftex") || ($action eq "dvipdfm") ||
($action eq "dvipdfmx")) {
+ if ($opt_gui) {
+ action_gui("config");
+ }
my $TEXMFMAIN = `kpsewhich -var-value=TEXMFMAIN`;
chomp $TEXMFMAIN;
system("texlua", "$TEXMFMAIN/scripts/texlive/texconf.tlu", "--prog", "tlmgr", "--sys", $action, @ARGV);
@@ -298,6 +255,9 @@ sub remove_package {
}
sub action_remove {
+ if ($opt_gui) {
+ action_gui("remove");
+ }
# we do the following:
# - (not implemented) order collections such that those depending on
# other collections are first removed, and then those which only
@@ -395,6 +355,9 @@ sub action_remove {
}
sub action_show {
+ if ($opt_gui) {
+ action_gui("config");
+ }
init_local_db();
foreach my $pkg (@ARGV) {
my $tlmediatlpdb;
@@ -464,6 +427,9 @@ sub action_search {
}
sub action_update {
+ if ($opt_gui) {
+ action_gui("update");
+ }
init_local_db();
# initialize the TLMedia from $location
my $opt_nodepends = 0;
@@ -514,6 +480,9 @@ sub action_update {
}
sub action_install {
+ if ($opt_gui) {
+ action_gui("install");
+ }
init_local_db();
# initialize the TLMedia from $location
my $opt_nodepends = 0;
@@ -564,6 +533,9 @@ sub action_list {
}
sub action_option {
+ if ($opt_gui) {
+ action_gui("config");
+ }
my $what = shift @ARGV;
$what = "show" unless defined($what);
init_local_db();
@@ -619,6 +591,12 @@ sub action_option {
}
sub action_arch {
+ if ($^O=~/^MSWin(32|64)$/i) {
+ printf STDERR "action `arch' not supported on Windows\n";
+ }
+ if ($opt_gui) {
+ action_gui("arch");
+ }
my $what = shift @ARGV;
my %ret;
my $opt_dry = 0;
@@ -731,11 +709,42 @@ sub init_local_db {
}
}
+sub action_gui {
+ my ($screen) = @_;
+ my $perlbin = "perl";
+ my $perlbinquote = "perl";
+ my $perlscript = "$Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl";
+ if ($^O=~/^MSWin(32|64)$/i) {
+ $ENV{'PERL5LIB'} = "$Master/tlpkg/tlperl/lib";
+ $perlbin = "$Master/tlpkg/tlperl/bin/perl.exe";
+ $perlbinquote = "\"$Master/tlpkg/tlperl/bin/perl.exe\"";
+ $perlbinquote =~ s!/!\\!g;
+ $perlscript = "\"$perlscript\"";
+ $perlscript =~ s!/!\\!g;
+ }
+ my @cmdline;
+ push @cmdline, $perlbinquote, $perlscript;
+ 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));
+ if (defined($screen)) {
+ push @cmdline, "--screen", $screen;
+ }
+ exec $perlbin @cmdline;
+ die("Cannot execute the GUI script\n");
+}
+
sub action_uninstall {
if (win32()) {
printf STDERR "Please use \"Add/Remove Programs\" from the Control Panel to removing TeX Live!\n";
exit 1;
}
+ if ($opt_gui) {
+ action_gui("uninstall");
+ }
my $force = 0;
Getopt::Long::Configure(qw(no_pass_through));
GetOptions("force" => \$force) or pod2usage(2);
@@ -1161,6 +1170,16 @@ location in C<TEXMFSYSVAR>).
Specifies the location from which packages should be installed or
updated, overriding the location found in the installation's TLPDB.
+=item B<--gui>
+
+Instead of starting the GUI via the B<gui> action, you can also give this
+option together with an action from above and will be brought directly
+into the respective screen of the GUI. So calling
+
+ tlmgr --gui update
+
+will bring you directly into the update screen.
+
=item B<--netarchive> I<dir>
Overrides the default settings for netarchive. Should be used with care.