incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 36579 - incubator/depot/trunk/update/src/java/org/apache/depot/update/tool
Date Wed, 18 Aug 2004 20:43:17 GMT
Author: ajack
Date: Wed Aug 18 13:43:16 2004
New Revision: 36579

Modified:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
Log:
Added -rs (-set) to DownloaderTool so Gump can specify a repository set (i.e. gump) not just
a URL.

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/tool/DownloaderTool.java
Wed Aug 18 13:43:16 2004
@@ -14,6 +14,7 @@
  *  limitations under the License.
  */
 package org.apache.depot.update.tool;
+import org.apache.depot.common.DepotException;
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.cli.CommandLine;
 import org.apache.depot.common.util.cli.Option;
@@ -29,6 +30,7 @@
 	private static Option l_repoOption = null;
 	private static Option l_targetOption = null;
 	private static Option l_groupOption = null;
+	private static Option l_setOption = null;
 	private static Option l_configOption = null;
 	static {
 		l_repoOption = new Option("r", "repo", true, "Repository");
@@ -36,6 +38,7 @@
 		l_configOption = new Option("c", "config", true,
 				"The configuration file");
 		l_groupOption = new Option("g", "group", true, "The group to go get");
+		l_setOption = new Option("rs", "set", true, "The repository set to use");
 		l_targetOption = new Option("t", "target", true,
 				"The target directory to put it into");
 	}
@@ -48,6 +51,7 @@
 		getOptions().addOption(l_repoOption);
 		getOptions().addOption(l_configOption);
 		getOptions().addOption(l_groupOption);
+		getOptions().addOption(l_setOption);
 		getOptions().addOption(l_targetOption);
 	}
 
@@ -64,6 +68,8 @@
 		String configName = cmdline.getOptionValue(l_configOption);
 		// Optional repository URL
 		String repoUrl = cmdline.getOptionValue(l_repoOption);
+		// Optional repository set name
+		String setName = cmdline.getOptionValue(l_setOption);
 
 		ArtifactUpdater updater = new ArtifactUpdater();
 
@@ -74,8 +80,13 @@
 			
 			Logger.getLogger().info("Repository @ " + repoUrl);
 		} else {
-			updater.setRepositorySet(RepositorySet.getRepositorySet("gump",
+			if (null != setName) {
+				
+			updater.setRepositorySet(RepositorySet.getRepositorySet(setName,
 					false));
+			}
+			else
+				throw new DepotException("No repository URL or set specificed.");
 		}
 
 		if ( null != configName )

Mime
View raw message