summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-01-19 11:59:04 +0000
committerNorbert Preining <preining@logic.at>2009-01-19 11:59:04 +0000
commit5479fe2b1b2a3c99963f808a8ac30b7cb68d1cdc (patch)
tree578d3dddb1e42ef5e616bda8aacc586c36888496 /Master/texmf
parent2d43a1a3e63fe6a591d7e64c694434e451d4f561 (diff)
include Tomeks rework on tlmgr2 auto-update if available.
Needs rewording of some messages ... git-svn-id: svn://tug.org/texlive/trunk@11914 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl93
1 files changed, 36 insertions, 57 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index 2f55531f745..a7f15673ec3 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -1112,54 +1112,39 @@ sub action_backup {
return(\%ret);
}
-sub open_w32_updater {
- my $root = shift;
- open UPDATER, ">" . $root . "/tlpkg/installer/updater.bat"
- or die "Cannot create updater.bat: $!";
- print UPDATER <<'EOF';
-rem update program, can savely removed after it has been done
-set tlupdate=%~dp0
-set tldrive=%~d0
-
-%tldrive%
-cd %tlupdate%
-rem now we are in .../tlpkg/installer
-rem create tar.exe backup
-copy tar.exe tarsave.exe
-cd ..
-cd ..
-rem now we are in the root
-
-EOF
-;
- $::UPDATER = \*UPDATER;
-}
$::updater_started = 0;
#
-sub add_w32_updater {
+sub grow_w32_updater {
my ($tlp, $dry) = @_;
- sub do_one {
- my $pkg = shift;
- print $::UPDATER <<EOF;
-tlpkg\\installer\\lzma\\lzmadec.win32.exe < temp\\$pkg.tar.lzma > temp\\$pkg.tar
-tlpkg\\installer\\tarsave.exe -x -f temp\\$pkg.tar
-call tlmgr _include_tlpobj tlpkg\\tlpobj\\$pkg.tlpobj
-del temp\\$pkg.tar.lzma
-del temp\\$pkg.tar
-EOF
-;
- }
-
my $pkg = $tlp->name;
# that could be more intelligent for decent $dry output
my $root = $localtlpdb->root;
my $temp = "$root/temp";
return if $dry;
if (!$::updater_started) {
- open_w32_updater($root);
$::updater_started = 1;
+ $::updater_string = <<'EOF';
+rem update program, can savely removed after it has been done
+
+cd /d %~dp0
+rem now we are in .../tlpkg/installer
+rem create tar.exe backup
+copy tar.exe tarsave.exe
+cd ..\..
+rem now we are in the root
+EOF
+;
+ }
+ sub do_one {# moved down to 'preserve' the flow of the batch script upon reading
+ my $pkg = shift;
+ $::updater_string .= "
+tlpkg\\installer\\lzma\\lzmadec.win32.exe < temp\\$pkg.tar.lzma > temp\\$pkg.tar
+tlpkg\\installer\\tarsave.exe -x -f temp\\$pkg.tar
+call tlmgr _include_tlpobj tlpkg\\tlpobj\\$pkg.tlpobj
+del temp\\$pkg.tar.lzma temp\\$pkg.tar
+";
}
# these packages cannot be upgrade on w32
# so we have to create a update program
@@ -1223,26 +1208,20 @@ EOF
}
}
-sub close_w32_updater {
+sub write_w32_updater {
if ($::updater_started) {
- my $desktop_path = TeXLive::TLWinGoo::desktop_path();
- $desktop_path =~ s!/!\\!g;
- print $::UPDATER "del tlpkg\\installer\\tarsave.exe\n";
- print $::UPDATER "pause\n";
- print $::UPDATER "del \"$desktop_path\\TeX Live Updater Final Step.lnk\"\n";
- print $::UPDATER "rem del /s /q temp\n";
- print $::UPDATER "del \"\%~f0\"";
- close ($::UPDATER);
- # create a desktop shortcut
- add_desktop_shortcut(
- $localtlpdb->root,
- 'TeX Live Updater Final Step',
- '', # the icon
- $localtlpdb->root.'/tlpkg/installer/updater.bat',
- '', # no args
- '', # any non-null value to hide command-prompt
- );
- tlwarn("UPDATER has been created, please execute\n");
+ $::updater_string .= <<'EOF';
+
+del tlpkg\installer\tarsave.exe
+rmdir temp
+EOF
+;
+ open UPDATER, ">" . $localtlpdb->root . "/tlpkg/installer/updater.bat"
+ or die "Cannot create updater.bat: $!";
+ # print STDOUT $::updater_string;
+ print UPDATER $::updater_string;
+ close UPDATER;
+ tlwarn("UPDATER script has been created:\n");
tlwarn(" " . $localtlpdb->root . "\\tlpkg\\installer\\updater.bat\n");
}
}
@@ -1657,7 +1636,7 @@ sub action_update {
}
if (win32() && ($pkg =~ m/$WinSpecialUpdatePackagesRegexp/)) {
- add_w32_updater($mediatlp, $opts{"dry-run"});
+ grow_w32_updater($mediatlp, $opts{"dry-run"});
} else {
if ($::machinereadable) {
machine_line($pkg, $FLAG_UPDATE, $rev, $mediarev, $sizes{$pkg});
@@ -1742,7 +1721,7 @@ sub action_update {
}
# that already checks whether we actually have to do something
- close_w32_updater();
+ write_w32_updater();
if (($nrupdated == 0) && ($tlmediasrc->media ne "NET") && $opts{"all"}) {
# for all but net updates we warn if nothing is updated
tlwarn("\nNothing to update.\n");