diff options
author | Norbert Preining <preining@logic.at> | 2008-08-01 20:21:07 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-08-01 20:21:07 +0000 |
commit | 4a4eae6203c39fb73e02fdd1e2b4fd1745c2fc75 (patch) | |
tree | 3f4dc7218f14fccdfe969e0a49a38228df843046 | |
parent | 7182acf11046ef9182624e4755a0fca9c3fb8bf0 (diff) |
tlmgr.pl: check the return value of setup_programs
git-svn-id: svn://tug.org/texlive/trunk@9994 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 0c0ca5b4cf8..4b86514586f 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -525,7 +525,7 @@ sub action_restore { } print "Restoring $pkg, $rev from $opt_backupdir/${pkg}_r${rev}.tar.lzma\n"; if (!$opt_dry) { - init_local_db(); + init_local_db(1); # first remove the package, then reinstall it # this way we get rid of useless files # force the deinstallation since we will reinstall it @@ -546,7 +546,7 @@ sub action_restore { } sub action_backup { - init_local_db(); + init_local_db(1); my $opt_dry = 0; my $opt_all = 0; my $opt_backupdir; @@ -584,7 +584,7 @@ sub action_update { if ($opt_gui) { action_gui("update"); } - init_local_db(); + init_local_db(1); # initialize the TLMedia from $location my $opt_nodepends = 0; my $opt_dry = 0; @@ -741,7 +741,7 @@ sub action_install { if ($opt_gui) { action_gui("install"); } - init_local_db(); + init_local_db(1); # initialize the TLMedia from $location my $opt_nodepends = 0; my $opt_dry = 0; @@ -862,7 +862,7 @@ sub action_arch { my $opt_dry = 0; Getopt::Long::Configure(qw(no_pass_through)); GetOptions("dry-run" => \$opt_dry) or pod2usage(2); - init_local_db(); + init_local_db(1); $what || ($what = "list"); if ($what =~ m/^list$/i) { # list the available architectures @@ -979,11 +979,19 @@ sub action_generate { } sub init_local_db { + my ($should_i_die) = @_; $localtlpdb = TeXLive::TLPDB->new ("root" => "$Master"); die("cannot find tlpdb!") unless (defined($localtlpdb)); # setup the programs, for win32 we need the shipped wget/lzma etc, so we # pass the location of these files to setup_programs. - setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform); + if (!setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform)) { + tlwarn("Couldn't set up the necessary programs.\nInstallation of packages is not supported.\nPlease report to texlive\@tug.org.\n"); + if (defined($should_i_die) && $should_i_die) { + exit 1; + } else { + tlwarn("Continuing anyway ...\n"); + } + } # let cmd line options override the settings in localtlpdb my $loc = $localtlpdb->option_location; if (defined($loc)) { |