summaryrefslogtreecommitdiff
path: root/Master/install-tl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-07-08 13:01:20 +0000
committerNorbert Preining <preining@logic.at>2008-07-08 13:01:20 +0000
commitaa119be73d73727e173789d45ee2a40bfe0e62c6 (patch)
treea470469e15442848b63bf162d3afb80305fbf69c /Master/install-tl
parent556c8fb15a545d032fe1bb0054304c96ae6ec282 (diff)
install-tl (and tlmgr and and):
- use -location as installation source selection tool - remove -media - remove various functions from TLUtils.pm . remove NetArchive/DiskArchive distinction, only TLUtils::Archive remains and that is "archive" git-svn-id: svn://tug.org/texlive/trunk@9361 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-xMaster/install-tl113
1 files changed, 57 insertions, 56 deletions
diff --git a/Master/install-tl b/Master/install-tl
index e25a5334ec3..8ec18150c02 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -44,7 +44,7 @@ BEGIN {
use Getopt::Long qw(:config no_autoabbrev);
-use TeXLive::TLUtils qw(initialize_installer media platform platform_desc
+use TeXLive::TLUtils qw(platform platform_desc
which getenv win32 unix program_exists info log debug tlwarn ddebug
get_system_tmpdir member process_logging_options rmtree
mkdirhier make_var_skeleton make_local_skeleton install_package copy
@@ -139,9 +139,8 @@ our %vars=( # 'n_' means 'number of'.
);
# option handling
-my $opt_media = "";
my $opt_from_dvd = "";
-my $opt_url = "";
+my $opt_location = "";
my $opt_profile = "";
my $opt_no_cls=0;
my $opt_nogui = 0;
@@ -171,18 +170,16 @@ if (-r "installation.profile") {
# first process verbosity/quiet options
process_logging_options();
# now the others
-GetOptions("media=s" => \$opt_media,
+GetOptions(
"from_dvd" => \$opt_from_dvd,
"profile=s"=> \$opt_profile,
"no-cls",
"gui", \$opt_gui,
"no-gui", \$opt_nogui,
- "netarchive=s" => \$NetArchive,
- "diskarchive=s" => \$DiskArchive,
"lang=s" => \$::opt_lang,
"print-arch" => \$opt_arch,
"portable" => \$opt_portable,
- "url=s" => \$opt_url,
+ "location|url=s" => \$opt_location,
"version" => \$opt_version,
"help|?" => \$opt_help) or pod2usage(1);
@@ -218,14 +215,6 @@ if (defined($::opt_lang)) {
$::lang = $::opt_lang;
}
-if ("$opt_media" =~ m/^CD/i) {
- $::_media_ = "CD";
-} elsif ("$opt_media" =~ m/^NET/i) {
- $::_media_ = "NET";
-} elsif ("$opt_media" =~ m/^DVD/i) {
- $::_media_ = "DVD";
-}
-
if ("$opt_profile" ne "") {
if (-r "$opt_profile") {
info("Using automated installation using $opt_profile!");
@@ -252,6 +241,7 @@ my $finished = 0;
@::start_install_hook = ();
my $system_tmpdir=get_system_tmpdir();
+my $media;
# a couple of special uses of install-tl:
@@ -261,7 +251,7 @@ if ($opt_arch) {
} elsif ($opt_portable) {
$::opt_verbosity = -1;
# initialize_installer:
- $::_media_ = "DVD";
+ $media = "DVD";
$::_platform_ = platform();
$vars{'TEXDIR'} = getenv('TEXDIR');
if (not -d $vars{'TEXDIR'}.'/bin/'.$::_platform_) { # shouldn't happen
@@ -308,34 +298,60 @@ if ($opt_arch) {
# continuing with normal install
+# initialize the correct platform
+platform();
+setup_programs ("$::installerdir/tlpkg/installer", "$::_platform_");
+$ENV{'WGETRC'}="$::installerdir/tlpkg/installer/wgetrc";
+
+#
+# determine from where we do install
+#
+my $location = $opt_location;
+$location || ($location = "$::installerdir");
+if ($location =~ m!^(http|ftp)://!i) {
+ $location =~ s,/(tlpkg)?/*$,,; # remove any trailing tlpkg or /
+ $TeXLiveURL = $location;
+ $media = 'NET';
+} else {
+ # remove leading file:/+ part
+ $location =~ s!^file://*!/!i;
+ $location = abs_path($location);
+ if (-d "$location/$Archive") {
+ $media='CD';
+ } elsif (-d "$location/texmf/web2c") {
+ $media='DVD';
+ } else {
+ if ($opt_location) {
+ # user gave a --location but nothing can be found there, so die
+ die "Cannot find installation source at $opt_location!";
+ }
+ # no --location given, but NET installation
+ $TeXLiveURL = $location = TeXLive::TLUtils::give_ctan_mirror();
+ $media = 'NET';
+ }
+}
+
+
info("Platform: ", platform, " => \'", platform_desc(platform), "\'\n");
-if (media() eq "DVD") {
+if ($media eq "DVD") {
info("Distribution: live (uncompressed)\n");
-} elsif (media() eq "CD") {
+} elsif ($media eq "CD") {
info("Distribution: inst (compressed)\n");
-} elsif (media() eq "NET") {
+} elsif ($media eq "NET") {
info("Distribution: net (downloading)\n");
+ info("Using URL: $TeXLiveURL\n");
} else {
- info("Distribution: ", media(), "\n");
+ info("Distribution: $media\n");
}
info("Directory for temporary files: '", $system_tmpdir, "\'\n");
info("Installer directory: '$localpath'\n");
-initialize_installer();
-
-if ($opt_from_dvd and ($::_media_ ne "DVD")) {
+if ($opt_from_dvd and ($media ne "DVD")) {
print "Not running from DVD; 'from_dvd' option not applicable\n";
$opt_from_dvd = 0;
}
$vars{'from_dvd'} = $opt_from_dvd;
-setup_programs ("$::installerdir/tlpkg/installer", "$::_platform_");
-$opt_url =~ s,/(tlpkg)?/*$,, if $opt_url; # remove any trailing tlpkg or /
-
-if ($::_media_ eq "NET") {
- $TeXLiveURL = $opt_url || TeXLive::TLUtils::give_ctan_mirror();
- info("Using URL $TeXLiveURL\n");
-}
load_tlpdb();
log("Installer revision: $::installerrevision\n");
@@ -343,7 +359,7 @@ log("Database revision: " . $tlpdb->config_revision . "\n");
# correctly set the splitting support
# for DVD we always support splitting
-if ((media() eq "NET") || (media() eq "CD")) {
+if (($media eq "NET") || ($media eq "CD")) {
$vars{'src_splitting_supported'} = $tlpdb->config_src_container;
$vars{'doc_splitting_supported'} = $tlpdb->config_doc_container;
}
@@ -644,12 +660,7 @@ sub calc_depends {
}
sub load_tlpdb {
- my $master;
- if (media eq 'NET') {
- $master="$TeXLiveURL";
- } else {
- $master="$::installerdir";
- }
+ my $master = $location;
info("Loading $master/$TeXLive::TLConfig::InfraLocation/$TeXLive::TLConfig::DatabaseName\n");
$tlpdb=TeXLive::TLPDB->new(root => "$master");
if (!defined($tlpdb)) {
@@ -807,7 +818,7 @@ sub do_install_packages {
foreach my $package (sort keys %install) {
push @what, $package if ($install{$package} == 1);
}
- install_packages($tlpdb,$localtlpdb,\@what,$vars{'option_src'},$vars{'option_doc'});
+ install_packages($tlpdb,$media,$localtlpdb,\@what,$vars{'option_src'},$vars{'option_doc'});
}
# for later complete removal we want to save some options and values
@@ -815,8 +826,7 @@ sub do_install_packages {
# - should links be set, and if yes, the destination (bin,man,info)
sub save_options_into_tlpdb {
$localtlpdb->option_platform($::_platform_);
- $localtlpdb->option_location(
- (($::_media_ eq 'NET') ? "$TeXLiveURL" : abs_path($::installerdir)));
+ $localtlpdb->option_location($location);
$localtlpdb->option_paper($vars{'option_letter'} ? "letter" : "a4");
$localtlpdb->option_create_formats($vars{'option_fmt'} ? "1" : "0");
$localtlpdb->option_create_symlinks($vars{'option_symlinks'} ? "1" : "0");
@@ -1208,7 +1218,7 @@ sub do_cleanup
}
# remove temporary files from TEXDIR/temp
- if ((media() eq "CD") or (media() eq "NET")) {
+ if (($media eq "CD") or ($media eq "NET")) {
debug("Remove temporary downloaded containers!\n");
rmtree("$vars{'TEXDIRW'}/temp") if (-d "$vars{'TEXDIRW'}/temp");
}
@@ -1274,21 +1284,20 @@ the language specified by the 2-letter language code. Currently supported
languages: English (en, default), German (de), French (fr), Dutch (nl),
Polish (pl) and Slovenian (sl).
-=item B<-media> I<[CD|DVD|NET]>
-
-Override the autodetection of the media.
-
=item B<-profile> I<profile>
Load the I<profile> file for repeated installations on different systems.
-=item B<-url> I<url>
+=item B<-location> I<url|path>
-Override the default URL for network installs. Trailing C</> characters
+Provide an installation source. If the given argument is on the local
+drives (either a path or a file:/ url) the installation type (compressed
+or live) is automatically determined. Giving an http: or ftp: location
+trailing C</> characters
and/or a trailing C</tlpkg> component are ignored. For example, you
could choose a particular CTAN mirror with something like:
- -url http://ctan.example.org/tex-archive/texlive/tlnet/2008
+ -location http://ctan.example.org/tex-archive/texlive/tlnet/2008
Of course a proper hostname and its particular top-level CTAN path
have to be specified. (The list of CTAN mirrors is maintained at
@@ -1297,14 +1306,6 @@ L<http://ctan.org/mirrors>.)
The default is to pick a mirror automatically, using
L<http://mirror.ctan.org>; one mirror is used for the entire download.
-=item B<-netarchive> I<dir>
-
-Override the default settings for netarchive. Should be used with care.
-
-=item B<-diskarchive> I<dir>
-
-Override the default settings for diskarchive. Should be used with care.
-
=item B<-no-cls>
(only for text mode installer) do not clear the screen when entering