summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-private/private-show.cc4
-rwxr-xr-xtest/integration/test-apt-cli-show33
2 files changed, 35 insertions, 2 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index cd7a2a064..d96335977 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -177,9 +177,9 @@ static bool DisplayRecordV2(pkgCacheFile &CacheFile, pkgCache::VerIterator const
// Read the record
pkgTagSection Tags;
- pkgTagFile TagF(&PkgF);
+ pkgTagFile TagF(&PkgF, Vf->Size);
- if (TagF.Jump(Tags, V.FileList()->Offset) == false)
+ if (TagF.Jump(Tags, Vf->Offset) == false)
return _error->Error("Internal Error, Unable to parse a package record");
// make size nice
diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show
index 754b3aa5f..54aaee4b8 100755
--- a/test/integration/test-apt-cli-show
+++ b/test/integration/test-apt-cli-show
@@ -7,10 +7,18 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'i386' 'amd64'
+generatelotsofnames() {
+ for i in $(seq 0 10000); do
+ printf ', this-is-a-long-pkg-name-%s (= 0.a.long.version)' "$i"
+ done
+}
+
DESCR='Some description
That has multiple lines'
insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
insertpackage 'unstable' 'bar' 'i386,amd64' '1' '' '' "$DESCR"
+insertpackage 'unstable' 'large' 'all' '1' "Provides: pkga$(generatelotsofnames)" '' "$DESCR"
+insertpackage 'unstable' 'large2' 'all' '1' "Provides: foobar, pkga$(generatelotsofnames)" '' "$DESCR"
insertinstalledpackage 'foo' 'all' '1.0'
setupaptarchive
@@ -54,6 +62,31 @@ Description: Some description
That has multiple lines
" apt show bar:amd64
+testsuccessequal "Package: large
+Version: 1
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Provides: pkga$(generatelotsofnames)
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+" apt show large
+testsuccessequal "Package: large2
+Version: 1
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Provides: foobar, pkga$(generatelotsofnames)
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+" apt show large2
+
# this is the default, but disabled by the testcases
testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0
cp rootdir/tmp/testsuccess.output aptshow.output