Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 95651 invoked from network); 19 Apr 2000 07:33:30 -0000 Received: from unknown (HELO heidegger.picture-safe.de) (212.76.152.100) by locus.apache.org with SMTP; 19 Apr 2000 07:33:30 -0000 Received: from kant.picturesafe.de (kant [212.76.153.3]) by heidegger.picture-safe.de (8.8.7/8.8.7/980415/wpv/CA-3) with ESMTP id JAA00955 for ; Wed, 19 Apr 2000 09:31:57 +0200 Received: from stpauli (pa163.picture-safe.de [212.76.152.163]) by kant.picturesafe.de (8.8.7/8.8.7) with SMTP id LAA07039 for ; Wed, 19 Apr 2000 11:32:27 +0200 From: "Wolfgang Werner" To: Subject: Cvs Task, 2nd try Date: Wed, 19 Apr 2000 09:37:22 +0200 Message-ID: <000201bfa9d2$1ab55160$a3984cd4@picturesafe.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0003_01BFA9E2.DE3FA800" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0003_01BFA9E2.DE3FA800 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, I followed your suggestions, Thomas, and have added your fix to my version. cvs diff -u output here, full file attached. ---------------------------- schnipp ------------------------------- Index: Cvs.java =================================================================== RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,v retrieving revision 1.3 diff -u -r1.3 Cvs.java --- Cvs.java 2000/01/30 17:15:32 1.3 +++ Cvs.java 2000/04/19 06:21:58 @@ -66,23 +66,49 @@ public class Cvs extends Exec { - private String cvsRoot; - private String pack; - private String tag; + private String cvsRoot; + private String pack; + private String tag; + private String command = "checkout"; + private boolean quiet = false; + private boolean noexec = false; public void execute() throws BuildException { // XXX: we should use JCVS (www.ice.com/JCVS) instead of command line // execution so that we don't rely on having native CVS stuff around (SM) - StringBuffer sb=new StringBuffer(); - sb.append(" cvs -d ").append( cvsRoot ).append(" checkout "); - if (tag!=null) - sb.append("-r ").append(tag).append(" "); - - sb.append( pack ); + StringBuffer + sb = new StringBuffer(); + + sb.append(" cvs "); + + if ((null != cvsRoot) && (cvsRoot.length() > 0)) + { + sb.append("-d ") + .append(cvsRoot) + .append(" "); + } + + sb.append(noexec ? "-n " : "") + .append(quiet ? "-q " : "") + .append(" ") + .append(command) + .append(" "); + + if ((null != tag) && (tag.length() > 0)) + { + sb.append("-r ") + .append(tag) + .append(" "); + } + + if ((null != pack) && (pack.length() > 0)) + { + sb.append(pack); + } - run(sb.toString()); + run(sb.toString()); } public void setCvsRoot(String root) { @@ -100,6 +126,18 @@ public void setTag(String p) { this.tag = p; } + + public void setCommand(String c) { + this.command = c; + } + + public void setQuiet(String q) { + quiet = Project.toBoolean(q); + } + + public void setNoexec(String ne) { + noexec = Project.toBoolean(ne); + } } ---------------------------- schnapp ------------------------------- works for me. Wolfgang Werner ------=_NextPart_000_0003_01BFA9E2.DE3FA800 Content-Type: application/octet-stream; name="Cvs.java" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Cvs.java" /* * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . */ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.*; import java.io.*; /** * * * @author costin@dnt.ro * @author stefano@apache.org */ public class Cvs extends Exec { private String cvsRoot; private String pack; private String tag; private String command = "checkout"; private boolean quiet = false; private boolean noexec = false; public void execute() throws BuildException { // XXX: we should use JCVS (www.ice.com/JCVS) instead of command line // execution so that we don't rely on having native CVS stuff around (SM) StringBuffer sb = new StringBuffer(); sb.append(" cvs "); if ((null != cvsRoot) && (cvsRoot.length() > 0)) { sb.append("-d ") .append(cvsRoot) .append(" "); } sb.append(noexec ? "-n " : "") .append(quiet ? "-q " : "") .append(" ") .append(command) .append(" "); if ((null != tag) && (tag.length() > 0)) { sb.append("-r ") .append(tag) .append(" "); } if ((null != pack) && (pack.length() > 0)) { sb.append(pack); } run(sb.toString()); } public void setCvsRoot(String root) { this.cvsRoot = root; } public void setDest(String dest) { setDir(dest); } public void setPackage(String p) { this.pack = p; } public void setTag(String p) { this.tag = p; } public void setCommand(String c) { this.command = c; } public void setQuiet(String q) { quiet = Project.toBoolean(q); } public void setNoexec(String ne) { noexec = Project.toBoolean(ne); } } ------=_NextPart_000_0003_01BFA9E2.DE3FA800--