]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/progress.cc
add the possibility to disable only the progress reporting stuff as the
[apt.git] / apt-pkg / contrib / progress.cc
index cb272e3898a2b415960c9fa68f4cd8281e9c01d3..45e81edcb3ca3ab7b7f877f799cf7fb1aa9b9633 100644 (file)
@@ -8,9 +8,6 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/progress.h"
-#endif 
 #include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
@@ -19,6 +16,7 @@
 
 #include <iostream>
 #include <stdio.h>
 
 #include <iostream>
 #include <stdio.h>
+#include <cstring>
                                                                        /*}}}*/
 
 using namespace std;
                                                                        /*}}}*/
 
 using namespace std;
@@ -115,6 +113,8 @@ bool OpProgress::CheckChange(float Interval)
    
    if ((int)LastPercent == (int)Percent)
       return false;
    
    if ((int)LastPercent == (int)Percent)
       return false;
+
+   LastPercent = Percent;
    
    if (Interval == 0)
       return false;
    
    if (Interval == 0)
       return false;
@@ -126,7 +126,6 @@ bool OpProgress::CheckChange(float Interval)
    if (Diff < Interval)
       return false;
    LastTime = Now;   
    if (Diff < Interval)
       return false;
    LastTime = Now;   
-   LastPercent = Percent;
    return true;
 }
                                                                        /*}}}*/
    return true;
 }
                                                                        /*}}}*/
@@ -136,7 +135,7 @@ bool OpProgress::CheckChange(float Interval)
 OpTextProgress::OpTextProgress(Configuration &Config) : 
                                NoUpdate(false), NoDisplay(false), LastLen(0) 
 {
 OpTextProgress::OpTextProgress(Configuration &Config) : 
                                NoUpdate(false), NoDisplay(false), LastLen(0) 
 {
-   if (Config.FindI("quiet",0) >= 1)
+   if (Config.FindI("quiet",0) >= 1 || Config.FindB("quiet::NoUpdate", false) == true)
       NoUpdate = true;
    if (Config.FindI("quiet",0) >= 2)
       NoDisplay = true;
       NoUpdate = true;
    if (Config.FindI("quiet",0) >= 2)
       NoDisplay = true;