Переглянути джерело

ZOOKEEPER-241. Build of a distro fails after clean target is run. (patrick hunt via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@724913 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 16 роки тому
батько
коміт
4ee7c1d3a9

+ 3 - 0
CHANGES.txt

@@ -47,6 +47,9 @@ joffe via mahadev)
   ZOOKEEPER-248.  QuorumPeer should use Map interface instead of 
 HashMap implementation. (nitay joffe via mahadev)
 
+  ZOOKEEPER-241. Build of a distro fails after clean target is run. (patrick
+hunt via mahadev)
+
 IMPROVEMENTS:
    
    ZOOKEEPER-64. Log system env information when initializing server and

+ 9 - 1
src/java/main/org/apache/zookeeper/version/util/VerGen.java

@@ -59,6 +59,9 @@ public class VerGen {
             w.write("    public static final int MAJOR=" + maj + ";\n");
             w.write("    public static final int MINOR=" + min + ";\n");
             w.write("    public static final int MICRO=" + micro + ";\n");
+            if (rev < 0) {
+                System.out.println("Unknown REVISION number, using " + rev);
+            }
             w.write("    public static final int REVISION=" + rev + ";\n");
             w.write("    public static final String BUILD_DATE=\"" + buildDate
                     + "\";\n");
@@ -108,7 +111,12 @@ public class VerGen {
             int maj = Integer.parseInt(v[0]);
             int min = Integer.parseInt(v[1]);
             int micro = Integer.parseInt(v[2]);
-            int rev = Integer.parseInt(args[1]);
+            int rev;
+            try {
+                rev = Integer.parseInt(args[1]);
+            } catch (NumberFormatException e) {
+                rev = -1;
+            }
             generateFile(new File("."), maj, min, micro, rev, args[2]);
         } catch (NumberFormatException e) {
             System.err