[tex-live] Solution to the file locking problem during update - take 2

T T t34www at googlemail.com
Thu Jan 15 22:07:34 CET 2009

OK, I modified tlmgr2.pl from svn, tested it and it seems to work OK.
I attach it together with the new tlmgr.bat wrapper. I didn't use the
full svn install for tests. I only copied missing TLPaper.pm and
various *2.pl files (gui-config2.pl didn't work, I used gui-config.pl

Here are the changes I've made:


Thanks to recent changes in how gui mode is started (it seems to work
faster now) I only needed to change (open,add,close)_w32_updater

* open_w32_updater is now inlined in add_w32_updater and it
initializes $::updater_string instead of opening a file
* add_w32_updater has been renamed to grow_w32_updater and it writes
stuff to $::updater_string
* close_w32_updater has been renamed to write_w32_updater and it
writes $::updater_string to updater.bat; desktop link related stuff
has been removed and some messages changed.


* some cosmetic changes to the header
* no selfdelete at the end (this is done by the tlmgr.bat now) but
instead 'rmdir temp' will remove temp dir if it is empty (it should be
empty after successful update)


This script replaces generic launcher script used so far. It sets
environment for perl (path and perl5lib) and starts tlmgr.pl. After
tlmgr.pl is done it looks for updater.bat. If it exists it is renamed
to updater.bat.bat, executed and deleted. The last line of the script
contains several commands separated by '&'. This is to ensure that
tlmgr.bat will terminate properly even if it is updated during
execution, so do not split this into multiple lines.

A few more modifications that could be considered:
* if tlmgr.pl was in gui mode it could relaunch itself after update by
appending 'call tlmgr gui' to updater.bat
* updater.bat could return an error code that could be propagated up
and acted upon in case of some failures (the simplest thing would be
to leave updater.bat for inspection instead of removing it)


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tlmgr.bat.txt
Url: http://tug.org/pipermail/tex-live/attachments/20090115/d8592227/attachment-0002.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tlmgr2-mod.pl.txt
Url: http://tug.org/pipermail/tex-live/attachments/20090115/d8592227/attachment-0003.txt 

More information about the tex-live mailing list