Open msoutopico opened 4 years ago
Sample jar files can be downloaded from https://capps.capstan.be/Files/plugins.zip
Screencast that shows the problem: https://recordit.co/8qceTOldMj
Another one, although with a less realistic scenario: https://recordit.co/BD63bmEs34
Not sure why this issue happens, but I assume it is because the script tries to put a jar file in the plugins
folder and it can't because the file (a file with the same name) is already there (with the same name) and/or because the file is locked.
If that's the case, to make things easier, I think it should be reasonable to assume that a new version of a plugin should always have a new name (a higher version number). The implication is that script doesn't try to overwrite jar files that have the same name.
In other words, for each jar file in the plugins.zip
bundle, it checks whether it is in the plugins
folder already):
plugins
folder and
b. checks whether there's a older version of the same plugin, to delete it later (after OmegaT is killed) by means of the bat file.In a nutshell: skip file instead of overwriting (that would be the only change).
The above is of course a compromise, because the ideal behavior is that it writes all files in the plugins.zip
bundle to the plugins
folder, overwrites any file that might be already there. If that's not feasible or easy to achieve, we can go with the above.
Preconditions
OmegaT 4.x.x installed in a machine running Windows 10. Script
application_startup\updateConfigBundle.groovy
is version 0.4.9 anddef customUrl = ""
Filecustomisation.properties
has url:https://cat.capstan.be/OmegaT/dev2021_049/index.php
Local customization version57_cs0 (2020-11-25)
Remote customization version58_c0p (2020-11-26)
Local plugins:
Remote plugins:
Steps to reproduce
Just launch OmegaT.
Expected results
The script runs and sees that
okapiFiltersForOmegaT-1.8-1.40.0-capstan.jar
is a new version ofokapiFiltersForOmegaT-1.6-m40-capstan.jar
, so the former must replace the latter.The new version is downloaded and, after OmegaT shuts down, the old version of the plugin is deleted (by means of the bat file triggered by the script).
Actual results
The progress bar dialog runs forever and the script fails with error
javax.script.ScriptException: javax.script.ScriptException: org.apache.commons.io.FileExistsException: Destination 'C:\Users\souto\AppData\Roaming\OmegaT\plugins\omegat-bidimarkers-0.2.0-all.jar' already exists
.See full console output:
Reproduced in my machine. Other users haver reported same behaviour (customizer runs forever), although I couldn't see whether they had the same error.
The only way to stop that is to close the progress bar dialog, which closes OmegaT. The
version_notes.txt
is updated/overwritten, whereas thelocal_version_notes.txt
remains unaltered.