From 5956782071eb323f726315e166f2d84a5d135cc7 Mon Sep 17 00:00:00 2001
From: "thakis@chromium.org"
 <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Thu, 19 Jan 2012 22:04:19 +0000
Subject: vim: Let ninja-build.vim detect Release correctly if out/Debug/protoc
 doesn't exist at all.

BUG=none
TEST=none


Review URL: http://codereview.chromium.org/9265016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118368 0039d316-1c4b-4281-b951-d872f2087c98
---
 tools/vim/ninja-build.vim | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'tools/vim')

diff --git a/tools/vim/ninja-build.vim b/tools/vim/ninja-build.vim
index a882223..d47b0e7 100644
--- a/tools/vim/ninja-build.vim
+++ b/tools/vim/ninja-build.vim
@@ -1,4 +1,4 @@
-" Copyright (c) 2011 The Chromium Authors. All rights reserved.
+" Copyright (c) 2012 The Chromium Authors. All rights reserved.
 " Use of this source code is governed by a BSD-style license that can be
 " found in the LICENSE file.
 "
@@ -43,10 +43,13 @@ def guess_configuration():
   def is_release_15s_newer(test_path):
     try:
       debug_mtime = os.path.getmtime(os.path.join(root, 'Debug', test_path))
+    except os.error:
+      debug_mtime = 0
+    try:
       rel_mtime = os.path.getmtime(os.path.join(root, 'Release',  test_path))
-      return rel_mtime - debug_mtime >= 15
     except os.error:
-      return False
+      rel_mtime = 0
+    return rel_mtime - debug_mtime >= 15
   configuration = 'Debug'
   if is_release_15s_newer('build.ninja') or is_release_15s_newer('protoc'):
     configuration = 'Release'
-- 
cgit v1.1