[pkg-java] r14838 - in trunk/maven-repo-helper: debian src/main/java/org/debian/maven/repo

Damien Raude-Morvan drazzib at alioth.debian.org
Sun Sep 11 19:59:18 UTC 2011


Author: drazzib
Date: 2011-09-11 19:59:18 +0000 (Sun, 11 Sep 2011)
New Revision: 14838

Modified:
   trunk/maven-repo-helper/debian/changelog
   trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java
Log:
mh_checkrepo: Fix error when launching without any param.

Modified: trunk/maven-repo-helper/debian/changelog
===================================================================
--- trunk/maven-repo-helper/debian/changelog	2011-09-11 19:55:23 UTC (rev 14837)
+++ trunk/maven-repo-helper/debian/changelog	2011-09-11 19:59:18 UTC (rev 14838)
@@ -1,5 +1,6 @@
 maven-repo-helper (1.6) UNRELEASED; urgency=low
 
+  [ Ludovic Claude ]
   * Add tutorial, reference and repository specification in documentation
   * Update options on mh_installpom and mh_installpoms, to use the new arguments
     added to mh_cleanpom
@@ -17,8 +18,11 @@
   * Review all options passed to the mh_* scripts, in particular --set-version
     for mh_installjar (Closes: #640730)
 
- -- Ludovic Claude <ludovic.claude at laposte.net>  Sun, 28 Aug 2011 00:31:08 +0100
+  [ Damien Raude-Morvan ]
+  * mh_checkrepo: Fix error when launching without any param.
 
+ -- Damien Raude-Morvan <drazzib at debian.org>  Sun, 11 Sep 2011 21:45:39 +0200
+
 maven-repo-helper (1.5.2) unstable; urgency=low
 
   [ Ludovic Claude ]

Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java	2011-09-11 19:55:23 UTC (rev 14837)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java	2011-09-11 19:59:18 UTC (rev 14838)
@@ -436,9 +436,7 @@
     }
 
     public static void main(String[] args) {
-        File repoLocation = new File("/usr/share/maven-repo");
-
-        if (args != null && "-h".equals(args[0]) || "--help".equals(args[0])) {
+        if (args != null && args.length > 0 && ("-h".equals(args[0]) || "--help".equals(args[0]))) {
             System.out.println("Purpose: Check content of a Maven repository.");
             System.out.println("Usage: [option]");
             System.out.println("");
@@ -449,20 +447,23 @@
             return;
         }
 
+        // default format
         String format = "text";
+        // default repository
+        File repoLocation = new File("/usr/share/maven-repo/");
 
         // Parse parameters
         int i = inc(-1, args);
         while (i < args.length && (args[i].trim().startsWith("-") || args[i].trim().isEmpty())) {
             String arg = args[i].trim();
             if (arg.startsWith("-o")) {
-                format = arg.substring(2);
+                format = arg.substring(2).trim();
             } else if (arg.startsWith("--output=")) {
-                format = arg.substring("--output=".length());
-             } else if (arg.startsWith("-r")) {
-                repoLocation = new File(arg.substring(2));
+                format = arg.substring("--output=".length()).trim();
+            } else if (arg.startsWith("-r")) {
+                repoLocation = new File(arg.substring(2).trim());
             } else if (arg.startsWith("--repository=")) {
-            	repoLocation = new File(arg.substring("--repository=".length()));
+                repoLocation = new File(arg.substring("--repository=".length()).trim());
             }
             i = inc(i, args);
         }




More information about the pkg-java-commits mailing list