ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs AbstractCvsTask.java
Date Wed, 26 Feb 2003 10:46:10 GMT
bodewig     2003/02/26 02:46:10

  Modified:    src/main/org/apache/tools/ant/taskdefs AbstractCvsTask.java
  Log:
  Merge fix for bug 17365 from HEAD
  
  Revision  Changes    Path
  1.18      +20 -9     ant/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
  
  Index: AbstractCvsTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AbstractCvsTask.java	10 Feb 2003 14:13:34 -0000	1.17
  +++ AbstractCvsTask.java	26 Feb 2003 10:46:10 -0000	1.18
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -276,24 +276,35 @@
            * Need a better cross platform integration with <cvspass>, so
            * use the same filename.
            */
  -        if(passFile == null) {
  +        if (passFile == null) {
   
               File defaultPassFile = new File(
                   System.getProperty("cygwin.user.home",
                       System.getProperty("user.home")) 
                   + File.separatorChar + ".cvspass");
   
  -            if(defaultPassFile.exists())
  +            if(defaultPassFile.exists()) {
                   this.setPassfile(defaultPassFile);
  +            }
           }
   
           if (passFile != null) {
  -            Environment.Variable var = new Environment.Variable();
  -            var.setKey("CVS_PASSFILE");
  -            var.setValue(String.valueOf(passFile));
  -            env.addVariable(var);
  -            log("Using cvs passfile: " + String.valueOf(passFile), 
  -                Project.MSG_INFO);
  +            if (passFile.isFile() && passFile.canRead()) {
  +                Environment.Variable var = new Environment.Variable();
  +                var.setKey("CVS_PASSFILE");
  +                var.setValue(String.valueOf(passFile));
  +                env.addVariable(var);
  +                log("Using cvs passfile: " + String.valueOf(passFile), 
  +                    Project.MSG_INFO);
  +            } else if (!passFile.canRead()) {
  +                log("cvs passfile: " + String.valueOf(passFile)
  +                    + " ignored as it is not readable",
  +                    Project.MSG_WARN);
  +            } else {
  +                log("cvs passfile: " + String.valueOf(passFile)
  +                    + " ignored as it is not a file",
  +                    Project.MSG_WARN);
  +            }
           }
   
           if (cvsRsh != null) {
  
  
  

Mime
View raw message