summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-private/private-show.cc4
-rwxr-xr-xtest/integration/test-apt-cli-show12
2 files changed, 14 insertions, 2 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 3cc6a5b87..1baf7990a 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -185,12 +185,12 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgCache::VerIterator const
// make size nice
std::string installed_size;
if (Tags.FindI("Installed-Size") > 0)
- strprintf(installed_size, "%sB", SizeToStr(Tags.FindI("Installed-Size")*1024).c_str());
+ strprintf(installed_size, "%sB", SizeToStr(Tags.FindULL("Installed-Size") * 1024).c_str());
else
installed_size = _("unknown");
std::string package_size;
if (Tags.FindI("Size") > 0)
- strprintf(package_size, "%sB", SizeToStr(Tags.FindI("Size")).c_str());
+ strprintf(package_size, "%sB", SizeToStr(Tags.FindULL("Size")).c_str());
else
package_size = _("unknown");
diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show
index 754b3aa5f..935d93d86 100755
--- a/test/integration/test-apt-cli-show
+++ b/test/integration/test-apt-cli-show
@@ -11,6 +11,7 @@ DESCR='Some description
That has multiple lines'
insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
insertpackage 'unstable' 'bar' 'i386,amd64' '1' '' '' "$DESCR"
+insertpackage 'unstable' 'big' 'i386,amd64' '1' 'Installed-Size: 4129421' '' "$DESCR"
insertinstalledpackage 'foo' 'all' '1.0'
setupaptarchive
@@ -53,6 +54,17 @@ APT-Sources: file:$APTARCHIVE unstable/main amd64 Packages
Description: Some description
That has multiple lines
" apt show bar:amd64
+testsuccessequal "Package: big:amd64
+Version: 1
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 4229 MB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main amd64 Packages
+Description: Some description
+ That has multiple lines
+" apt show big:amd64
# this is the default, but disabled by the testcases
testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0