summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-02-03 13:19:12 +0100
committerJulian Andres Klode <jak@debian.org>2025-02-03 12:40:37 +0000
commit452586e84ad54ca23dee399bf9809c49e7171f36 (patch)
tree7db1a71ec3a10cf390a75d8ed1107655363e8e8c
parentc303750ecb89b7210fe998515432e358b3cc0cff (diff)
Measure BootSize as integer
I don't know why I used a double here this is awkward.
-rw-r--r--apt-pkg/depcache.cc4
-rw-r--r--apt-pkg/depcache.h2
-rw-r--r--apt-private/private-install.cc4
3 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index c8999093b..ef93a54bb 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -2638,7 +2638,7 @@ bool pkgDepCache::PhasingApplied(pkgCache::PkgIterator Pkg) const
/*}}}*/
// DepCache::BootSize /*{{{*/
-double pkgDepCache::BootSize(bool initrdOnly)
+unsigned long long pkgDepCache::BootSize(bool initrdOnly)
{
int BootCount = 0;
auto VirtualKernelPkg = FindPkg("$kernel", "any");
@@ -2681,6 +2681,6 @@ double pkgDepCache::BootSize(bool initrdOnly)
sizes[type] = std::max(sizes[type], st.st_size);
}
closedir(boot);
- return std::accumulate(sizes, sizes + MAX_ARTEFACT, off_t{0}) * 1.1 * BootCount;
+ return std::accumulate(sizes, sizes + MAX_ARTEFACT, off_t{0}) * BootCount * 110 / 100;
}
/*}}}*/
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 49ef4f441..8d50d6fc6 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -491,7 +491,7 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace
bool CheckConsistency(char const *const msgtag = "");
#ifdef APT_COMPILING_APT
- double BootSize(bool initrdOnly);
+ unsigned long long BootSize(bool initrdOnly);
#endif
protected:
// methods call by IsInstallOk
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 3f05cf9fb..208a27749 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -348,8 +348,8 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo
if (statvfs(_config->FindDir("Dir::Usr").c_str(), &st) == 0)
{
struct statvfs st_boot;
- double BootSize = 0;
- double InitrdSize = 0;
+ unsigned long long BootSize = 0;
+ unsigned long long InitrdSize = 0;
if (statvfs(_config->FindDir("Dir::Boot").c_str(), &st_boot) == 0 && st_boot.f_fsid != st.f_fsid)
BootSize = Cache->BootSize(false);
else