There was a (in)famous incident where the implementation for rerunning the Semantic Index Builder did the same thing - it (formerly) erased all the files in the target directory.

What happened was a senior level manager (Dave Ferrucci) was just trying out this code, he was busy and didn't read all the fine print, and when it asked him where to put the index, he said - well - hmm - just put it on my desk top. Sure enough, the code erased his entire desktop... He was not happy about this, to say the least.

So - if you want to do this, please be sure this kind of user scenario won't occur by accident.
-Marshall

Michael Baessler wrote:
Hi,

when installing a PEAR file, currently the InstallationController API overrides all available data in the target installation directory. The directory content isn't removed before. So it can happen that old class files or descriptor files that are never valid are still in the installation directory since they will not be removed when the new stuff is installed. Existing files with the same name will be overridden.

So my plan was to clean the target installation directory before the new PEAR file is installed to it. If the target install directory should be cleaned can be specified with an additional parameter when using the PEAR installer API.

An known issue with that approach is, that after installing a PEAR file to a directory, the same PEAR file cannot be installed again to the same directory with the same JVM since the JVM has locked the jars so they cannot be deleted when the directory for the next installation should be cleaned. To do that, the JVM must be restarted, or another installation directory must be used. The JVM locks the jar files when the installation verification is executed.

What do others think about this approach?

-- Michael






Reply via email to