aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2008-01-09 01:29:34 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2008-01-09 01:29:34 +0000
commit0083f4e56d78bfff25782cb2af63ece6f47efee6 (patch)
tree4a6e518adf7f36cf2d40dcd547954ae38d56e4d2
parent377e5a6c458e7100b69fc5ad2e79a08495458599 (diff)
downloadpaludis-0083f4e56d78bfff25782cb2af63ece6f47efee6.tar.gz
paludis-0083f4e56d78bfff25782cb2af63ece6f47efee6.tar.xz
Some misc. fixes from dleverton.
-rw-r--r--paludis/repositories/e/distfiles_size_visitor.cc5
-rw-r--r--paludis/repositories/e/e_key.cc4
2 files changed, 6 insertions, 3 deletions
diff --git a/paludis/repositories/e/distfiles_size_visitor.cc b/paludis/repositories/e/distfiles_size_visitor.cc
index a5883bd..15ced88 100644
--- a/paludis/repositories/e/distfiles_size_visitor.cc
+++ b/paludis/repositories/e/distfiles_size_visitor.cc
@@ -132,7 +132,10 @@ DistfilesSizeVisitor::visit_leaf(const FetchableURIDepSpec & u)
if (destination.exists() && ! _imp->everything)
return;
- long s((*_imp->m2r->find("DIST", u.filename())).size);
+ Manifest2Reader::ConstIterator m(_imp->m2r->find("DIST", u.filename()));
+ if (_imp->m2r->end() == m)
+ return;
+ long s(m->size);
Log::get_instance()->message(ll_debug, lc_context) << "Adding " << s << " to size. Was "
<< _imp->size << ", is now " << (_imp->size + s);
_imp->size += s;
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 99337fc..e3edd75 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -1149,12 +1149,12 @@ EDistSizeKey::pretty_print() const
std::string suffix[] = {"Bytes", "kBytes", "MBytes", "GBytes"};
std::ostringstream val;
- while (size >= 1024.0 && i < 4)
+ while (size >= 1024.0 && i < 3)
{
size /= 1024.0;
i++;
- val << std::fixed << std::setprecision(2);
}
+ if (i >= 1) val << std::fixed << std::setprecision(2);
val << size << " " << suffix[i];