diff options
-rw-r--r-- | apt-pkg/pkgcachegen.cc | 2 | ||||
-rwxr-xr-x | test/integration/test-provides-arch-all | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 75bd4c853..8e0301151 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1203,7 +1203,7 @@ bool pkgCacheListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, StringVi Dynamic<StringView> DynPackage(Package); Dynamic<StringView> DynVersion(Version); - if (Grp.end() == true) + if (Grp.end() == true || Grp->FirstPackage == 0) return NewProvides(Ver, Package, Cache.NativeArch(), Version, Flags); else { diff --git a/test/integration/test-provides-arch-all b/test/integration/test-provides-arch-all new file mode 100755 index 000000000..f212b513c --- /dev/null +++ b/test/integration/test-provides-arch-all @@ -0,0 +1,28 @@ +#!/bin/sh +# +# In apt 1.9.6, this test would have failed, outputting: +# The following packages will be REMOVED: +# libltdl-dev +# 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +# Remv libltdl-dev [1] +# +# Because we started inserting groups without packages, and then could not +# properly insert the provides. + +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture "i386" + +insertinstalledpackage 'automake' 'i386' '1' 'Provides: automake-1.16 +Source: automake-1.16 +Multi-Arch: foreign' +insertinstalledpackage 'libltdl-dev' 'i386' '1' 'Depends: automake-1.16' + +setupaptarchive + +testsuccessequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install -f -s |