summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2008-08-01 19:25:30 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2008-08-01 19:25:30 +0000
commite9c518ce04efe33a05059645ced3fa4942fa8068 (patch)
tree276099989f1817d5d97795a378fdcc1ae3b9d63d /Master/tlpkg/TeXLive/TLWinGoo.pm
parent8c60aab83c96e957db6dcf6c792f6268536b228b (diff)
TLWinGoo: warn, don't die if file cannot be opened
git-svn-id: svn://tug.org/texlive/trunk@9989 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm40
1 files changed, 25 insertions, 15 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm
index d41cb4b10bb..e0c9f623cba 100644
--- a/Master/tlpkg/TeXLive/TLWinGoo.pm
+++ b/Master/tlpkg/TeXLive/TLWinGoo.pm
@@ -841,11 +841,13 @@ sub add_desktop_shortcut {
$shc->Save($shfile);
# update batchfile for uninstalling shortcuts
- open UNSHORT, ">>$texdir/tlpkg/installer/unshort.bat" ||
- die "Cannot open $texdir/tlpkg/installer/unshort.bat for appending: $!";
- $shfile =~ s!/!\\!g;
- print UNSHORT 'del "'.$shfile."\" 2>nul\n";
- close UNSHORT;
+ if (open UNSHORT, ">>$texdir/tlpkg/installer/unshort.bat") {
+ $shfile =~ s!/!\\!g;
+ print UNSHORT 'del "'.$shfile."\" 2>nul\n";
+ close UNSHORT;
+ } else {
+ warn "Cannot open $texdir/tlpkg/installer/unshort.bat for appending: $!";
+ }
}
=cut
@@ -899,10 +901,12 @@ sub init_unshortbat {
$menupath =~ s!/!\\!g;
# batchfile for uninstalling shortcuts
- open UNSHORT, ">$texdirw/tlpkg/installer/unshort.bat" ||
- die "Cannot create $texdirw/tlpkg/installer/unshort.bat: $!";
- print UNSHORT 'rmdir /s /q "'.$menupath."\\TeX Live 2008\" 2>nul\n";
- close UNSHORT;
+ if (open UNSHORT, ">$texdirw/tlpkg/installer/unshort.bat") {
+ print UNSHORT 'rmdir /s /q "'.$menupath."\\TeX Live 2008\" 2>nul\n";
+ close UNSHORT;
+ } else {
+ warn "Cannot create $texdirw/tlpkg/installer/unshort.bat: $!";
+ }
}
=cut
@@ -980,8 +984,8 @@ sub create_uninstaller {
$k->{'/URLInfoAbout'} = "http://www.tug.org/texlive";
mkdirhier("$tdwfw/tlpkg/installer"); # wasn't this done yet?
- open UNINST, ">$tdwfw/tlpkg/installer/uninst.bat";
- print UNINST <<UNEND;
+ if (open UNINST, ">$tdwfw/tlpkg/installer/uninst.bat") {
+ print UNINST <<UNEND;
\@echo off
rem This should not be necessary, but sometimes it is:
path $td\\bin\\win32;%path%
@@ -994,9 +998,12 @@ rem pause
UNEND
;
close UNINST;
+ } else {
+ warn "Cannot open uninstaller for append";
+ }
- open UNINST2, ">$tdwfw/tlpkg/installer/uninst2.bat";
- print UNINST2 <<UNEND2 if $td eq $tdw;
+ if (open UNINST2, ">$tdwfw/tlpkg/installer/uninst2.bat") {
+ print UNINST2 <<UNEND2 if $td eq $tdw;
rmdir /s /q \"$td\\texmf-dist\"
rmdir /s /q \"$td\\texmf-doc\"
rmdir /s /q \"$td\\texmf\"
@@ -1008,7 +1015,7 @@ del /s /q \"$tl\\LICENSE.*\"
del /q \"$tl\\index.html\"
UNEND2
;
- print UNINST2 <<UNEND2;
+ print UNINST2 <<UNEND2;
rmdir /s /q \"$tdsv\"
rmdir /s /q \"$tdsc\"
rmdir /s /q \"$tdw\\temp\"
@@ -1023,7 +1030,10 @@ rem \@pause
del %0
UNEND2
;
- close UNINST2;
+ close UNINST2;
+ } else {
+ warn "Cannot open unist2.bat for writing";
+ }
}
=pod