Issue 424: init truncates bin/gerrit.war if run from bin/gerrit.war
Status:  Released
Owner:
Closed:  Oct 2012
Project Member Reported by sop@google.com, Feb 1, 2010
What steps will reproduce the problem?
1. Copy new version to $site_path/bin/gerrit.war
2. Run bin/gerrit.war init -d $site_path
3. Answer "Y" to copy the WAR file on top of itself.

The file is truncated to 0 bytes, and a subsequent restart
of the server will fail.

If the file we are copying from is the file we are going
to copy into, we shouldn't do the copy at all.

Better, we should use JGit's LockFile class to perform the
update of the WAR, because it won't truncate the destination.
Instead it writes to a temporary file, and then renames that
on top of the destination if the copy is fully successful.
Feb 1, 2010
#1 sop@google.com
We probably should do the same thing with updates of
the gerrit.sh start script.  We also don't want that
to get corrupted if the disk fills up during an upgrade.
Feb 2, 2010
#2 sop@google.com
(No comment was entered for this change.)
Owner: nsallemb...@google.com
Feb 2, 2010
#3 sop@google.com
WAR ovewrite fixed in I32945d4a738ae832850e05d732181d914e2127a7
Status: Fixed
Labels: -Milestone-2.1.2 FixedIn-2.1.2
Oct 21, 2012
#4 sop@google.com
(No comment was entered for this change.)
Status: Released