diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-06-29 11:43:32 +0000 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-06-29 11:43:32 +0000 |
commit | bc80031f74e4acfca5b8ca7188b12ee885a713bd (patch) | |
tree | cc5827e0715cfc99e14dbf5501a5001bed13c827 /apt-pkg/depcache.cc | |
parent | e23e673308e24ccbed5afa04179ade52d408db87 (diff) | |
download | apt-bc80031f74e4acfca5b8ca7188b12ee885a713bd.tar.gz |
* fix a bug when readStateFile is called with no OpProgress object
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r-- | apt-pkg/depcache.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 05512e179..366687382 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -112,8 +112,9 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) if(FileExists(state)) { state_file.Open(state, FileFd::ReadOnly); int file_size = state_file.Size(); - Prog->OverallProgress(0, file_size, 1, - _("Reading state information")); + if(Prog != NULL) + Prog->OverallProgress(0, file_size, 1, + _("Reading state information")); pkgTagFile tagfile(&state_file); pkgTagSection section; @@ -131,11 +132,13 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) std::cout << "Install-Reason for: " << pkgname << " is " << reason << std::endl; amt+=section.size(); - Prog->OverallProgress(amt, file_size, 1, - _("Reading state information")); + if(Prog != NULL) + Prog->OverallProgress(amt, file_size, 1, + _("Reading state information")); } - Prog->OverallProgress(file_size, file_size, 1, - _("Reading state information")); + if(Prog != NULL) + Prog->OverallProgress(file_size, file_size, 1, + _("Reading state information")); } } |