summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-05-07 20:59:16 +0000
committerNorbert Preining <preining@logic.at>2008-05-07 20:59:16 +0000
commit9e20959633583ecc01c1a6db5a8152637274ce0c (patch)
tree6dd890da5ff03419cb5735b158932e170d22ee03 /Master/texmf
parent150b00dc079b517c78a190d60529dffa6b5e9333 (diff)
error handling for problems when loading the tlmedia
git-svn-id: svn://tug.org/texlive/trunk@7922 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl17
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl4
2 files changed, 18 insertions, 3 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index cff5820684c..c99159b7743 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -82,6 +82,7 @@ if ($opt_debug) {
$::LOGLEVELTERMINAL = $::LOG_DDDEBUG;
}
+my $loadmediasrcerror = "Cannot load TeX Live Database from ";
my %ret;
if ($action =~ m/^generate$/i) {
@@ -365,7 +366,8 @@ sub action_show {
my $installed = 0;
if (!$tlp) {
if (!$tlmediatlpdb) {
- my $tlmediasrc = TeXLive::TLMedia->new($location);
+ $tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
$tlmediatlpdb = $tlmediasrc->tlpdb;
}
$tlp = $tlmediatlpdb->get_package($pkg);
@@ -397,7 +399,8 @@ sub action_search {
my $tlpdb;
init_local_db();
if ($opt_global) {
- my $tlmediasrc = TeXLive::TLMedia->new($location);
+ $tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
$tlpdb = $tlmediasrc->tlpdb;
} else {
$tlpdb = $localtlpdb;
@@ -441,6 +444,7 @@ sub action_update {
"dry-run" => \$opt_dry) or pod2usage(2);
my %ret;
$tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
my $mediatlpdb = $tlmediasrc->tlpdb;
my @todo;
if ($opt_all) {
@@ -472,7 +476,7 @@ sub action_update {
merge_into(\%ret, $tlmediasrc->install_package($pkg, $localtlpdb, $opt_nodepends, 1));
}
} elsif ($rev > $mediarev) {
- print "revision in $location is less then local revision, not updating!\n";
+ print "$pkg: revision in $location is less then local revision, not updating!\n";
next;
}
}
@@ -492,6 +496,7 @@ sub action_install {
"dry-run" => \$opt_dry) or pod2usage(2);
my %ret;
$tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
foreach my $pkg (@ARGV) {
if ($opt_dry) {
print "Installing $pkg\n";
@@ -512,6 +517,7 @@ sub action_list {
my $what = shift @ARGV;
$what || ($what = "");
$tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
my @whattolist;
if ($what =~ m/^collection/i) {
@whattolist = $tlmediasrc->tlpdb->collections;
@@ -607,6 +613,7 @@ sub action_arch {
# list the available architectures
# initialize the TLMedia from $location
$tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
my $mediatlpdb = $tlmediasrc->tlpdb;
my @already_installed_arch = $localtlpdb->available_architectures;
print "Available architectures:\n";
@@ -622,6 +629,7 @@ sub action_arch {
exit(0);
} elsif ($what =~ m/^add$/i) {
$tlmediasrc = TeXLive::TLMedia->new($location);
+ die($loadmediasrcerror . $location) unless defined($tlmediasrc);
my $mediatlpdb = $tlmediasrc->tlpdb;
my @already_installed_arch = $localtlpdb->available_architectures;
my @available_arch = $mediatlpdb->available_architectures;
@@ -707,6 +715,9 @@ sub init_local_db {
if (defined($opt_location)) {
$location = $opt_location;
}
+ if (!defined($location)) {
+ die("No installation source found, nor in the texlive.tlpdb nor on the cmd line.\nPlease specify one!");
+ }
}
sub action_gui {
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
index 973893cae81..6d89d35797a 100755
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
@@ -124,6 +124,10 @@ sub init_install_media {
# nothing to be done
} else {
$tlmediasrc = TeXLive::TLMedia->new($newroot);
+ if (!defined($tlmediasrc)) {
+ # something went badly wrong, maybe the newroot is wrong?
+ die "Something went badly wrong here, we cannot load the\nTeX Live Database from location `$newroot'.\nAre you sure that there is one?";
+ }
$tlmediatlpdb = $tlmediasrc->tlpdb;
@allpackages = setup_list(1,$tlmediatlpdb->list_packages);
}