summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-10-23 13:42:13 +0000
committerKarl Berry <karl@freefriends.org>2008-10-23 13:42:13 +0000
commit793463328b0427d81b7a4e71a674c60c5b1bbc89 (patch)
treeaf61795e1534c7318d09ef7152b2ae9fd197e5df /Master/texmf/scripts
parent4c930859de17120d539f568e095eb1085ba9a51e (diff)
(action_update): if pkg foo is new, also consider
foo.ARCH to be new, similar to what we did for removals a little while back. Also give an info msg when --dry-run is given, throughout. git-svn-id: svn://tug.org/texlive/trunk@11038 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl54
1 files changed, 38 insertions, 16 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 0cb279b60c3..e7c2d7593a6 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -417,7 +417,7 @@ sub remove_package {
return \%ret;
}
-# REMOVE
+# REMOVE
#
# tlmgr remove foo bar baz
# will remove the packages foo bar baz itself
@@ -470,6 +470,7 @@ sub action_remove {
my %already_removed;
my @more_removal;
init_local_db();
+ info("remove: dry run, no changes will be made\n") if $opt_dry;
my @packs = @ARGV;
# remove all .ARCH dependencies, too, unless $opt_reallynodepends
@packs = $localtlpdb->expand_dependencies("-only-arch", $localtlpdb, @packs) unless $opt_reallynodepends;
@@ -625,6 +626,8 @@ sub action_search {
return;
}
+# RESTORE
+#
sub action_restore {
# tlmgr restore --backupdir dir
# lists all packages with all revisions
@@ -642,6 +645,8 @@ sub action_restore {
if (!defined($opt_backupdir)) {
die "restore needs --backupdir\n";
}
+ info("restore: dry run, no changes will be made\n") if $opt_dry;
+
# initialize the hash(packages) of hash(revisions)
my %backups;
opendir (DIR, $opt_backupdir) || die "opendir($opt_backupdir) failed: $!";
@@ -871,7 +876,8 @@ sub close_win32_updater {
}
}
-# UPDATE
+
+# UPDATE
#
# tlmgr update foo
# if foo is of type Package|Documentation it will update only foo
@@ -889,6 +895,7 @@ sub close_win32_updater {
#
# TLMedia->install_package does ONLY INSTALL ONE PACKAGE, no deps whatsoever
# anymore. That has all to be done by hand.
+#
sub action_update {
if ($opt_gui) {
action_gui("update");
@@ -959,9 +966,9 @@ sub action_update {
# in case a package has been moved between collections
for my $c ($mediatlpdb->collections) {
my $tlc = $mediatlpdb->get_package($c);
- die "Should not happen, listed but not found!" if !defined($tlc);
+ die "Should not happen, $c listed but not found" if !defined($tlc);
for my $d ($tlc->depends) {
- # those package are referenced, so not remove them
+ # those package are referenced, so do not remove them
delete($removals{$d});
}
}
@@ -971,12 +978,13 @@ sub action_update {
} else {
@todo = @ARGV;
}
+
my %forcermpkgs;
my %newpkgs;
#
- # we have to remove all the stuff *BEFORE* we install other packages
- # to support moving of files from one package to the next
- # remove the packages that have disappeared
+ # we have to remove all the stuff before we install other packages
+ # to support moving of files from one package to another.
+ # remove the packages that have disappeared:
for my $p (keys %removals) {
if ($opt_noremove) {
info("not removing $p due to -no-remove (removed on server)\n");
@@ -988,9 +996,9 @@ sub action_update {
logpackage("remove: $p");
}
}
- #
- # we check for new packages
- # loop over all installed collections
+
+ # check for new packages.
+ # loop over all installed collections:
for my $c ($localtlpdb->collections) {
my $localtlc = $localtlpdb->get_package($c);
if (!defined($localtlc)) {
@@ -1022,12 +1030,14 @@ sub action_update {
}
}
if (!@todo) {
- tlwarn ("tlmgr update: please specify a list of packages or --all.\n");
+ tlwarn("tlmgr update: please specify a list of packages or --all.\n");
}
- # update all .ARCH dependencies, too, unless $opt_reallynodepends
+
+ # update all .ARCH dependencies, too, unless $opt_reallynodepends:
@todo = $mediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo)
unless $opt_reallynodepends;
- # update deps unless $opt_nodepends
+ #
+ # update general deps unless $opt_nodepends:
@todo = $mediatlpdb->expand_dependencies("-no-collections",$localtlpdb,@todo)
unless $opt_nodepends;
@@ -1041,10 +1051,14 @@ sub action_update {
# expansion. So try both with and without the .ARCH extension.
(my $pkg_noarch = $pkg) =~ s/\.[^.]*$//;
my $forcerm_coll = $forcermpkgs{$pkg} || $forcermpkgs{$pkg_noarch};
+
+ # similarly for new packages. If latexmk is new, latexmk.ARCH
+ # will be in the dependency expansion, and we want it.
+ my $newpkg_coll = $newpkgs{$pkg} || $newpkgs{$pkg_noarch};
if ($forcerm_coll) {
info("skipping forcibly removed package $pkg ($forcerm_coll)\n");
next;
- } elsif ($newpkgs{$pkg}) {
+ } elsif ($newpkg_coll) {
# do nothing here, it will be reported below.
} elsif (defined($removals{$pkg})) {
# skipping this package, it has been removed due to server removal
@@ -1061,7 +1075,7 @@ sub action_update {
next;
}
my $mediarev = $mediatlp->revision;
- info("auto-install: $pkg ($newpkgs{$pkg})\n");
+ info("auto-install: $pkg ($newpkg_coll)\n");
next if ($opt_dry || $opt_list);
my $foo = $tlmediasrc->install_package($pkg, $localtlpdb);
if (ref $foo) {
@@ -1074,6 +1088,7 @@ sub action_update {
}
next;
}
+
my $unwind_package;
my $remove_unwind_container = 0;
my $rev = $tlp->revision;
@@ -1192,7 +1207,7 @@ sub action_update {
return(\%ret);
}
-# INSTALL
+# INSTALL
#
# tlmgr install foo bar baz
# will create the closure under dependencies of {foo,bar,baz}, i.e. all
@@ -1220,6 +1235,7 @@ sub action_update {
#
# TLMedia->install_package does ONLY INSTALL ONE PACKAGE, no deps whatsoever
# anymore! That has all to be done by hand.
+#
sub action_install {
if ($opt_gui) {
action_gui("install");
@@ -1239,6 +1255,8 @@ sub action_install {
init_tlmedia();
my $tlmediatlpdb = $tlmediasrc->tlpdb;
$opt_nodepends = 1 if $opt_reallynodepends;
+ info("install: dry run, no changes will be made\n") if $opt_dry;
+
my @packs = @ARGV;
# first expand the .ARCH dependencies unless $opt_reallynodepends
@packs = $tlmediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @ARGV) unless $opt_reallynodepends;
@@ -1367,6 +1385,9 @@ sub action_option {
return;
}
+
+# ARCH
+#
sub action_arch {
if ($^O=~/^MSWin(32|64)$/i) {
printf STDERR "action `arch' not supported on Windows\n";
@@ -1380,6 +1401,7 @@ sub action_arch {
GetOptions("n|dry-run" => \$opt_dry) or pod2usage(2);
my $what = shift @ARGV;
init_local_db(1);
+ info("arch: dry run, no changes will be made\n") if $opt_dry;
$what || ($what = "list");
if ($what =~ m/^list$/i) {
# list the available architectures