From 4041791887e6e3ee08c82c6e437495cab8762526 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 13 Apr 2004 11:20:14 +0000 Subject: [PATCH] less noisy verbose mode for by Rami Ojares git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276298 13f79535-47bb-0310-9956-ffa450edef68 --- .../optional/ssh/AbstractSshMessage.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java index 2ad605c4d..eefec7a9d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java @@ -138,14 +138,26 @@ public abstract class AbstractSshMessage { 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("."); + } } }