[otrs-cvs] UnitTest/bin UnitTestAutoSetup.pl,1.268,1.269

"CVS commits notifications of OTRS.org" <[email protected]> Mon, 8 Apr 2013 13:45:27 +0000
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/UnitTest/bin
In directory lancelot:/tmp/cvs-serv32382/bin

Modified Files:
	UnitTestAutoSetup.pl 
Log Message:
Improved git lockfile handling.

Author: mg

Index: UnitTestAutoSetup.pl
===================================================================
RCS file: /home/cvs/UnitTest/bin/UnitTestAutoSetup.pl,v
retrieving revision 1.268
retrieving revision 1.269
diff -2 -u -d -r1.268 -r1.269
--- UnitTestAutoSetup.pl	5 Apr 2013 12:08:21 -0000	1.268
+++ UnitTestAutoSetup.pl	8 Apr 2013 13:45:22 -0000	1.269
@@ -899,4 +899,14 @@
         print STDOUT "NOTICE: git clone\n";
 
+        # Check for git lockfiles that might still be there from previous crashed runs.
+        if ( -e "/var/tmp/OTRSGitCache/otrs/.git/index.lock" ) {
+            sleep 60;
+        }
+
+        if ( -e "/var/tmp/OTRSGitCache/otrs/.git/index.lock" ) {
+            print STDOUT "NOTICE: Git lockfile found. Deleting /var/tmp/OTRSGitCache/otrs.\n";
+            system 'rm -rf /var/tmp/OTRSGitCache/otrs';
+        }
+
         # Create initial git clone
         if ( !-d "/var/tmp/OTRSGitCache/otrs" ) {
@@ -909,9 +919,4 @@
         }
 
- # Remove possible git lockfiles that might still be there from previous crashed runs.
- #   This script has its own locking mechanism so we can be pretty sure that git is not running yet.
-        print STDOUT "NOTICE: rm /var/tmp/OTRSGitCache/otrs/.git/index.lock\n";
-        unlink '/var/tmp/OTRSGitCache/otrs/.git/index.lock';
-
         print STDOUT
             "NOTICE: cd /var/tmp/OTRSGitCache/otrs && git checkout $Scenario->{Framework}\n";
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log