aboutsummaryrefslogtreecommitdiff
path: root/paludis/package_database.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/package_database.cc')
-rw-r--r--paludis/package_database.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index f6cdabd09..28f1d661f 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -267,7 +267,7 @@ namespace
}
QualifiedPackageName
-PackageDatabase::fetch_unique_qualified_package_name(const PackageNamePart & p, const Filter & f) const
+PackageDatabase::fetch_unique_qualified_package_name(const PackageNamePart & p, const Filter & f, const bool disambiguate) const
{
Context context("When disambiguating package name '" + stringify(p) + "':");
@@ -344,6 +344,10 @@ PackageDatabase::fetch_unique_qualified_package_name(const PackageNamePart & p,
first_iterator(result->end()));
} while (false);
+ if (! disambiguate)
+ throw AmbiguousPackageNameError(stringify(p), first_iterator(result->begin()),
+ first_iterator(result->end()));
+
Log::get_instance()->message("package_database.ambiguous_name", ll_warning, lc_context)
<< "Package name '" << p << "' is ambiguous, assuming you meant '" << *qpns.begin()
<< "' (candidates were '"