summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-04-18 05:15:37 +0000
committerNorbert Preining <preining@logic.at>2008-04-18 05:15:37 +0000
commit7b7ee8d58b7855b14f7298a033c3ff86d0dc5548 (patch)
tree2dcdae6a256e97a39c922254c129ac0bcb55edf0
parent60ba16ba6110c95aa7abd0cb6a6049ab6e749c6f (diff)
fixes to tl-package-manager.pl
git-svn-id: svn://tug.org/texlive/trunk@7480 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tl-package-manager.pl99
1 files changed, 52 insertions, 47 deletions
diff --git a/Master/texmf/scripts/texlive/tl-package-manager.pl b/Master/texmf/scripts/texlive/tl-package-manager.pl
index fb9255067c9..b2f71b6a0cf 100755
--- a/Master/texmf/scripts/texlive/tl-package-manager.pl
+++ b/Master/texmf/scripts/texlive/tl-package-manager.pl
@@ -80,12 +80,12 @@ GetOptions("location=s" => \$opt_location,
"debug!", "h|help|?" => \$opt_help) or pod2usage(1);
my $action = shift;
-if (!defined($action)) {
- # no argument given
- $opt_help = 1;
+if (!defined($action) && !$opt_help) {
+ print "missing action\ntry 'tlmgr help' for more information.\n";
+ exit 1;
}
-if ($action =~ m/^help/i) {
+if (defined($action) && ($action =~ m/^help/i)) {
$opt_help = 1;
}
@@ -147,54 +147,59 @@ 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;
+} elsif ($action =~ m/^arch$/i) {
+ my $what = shift;
+ if ($what =~ m/^list$/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";
}
- 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);
+ print "You can add new architectures with tlmgr add_archs arch1 arch2\n";
+ exit(0);
+ } elsif ($what =~ m/^add$/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);
+ 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);
+ }
+ } else {
+ die "Unknown option for arch: $what";
}
} elsif ($action =~ m/^default$/i) {
my $what = shift;