From 0d23044ef2e0404e841bda74b4508853196080ba Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 04 Jul 2007 16:24:58 +0000
Subject: [PATCH] Update a number of files to add the missing svn:eol-style property.  Also, fix a couple of CDDL/copyright headers.  Finally, update the CheckPrecommit Ant task so that it properly checks for a property that can be used to ignore these problems and continue with the build.

---
 opends/src/build-tools/org/opends/build/tools/CheckPrecommit.java |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/opends/src/build-tools/org/opends/build/tools/CheckPrecommit.java b/opends/src/build-tools/org/opends/build/tools/CheckPrecommit.java
index 58de449..3c0eb92 100644
--- a/opends/src/build-tools/org/opends/build/tools/CheckPrecommit.java
+++ b/opends/src/build-tools/org/opends/build/tools/CheckPrecommit.java
@@ -190,7 +190,6 @@
 
     if (! eolStyleProblemFiles.isEmpty())
     {
-      fail = true;
       System.err.println("WARNING:  Potential svn:eol-style updates needed " +
                          "for the following files:");
       for (String filename : eolStyleProblemFiles)
@@ -198,14 +197,19 @@
         System.err.println("     " + filename);
       }
 
-      System.err.println("Fix svn:eol-style problems before proceeding, or " +
-                         "use '-D" + IGNORE_EOLSTYLE_ERRORS_PROPERTY +
-                         "=true' to ignore svn eol-style warnings.");
+      String ignoreProp =
+           getProject().getProperty(IGNORE_EOLSTYLE_ERRORS_PROPERTY);
+      if ((ignoreProp == null) || (! ignoreProp.equalsIgnoreCase("true")))
+      {
+        fail = true;
+        System.err.println("Fix svn:eol-style problems before proceeding, or " +
+                           "use '-D" + IGNORE_EOLSTYLE_ERRORS_PROPERTY +
+                           "=true' to ignore svn eol-style warnings.");
+      }
     }
 
     if (! copyrightProblemFiles.isEmpty())
     {
-      fail = true;
       System.err.println("WARNING:  Potential copyright year updates needed " +
                          "for the following files:");
       for (String filename : copyrightProblemFiles)
@@ -213,9 +217,15 @@
         System.err.println("     " + filename);
       }
 
-      System.err.println("Fix copyright date problems before proceeding, or " +
-                         "use '-D" + IGNORE_COPYRIGHT_ERRORS_PROPERTY +
-                         "=true' to ignore copyright warnings.");
+      String ignoreProp =
+           getProject().getProperty(IGNORE_COPYRIGHT_ERRORS_PROPERTY);
+      if ((ignoreProp == null) || (! ignoreProp.equalsIgnoreCase("true")))
+      {
+        fail = true;
+        System.err.println("Fix copyright date problems before proceeding, " +
+                           "or use '-D" + IGNORE_COPYRIGHT_ERRORS_PROPERTY +
+                           "=true' to ignore copyright warnings.");
+      }
     }
 
     if (fail)
@@ -274,9 +284,9 @@
 
 
     String filePath = file.getAbsolutePath();
-    if (filePath.startsWith(workspacePath.getPath()))
+    if (filePath.startsWith(workspacePath.getPath() + "/"))
     {
-      filePath = filePath.substring(workspacePath.getPath().length());
+      filePath = filePath.substring(workspacePath.getPath().length() + 1);
     }
 
 

--
Gitblit v1.10.0