aboutsummaryrefslogtreecommitdiff
path: root/paludis/package_database.cc
diff options
context:
space:
mode:
authorAvatar Aleksandar Petrinic <petrinic@gmail.com> 2010-12-07 15:14:20 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-07 14:20:20 +0000
commit738e455a3beaedf5252cb2354381f6facef8d62d (patch)
tree3010b466c749992cf81e9272a5ed74cac75dff02 /paludis/package_database.cc
parentceca955ba1c180ee7964adf8d451218b26b55a54 (diff)
downloadpaludis-738e455a3beaedf5252cb2354381f6facef8d62d.tar.gz
paludis-738e455a3beaedf5252cb2354381f6facef8d62d.tar.xz
PackageDatabase::fetch_unique_qualified_package_name disambiguate flag
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 '"