diff options
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 3 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeViewGtk.py | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index ece5feda..77682ef0 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -1,3 +1,6 @@ +2006-10-10: + - fix time calculation + - fix kubuntu upgrade case 2006-10-06: - fix source.list rewrite corner case bug (#64159) 2006-10-04: diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index e77fe858..11b3e041 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -198,6 +198,7 @@ class GtkInstallProgressAdapter(InstallProgress): def conffile(self, current, new): logging.debug("got a conffile-prompt from dpkg for file: '%s'" % current) + start = time.time() #self.expander.set_expanded(True) prim = _("Replace the customized configuration file\n'%s'?") % current sec = _("You will lose any changes you have made to this " @@ -216,6 +217,7 @@ class GtkInstallProgressAdapter(InstallProgress): self.parent.textview_conffile.get_buffer().set_text(_("The 'diff' command was not found")) res = self.parent.dialog_conffile.run() self.parent.dialog_conffile.hide() + self.time_ui += time.time() - start # if replace, send this to the terminal if res == gtk.RESPONSE_YES: self.term.feed_child("y\n") @@ -242,9 +244,11 @@ class GtkInstallProgressAdapter(InstallProgress): self.last_activity = time.time() self.activity_timeout_reported = False delta = self.last_activity - self.start_time + # time wasted in conffile questions (or other ui activity) + delta -= self.time_ui time_per_percent = (float(delta)/percent) eta = (100.0 - self.percent) * time_per_percent - # only show if we have some sensible data + # only show if we have some sensible data (60sec < eta < 2days) if eta > 61.0 and eta < (60*60*24*2): self.progress.set_text(_("About %s remaining") % FuzzyTimeToStr(eta)) else: @@ -588,11 +592,11 @@ if __name__ == "__main__": fp = GtkFetchProgressAdapter(view) ip = GtkInstallProgressAdapter(view) - cache = apt.Cache() for pkg in sys.argv[1:]: cache[pkg].markInstall() cache.commit(fp,ip) + sys.exit(0) #sys.exit(0) ip.conffile("TODO","TODO~") |
