summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdline/apt-cache.cc2
-rwxr-xr-xtest/integration/test-ubuntu-bug-1876495-pkgnames-virtual23
2 files changed, 24 insertions, 1 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 23ab7e47f..b40ff6efa 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -980,7 +980,7 @@ static bool ShowPkgNames(CommandLine &CmdL)
if (unlikely(CacheFile.BuildCaches(NULL, false) == false))
return false;
pkgCache::GrpIterator I = CacheFile.GetPkgCache()->GrpBegin();
- bool const All = _config->FindB("APT::Cache::AllNames","false");
+ bool const All = _config->FindB("APT::Cache::AllNames", false);
if (CmdL.FileList[1] != 0)
{
diff --git a/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual b/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual
new file mode 100755
index 000000000..77d68e085
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual
@@ -0,0 +1,23 @@
+
+#!/bin/sh
+
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'i386'
+
+insertinstalledpackage 'coolstuff' 'all' '1.0' 'Provides: virtual-package
+Source: source-package'
+
+setupaptarchive
+changetowebserver
+
+testsuccess aptget update -o Debug::Acquire::gpg=1
+testsuccessequal "coolstuff
+dpkg" aptcache pkgnames
+
+testsuccessequal "source-package
+coolstuff
+dpkg" aptcache pkgnames --all-names