From cb14dce28c9ff35203aaf34c371d09b1604bdd4d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 17 Apr 2008 09:15:59 +0000 Subject: add add_archs, available_archs git-svn-id: svn://tug.org/texlive/trunk@7468 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tl-package-manager.pl | 64 +++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tl-package-manager.pl b/Master/texmf/scripts/texlive/tl-package-manager.pl index 44467737210..3af8da8cabf 100755 --- a/Master/texmf/scripts/texlive/tl-package-manager.pl +++ b/Master/texmf/scripts/texlive/tl-package-manager.pl @@ -135,6 +135,55 @@ if ($action =~ m/^generate$/i) { } # should we do some postinst actions? exit(0); +} elsif ($action =~ m/^available_archs$/i) { + # list the available architectures + # initialize the TLMedia from $location + $tlmediasrc = TeXLive::TLMedia->new($location); + my $mediatlpdb = $tlmediasrc->tlpdb; + print "Available architectures:\n"; + foreach my $a ($mediatlpdb->available_architectures) { + print "\t$a\n"; + } + print "You can add new architectures with tlmgr add_archs arch1 arch2\n"; + exit(0); +} elsif ($action =~ m/^add_archs$/i) { + $tlmediasrc = TeXLive::TLMedia->new($location); + my $mediatlpdb = $tlmediasrc->tlpdb; + my @already_installed_arch = $localtlpdb->available_architectures; + my @available_arch = $mediatlpdb->available_architectures; + my @todoarchs; + foreach my $a (@ARGV) { + if (TeXLive::TLUtils::member($a, @already_installed_arch)) { + print "Arch $a is already installed\n"; + next; + } + if (!TeXLive::TLUtils::member($a, @available_arch)) { + print "Arch $a not available, use 'tlmgr available_archs'!\n"; + next; + } + push @todoarchs, $a; + } + foreach my $pkg ($localtlpdb->list_packages) { + next if ($pkg =~ m/^00texlive/); + my $tlp = $localtlpdb->get_package($pkg); + foreach my $dep ($tlp->depends) { + if ($dep =~ m/^(.*)\.ARCH$/) { + # we have to install something + foreach my $a (@todoarchs) { + if ($opt_dry) { + print "Installing $pkg.$a\n"; + } else { + $ret |= $tlmediasrc->install_package("$pkg.$a", $localtlpdb, $opt_nodepends); + } + } + } + } + } + if (TeXLive::TLUtils::member('win32', @todoarchs)) { + # install the necessary win32 stuff + $ret |= $tlmediasrc->install_package("bin-tlperl.win32", $localtlpdb, $opt_nodepends); + $ret |= $tlmediasrc->install_package("bin-tlgs.win32", $localtlpdb, $opt_nodepends); + } } elsif ($action =~ m/^default$/i) { my $what = shift; die("default needs at least one argument") unless defined($what); @@ -146,7 +195,7 @@ if ($action =~ m/^generate$/i) { $localtlpdb->option_location($loc); $localtlpdb->save; } else { - warn "Setting other options currently not support, please edit texlive.tlpdb!"; + warn "Setting other options currently not supported, please edit texlive.tlpdb!"; } exit(0); } elsif ($action =~ m/^list$/i) { @@ -520,6 +569,19 @@ remove all dependencies, too, unless with option B<-no-depends>. Removing a package which is referenced as a dependency in another collection or scheme will not succeed unless the B<-force> option is given. +=item B C> + +This command allows to set the defaults as saved in the local texlive.tlpdb. +Possible values for C are: C. (Will be extended). + +=item B + +Prints the list of arch-os available at the default install location. + +=item B + +Adds binaries for the given architectures to the installtion. + =item B Search the names and short descriptions of all locally installed packages -- cgit v1.2.3