bodewig     2004/04/13 04:20:15

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ssh
                        AbstractSshMessage.java
  Log:
  less noisy verbose mode for <scp> by Rami Ojares
  
  Revision  Changes    Path
  1.10      +18 -6     
ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java
  
  Index: AbstractSshMessage.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractSshMessage.java   7 Apr 2004 13:30:30 -0000       1.9
  +++ AbstractSshMessage.java   13 Apr 2004 11:20:14 -0000      1.10
  @@ -138,14 +138,26 @@
       protected final int trackProgress(int filesize, int totalLength, 
                                         int percentTransmitted) {
   
  -        int percent = (int) Math.round(Math.floor((totalLength 
  -                                                   / (double)filesize) 
  -                                                  * 100));
  +        int percent = (int) Math.round(Math.floor((totalLength /
  +                                                   (double)filesize) * 100));
  +
           if (percent > percentTransmitted) {
  -            if (filesize < 1048576 && (percent % 10 != 0)) {
  -                // do not track between tenths
  +            if (filesize < 1048576) {
  +                if (percent % 10 == 0) {
  +                    if (percent == 100) {
  +                        System.out.println(" 100%");
  +                    } else {
  +                        System.out.print("*");
  +                    }
  +                }
               } else {
  -                log("" + percent + "%");
  +                if (percent == 50) {
  +                    System.out.println(" 50%");
  +                } else if (percent == 100) {
  +                    System.out.println(" 100%");
  +                } else {
  +                    System.out.print(".");
  +                }
               }
           }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to