summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-08-04 21:37:41 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-08-04 21:37:41 +0200
commit727d8712bc8d681ac95e0d8c61d3d0b46d11494c (patch)
tree80d302107af0baa7bc60a82f675a052f0894841d
parent9bcfc8184cdae76cef68494ffe0c1a876dcb7175 (diff)
improve the check for purely virtuals as provided packages aren't
purely virtual and shouldn't error out cause of that
-rw-r--r--cmdline/apt-get.cc2
-rwxr-xr-xtest/integration/test-bug-683786-build-dep-on-virtual-packages12
2 files changed, 13 insertions, 1 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index b433a7915..b14206f92 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -3004,7 +3004,7 @@ bool DoBuildDep(CommandLine &CmdL)
else
Pkg = Cache->FindPkg(D->Package);
- if (Pkg.end() == true || Pkg->VersionList == 0)
+ if (Pkg.end() == true || (Pkg->VersionList == 0 && Pkg->ProvidesList == 0))
{
if (_config->FindB("Debug::BuildDeps",false) == true)
cout << " (not found)" << (*D).Package << endl;
diff --git a/test/integration/test-bug-683786-build-dep-on-virtual-packages b/test/integration/test-bug-683786-build-dep-on-virtual-packages
index 83d184a43..246bd2ef7 100755
--- a/test/integration/test-bug-683786-build-dep-on-virtual-packages
+++ b/test/integration/test-bug-683786-build-dep-on-virtual-packages
@@ -15,6 +15,9 @@ insertpackage 'unstable' 'make-po-debconf-pure-virtual' 'armel' '1' 'Depends: po
insertpackage 'unstable' 'po-debconf' 'amd64' '1'
insertsource 'unstable' 'diffutils' 'any' '1' 'Build-Depends: texi2html'
+insertpackage 'unstable' 'libselinux1-dev' 'amd64' '1' 'Provides: libselinux-dev'
+insertsource 'unstable' 'sed' 'any' '1' 'Build-Depends: libselinux-dev'
+
setupaptarchive
testequal 'Package: po-debconf:armel
@@ -42,3 +45,12 @@ E: Build-Depends dependency for dash cannot be satisfied because the package po-
testequal 'Reading package lists...
Building dependency tree...
E: Build-Depends dependency for diffutils cannot be satisfied because the package texi2html cannot be found' aptget build-dep -aarmel diffutils -s
+
+testequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'libselinux1-dev' instead of 'libselinux-dev'
+The following NEW packages will be installed:
+ libselinux1-dev
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libselinux1-dev (1 unstable [amd64])
+Conf libselinux1-dev (1 unstable [amd64])" aptget build-dep sed -s