summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-08-10 21:56:50 +0000
committerNorbert Preining <preining@logic.at>2009-08-10 21:56:50 +0000
commit48a7022ca63946e53a0128fccbf8a1cc1c47e419 (patch)
treeeaa22c1492064b86d287c952ffebb0710d5058ad /Master/texmf
parent9313c47f46ca30ad4765d138f2167bccdadd403f (diff)
make sure that .ARCH packages are installed *before* the main package,
so that when the postaction in the main package is run all files are present git-svn-id: svn://tug.org/texlive/trunk@14607 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl36
1 files changed, 36 insertions, 0 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 94ca766312c..e8cbdd9c0b0 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -1784,6 +1784,7 @@ sub action_update {
push @new_packs, $pkg;
}
}
+ @new_packs = sort packagecmp @new_packs;
for my $pkg (@new_packs, @new_colls, @new_schemes) {
if ($opts{"no-auto-install"}) {
info("not auto-installing $pkg due to -no-auto-install (new on server)\n")
@@ -1836,6 +1837,7 @@ sub action_update {
push @inst_packs, $pkg;
}
}
+ @inst_packs = sort packagecmp @inst_packs;
#
foreach my $pkg (@inst_packs, @inst_colls, @inst_schemes) {
@@ -2114,6 +2116,7 @@ sub action_install {
push @inst_packs, $pkg;
}
}
+ @inst_packs = sort packagecmp @inst_packs;
foreach my $pkg (@inst_packs, @inst_colls, @inst_schemes) {
my $re = "";
if (defined($localtlpdb->get_package($pkg))) {
@@ -3549,6 +3552,39 @@ sub critical_updates_warning
tlwarn("=" x 79, "\n");
}
+#
+# our compare function for package sorting, which makes sure that
+# packages with .ARCH names are sorted *before* the main packages
+sub packagecmp {
+ my $aa = $a;
+ my $bb = $b;
+ # remove the part after the . if at all present
+ $aa =~ s/\..*$//;
+ $bb =~ s/\..*$//;
+ if ($aa lt $bb) {
+ return -1;
+ } elsif ($aa gt $bb) {
+ return 1;
+ } else {
+ # the parts before the . are the same
+ # sort the .something *before* the ones without
+ if ($a eq $aa && $b eq $bb) {
+ return 0;
+ } elsif ($a eq $aa) {
+ # so $a = foobar
+ # and $b = foobar.something
+ # this is the special case where we want to invert the order
+ return 1;
+ } elsif ($b eq $bb) {
+ # so $a = foobar.something
+ # and $b = foobar
+ return -1;
+ } else {
+ return ($a cmp $b);
+ }
+ }
+}
+
1;
__END__