aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-07 16:21:14 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-07 16:21:14 +0000
commit78211c1ec110e4ab049865091dfa1300abd173d5 (patch)
tree4d530d7f51badb95df15283ccaef26146bb51748
parente5f63be6f5bbce5ddf37cefeeb6baa3f30fc110b (diff)
downloadpaludis-78211c1ec110e4ab049865091dfa1300abd173d5.tar.gz
paludis-78211c1ec110e4ab049865091dfa1300abd173d5.tar.xz
Don't require that a PackageDepSpec specify a particular unambiguous package.
-rw-r--r--paludis/dep_list/dep_list.cc107
-rw-r--r--paludis/dep_list/range_rewriter.cc2
-rw-r--r--paludis/dep_spec.cc12
-rw-r--r--paludis/dep_spec.hh7
-rw-r--r--paludis/dep_spec_TEST.cc22
-rw-r--r--paludis/environment.cc8
-rw-r--r--paludis/environments/paludis/paludis_config.cc100
-rw-r--r--paludis/environments/paludis/paludis_environment.cc15
-rw-r--r--paludis/environments/paludis/use_config_entry.sr10
-rw-r--r--paludis/match_package.cc2
-rw-r--r--paludis/qa/dep_packages_check.cc7
-rw-r--r--paludis/qa/deps_exist_check.cc8
-rw-r--r--paludis/qa/extract_check.cc2
-rw-r--r--paludis/qa/pdepend_overlap_check.cc3
-rw-r--r--paludis/query.cc20
-rw-r--r--paludis/repositories/fake/fake_repository.cc16
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc34
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.cc7
-rw-r--r--paludis/repositories/gentoo/portage_repository_sets.cc14
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc2
-rw-r--r--ruby/dep_spec.cc6
-rw-r--r--src/clients/paludis/uninstall.cc3
22 files changed, 282 insertions, 125 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 1eebcc7..bf796fb 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -24,6 +24,7 @@
#include <paludis/dep_list/exceptions.hh>
#include <paludis/dep_list/range_rewriter.hh>
#include <paludis/match_package.hh>
+#include <paludis/query.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/compare.hh>
@@ -294,9 +295,9 @@ namespace
bool operator() (std::tr1::shared_ptr<const DepSpec> spec)
{
const PackageDepSpec * const u(spec->as_package_dep_spec());
- if (0 != u)
+ if (0 != u && u->package_ptr())
{
- return ! env->package_database()->query(PackageDepSpec(u->package()),
+ return ! env->package_database()->query(PackageDepSpec(*u->package_ptr()),
is_installed_only, qo_whatever)->empty();
}
else
@@ -355,10 +356,10 @@ DepList::QueryVisitor::visit(const PackageDepSpec * const a)
SlotName slot(vm->slot);
std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
- d->_imp->merge_list_index.equal_range(a->package()));
+ d->_imp->merge_list_index.equal_range(m->name));
bool replaced(false);
- PackageDepSpec spec(a->package());
+ PackageDepSpec spec(m->name);
while (p.second != ((p.first = std::find_if(p.first, p.second,
MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, &spec)))))
{
@@ -379,8 +380,11 @@ DepList::QueryVisitor::visit(const PackageDepSpec * const a)
}
/* check the merge list for any new packages that match */
- std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
- d->_imp->merge_list_index.equal_range(a->package()));
+ std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p;
+ if (a->package_ptr())
+ p = d->_imp->merge_list_index.equal_range(*a->package_ptr());
+ else
+ p = std::make_pair(d->_imp->merge_list_index.begin(), d->_imp->merge_list_index.end());
if (p.second != std::find_if(p.first, p.second,
MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, a)))
@@ -492,8 +496,12 @@ DepList::AddVisitor::visit(const PackageDepSpec * const a)
*a, is_installed_only, qo_order_by_version));
/* are we already on the merge list? */
- std::pair<MergeListIndex::iterator, MergeListIndex::iterator> q(
- d->_imp->merge_list_index.equal_range(a->package()));
+ std::pair<MergeListIndex::iterator, MergeListIndex::iterator> q;
+ if (a->package_ptr())
+ q = d->_imp->merge_list_index.equal_range(*a->package_ptr());
+ else
+ q = std::make_pair(d->_imp->merge_list_index.begin(), d->_imp->merge_list_index.end());
+
MergeListIndex::iterator qq(std::find_if(q.first, q.second,
MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, a)));
@@ -728,7 +736,7 @@ DepList::AddVisitor::visit(const PackageDepSpec * const a)
{
std::tr1::shared_ptr<PackageDatabaseEntryCollection> are_we_downgrading(
d->_imp->env->package_database()->query(PackageDepSpec(
- stringify(a->package()) + ":" + stringify(slot)),
+ stringify(best_visible_candidate->name) + ":" + stringify(slot)),
is_installed_only, qo_order_by_version));
if (are_we_downgrading->empty())
@@ -878,30 +886,43 @@ DepList::AddVisitor::visit(const BlockDepSpec * const a)
Context context("When checking BlockDepSpec '!" + stringify(*a->blocked_spec()) + "':");
- PackageDepSpec just_package(a->blocked_spec()->package());
- std::tr1::shared_ptr<const PackageDatabaseEntryCollection> already_installed(d->_imp->env->package_database()->query(
- just_package, is_installed_only, qo_whatever));
-
+ bool check_whole_list(false);
std::list<MergeList::const_iterator> will_be_installed;
- MatchDepListEntryAgainstPackageDepSpec m(d->_imp->env, &just_package);
- for (std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
- d->_imp->merge_list_index.equal_range(a->blocked_spec()->package())) ;
- p.first != p.second ; ++p.first)
+ std::tr1::shared_ptr<const PackageDatabaseEntryCollection> already_installed;
+
+ if (a->blocked_spec()->package_ptr())
{
- if (d->_imp->current_merge_list_entry != d->_imp->merge_list.end())
+ PackageDepSpec just_package(*a->blocked_spec()->package_ptr());
+ already_installed = d->_imp->env->package_database()->query(
+ just_package, is_installed_only, qo_whatever);
+
+ MatchDepListEntryAgainstPackageDepSpec m(d->_imp->env, &just_package);
+ for (std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
+ d->_imp->merge_list_index.equal_range(*a->blocked_spec()->package_ptr())) ;
+ p.first != p.second ; ++p.first)
{
- if (d->_imp->current_merge_list_entry == p.first->second)
- continue;
+ if (d->_imp->current_merge_list_entry != d->_imp->merge_list.end())
+ {
+ if (d->_imp->current_merge_list_entry == p.first->second)
+ continue;
- if (d->_imp->current_merge_list_entry->associated_entry == &*p.first->second)
- continue;
- }
+ if (d->_imp->current_merge_list_entry->associated_entry == &*p.first->second)
+ continue;
+ }
- if (m(*p.first))
- will_be_installed.push_back(p.first->second);
+ if (m(*p.first))
+ will_be_installed.push_back(p.first->second);
+ }
+ }
+ else
+ {
+ check_whole_list = true;
+ /* TODO: InstalledAtRoot? */
+ already_installed = d->_imp->env->package_database()->query(
+ query::RepositoryHasInstalledInterface(), qo_whatever);
}
- if (already_installed->empty() && will_be_installed.empty())
+ if (already_installed->empty() && will_be_installed.empty() && ! check_whole_list)
return;
for (PackageDatabaseEntryCollection::Iterator aa(already_installed->begin()),
@@ -988,6 +1009,32 @@ DepList::AddVisitor::visit(const BlockDepSpec * const a)
throw BlockError(stringify(*a->blocked_spec()));
}
+
+ if (check_whole_list)
+ {
+ for (MergeList::const_iterator r(d->_imp->merge_list.begin()),
+ r_end(d->_imp->merge_list.end()) ; r != r_end ; ++r)
+ {
+ if (! match_package(*d->_imp->env, *a->blocked_spec(), r->package))
+ continue;
+
+ /* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
+ * ourself */
+ if (! (a->blocked_spec()->version_requirements_ptr() || a->blocked_spec()->slot_ptr()
+ || a->blocked_spec()->use_requirements_ptr() || a->blocked_spec()->repository_ptr())
+ && d->_imp->current_pde())
+ {
+ if (r->package.name == d->_imp->current_pde()->name)
+ continue;
+
+ if (r->metadata->virtual_interface &&
+ r->metadata->virtual_interface->virtual_for.name == d->_imp->current_pde()->name)
+ continue;
+ }
+
+ throw BlockError(stringify(*a->blocked_spec()));
+ }
+ }
}
struct DepList::ShowSuggestVisitor :
@@ -1157,8 +1204,12 @@ DepList::add_package(const PackageDatabaseEntry & p, std::tr1::shared_ptr<const
{
std::tr1::shared_ptr<PackageDepSpec> pp(new PackageDepSpec("=" + (*i)->text() + "-" + stringify(p.version)));
- std::pair<MergeListIndex::iterator, MergeListIndex::iterator> z(
- _imp->merge_list_index.equal_range(pp->package()));
+ std::pair<MergeListIndex::iterator, MergeListIndex::iterator> z;
+ if (pp->package_ptr())
+ z = _imp->merge_list_index.equal_range(*pp->package_ptr());
+ else
+ z = std::make_pair(_imp->merge_list_index.begin(), _imp->merge_list_index.end());
+
MergeListIndex::iterator zz(std::find_if(z.first, z.second,
MatchDepListEntryAgainstPackageDepSpec(_imp->env, pp.get())));
diff --git a/paludis/dep_list/range_rewriter.cc b/paludis/dep_list/range_rewriter.cc
index 75dae7f..8b1043b 100644
--- a/paludis/dep_list/range_rewriter.cc
+++ b/paludis/dep_list/range_rewriter.cc
@@ -77,7 +77,7 @@ RangeRewriter::visit(const PackageDepSpec * a)
if (_spec)
{
- if (a->package() != _spec->package())
+ if ((! a->package_ptr()) || (! _spec->package_ptr()) || (*a->package_ptr() != *_spec->package_ptr()))
{
_invalid = true;
return;
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 3f45d26..deb1214 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -127,7 +127,7 @@ BlockDepSpec::BlockDepSpec(std::tr1::shared_ptr<const PackageDepSpec> a) :
PackageDepSpec::PackageDepSpec(const QualifiedPackageName & our_package) :
StringDepSpec(stringify(our_package)),
- _package(our_package),
+ _package_ptr(new QualifiedPackageName(our_package)),
_version_requirements_mode(vr_and)
{
}
@@ -136,7 +136,7 @@ PackageDepSpec::PackageDepSpec(const PackageDepSpec & other) :
VisitableInterface<DepSpecVisitorTypes>(other),
StringDepSpec(stringify(other)),
Visitable<PackageDepSpec, DepSpecVisitorTypes>(other),
- _package(other._package),
+ _package_ptr(other._package_ptr),
_version_requirements_mode(other._version_requirements_mode),
_slot(other._slot),
_repository(other._repository),
@@ -153,7 +153,6 @@ PackageDepSpec::PackageDepSpec(const PackageDepSpec & other) :
PackageDepSpec::PackageDepSpec(const std::string & ss) :
StringDepSpec(ss),
- _package(CategoryNamePart("later"), PackageNamePart("later")),
_version_requirements_mode(vr_and)
{
Context context("When parsing package dep spec '" + ss + "':");
@@ -238,7 +237,7 @@ PackageDepSpec::PackageDepSpec(const std::string & ss) :
q = new_q;
}
- _package = QualifiedPackageName(s.substr(p, q - p - 1));
+ _package_ptr.reset(new QualifiedPackageName(s.substr(p, q - p - 1)));
_version_requirements.reset(new VersionRequirements::Concrete);
@@ -256,7 +255,7 @@ PackageDepSpec::PackageDepSpec(const std::string & ss) :
_version_requirements->push_back(VersionRequirement(op, VersionSpec(s.substr(q))));
}
else
- _package = QualifiedPackageName(s);
+ _package_ptr.reset(new QualifiedPackageName(s));
}
catch (Exception &)
{
@@ -315,7 +314,8 @@ paludis::operator<< (std::ostream & s, const PackageDepSpec & a)
}
}
- s << a.package();
+ if (a.package_ptr())
+ s << *a.package_ptr();
if (a.version_requirements_ptr())
{
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 301349c..db1c17f 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -48,6 +48,7 @@ namespace paludis
class AllDepSpec;
class AnyDepSpec;
class UseDepSpec;
+ class SetDepSpec;
class BlockDepSpec;
/**
@@ -318,7 +319,7 @@ namespace paludis
public Visitable<PackageDepSpec, DepSpecVisitorTypes>
{
private:
- QualifiedPackageName _package;
+ std::tr1::shared_ptr<QualifiedPackageName> _package_ptr;
std::tr1::shared_ptr<VersionRequirements> _version_requirements;
VersionRequirementsMode _version_requirements_mode;
std::tr1::shared_ptr<SlotName> _slot;
@@ -354,9 +355,9 @@ namespace paludis
/**
* Fetch the package name.
*/
- const QualifiedPackageName & package() const
+ std::tr1::shared_ptr<const QualifiedPackageName> package_ptr() const
{
- return _package;
+ return _package_ptr;
}
/**
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 40e3a74..359dabd 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -84,12 +84,12 @@ namespace test_cases
void run()
{
PackageDepSpec a("foo/bar");
- TEST_CHECK_STRINGIFY_EQUAL(a.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*a.package_ptr(), "foo/bar");
TEST_CHECK(! a.slot_ptr());
TEST_CHECK(! a.version_requirements_ptr());
PackageDepSpec b(">=foo/bar-1.2.3");
- TEST_CHECK_STRINGIFY_EQUAL(b.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*b.package_ptr(), "foo/bar");
TEST_CHECK(! b.slot_ptr());
TEST_CHECK(b.version_requirements_ptr());
TEST_CHECK_EQUAL(std::distance(b.version_requirements_ptr()->begin(),
@@ -98,13 +98,13 @@ namespace test_cases
TEST_CHECK_EQUAL(b.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
PackageDepSpec c("foo/bar:baz");
- TEST_CHECK_STRINGIFY_EQUAL(c.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*c.package_ptr(), "foo/bar");
TEST_CHECK(c.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*c.slot_ptr(), "baz");
TEST_CHECK(! c.version_requirements_ptr());
PackageDepSpec d("=foo/bar-1.2*:1.2.1");
- TEST_CHECK_STRINGIFY_EQUAL(d.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*d.package_ptr(), "foo/bar");
TEST_CHECK(d.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*d.slot_ptr(), "1.2.1");
TEST_CHECK(d.version_requirements_ptr());
@@ -112,22 +112,22 @@ namespace test_cases
TEST_CHECK_EQUAL(d.version_requirements_ptr()->begin()->version_operator, vo_equal_star);
PackageDepSpec e("foo/bar:1.2.1");
- TEST_CHECK_STRINGIFY_EQUAL(e.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*e.package_ptr(), "foo/bar");
TEST_CHECK(e.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*e.slot_ptr(), "1.2.1");
TEST_CHECK(! e.version_requirements_ptr());
PackageDepSpec f("foo/bar:0");
- TEST_CHECK_STRINGIFY_EQUAL(f.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*f.package_ptr(), "foo/bar");
TEST_CHECK(f.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*f.slot_ptr(), "0");
TEST_CHECK(! f.version_requirements_ptr());
PackageDepSpec g("foo/bar-100dpi");
- TEST_CHECK_STRINGIFY_EQUAL(g.package(), "foo/bar-100dpi");
+ TEST_CHECK_STRINGIFY_EQUAL(*g.package_ptr(), "foo/bar-100dpi");
PackageDepSpec h(">=foo/bar-100dpi-1.23");
- TEST_CHECK_STRINGIFY_EQUAL(h.package(), "foo/bar-100dpi");
+ TEST_CHECK_STRINGIFY_EQUAL(*h.package_ptr(), "foo/bar-100dpi");
TEST_CHECK(h.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(h.version_requirements_ptr()->begin()->version_spec, "1.23");
TEST_CHECK_EQUAL(h.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
@@ -135,7 +135,7 @@ namespace test_cases
TEST_CHECK_THROWS(PackageDepSpec(""), PackageDepSpecError);
PackageDepSpec i("foo/bar[one][-two]");
- TEST_CHECK_STRINGIFY_EQUAL(i.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*i.package_ptr(), "foo/bar");
TEST_CHECK(! i.version_requirements_ptr());
TEST_CHECK(! i.repository_ptr());
TEST_CHECK(! i.slot_ptr());
@@ -151,13 +151,13 @@ namespace test_cases
TEST_CHECK(i.use_requirements_ptr()->state(UseFlagName("moo")) == use_unspecified);
PackageDepSpec j("=foo/bar-scm-r3");
- TEST_CHECK_STRINGIFY_EQUAL(j.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*j.package_ptr(), "foo/bar");
TEST_CHECK(j.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(j.version_requirements_ptr()->begin()->version_spec, "scm-r3");
TEST_CHECK_EQUAL(j.version_requirements_ptr()->begin()->version_operator, vo_equal);
PackageDepSpec k("=foo/bar-scm");
- TEST_CHECK_STRINGIFY_EQUAL(k.package(), "foo/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*k.package_ptr(), "foo/bar");
TEST_CHECK(k.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(k.version_requirements_ptr()->begin()->version_spec, "scm");
TEST_CHECK_EQUAL(k.version_requirements_ptr()->begin()->version_operator, vo_equal);
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 9bd7c05..bf8185f 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -346,8 +346,8 @@ Environment::add_appropriate_to_world(std::tr1::shared_ptr<const DepSpec> a,
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
r_end(package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->world_interface)
- (*r)->world_interface->add_to_world((*i)->package());
+ if ((*r)->world_interface && (*i)->package_ptr())
+ (*r)->world_interface->add_to_world(*(*i)->package_ptr());
}
}
@@ -384,8 +384,8 @@ Environment::remove_appropriate_from_world(std::tr1::shared_ptr<const DepSpec> a
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
r_end(package_database()->end_repositories()) ;
r != r_end ; ++r)
- if ((*r)->world_interface)
- (*r)->world_interface->remove_from_world((*i)->package());
+ if ((*r)->world_interface && (*i)->package_ptr())
+ (*r)->world_interface->remove_from_world(*(*i)->package_ptr());
ww->remove_callback(**i);
}
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index bb165e6..1199ef7 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -150,11 +150,11 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = env->package_set(s->set_name);
+ s->dep_spec = env->package_set(*s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
- stringify(s->set_name) + "' doesn't exist");
+ stringify(*s->set_name) + "' doesn't exist");
s->dep_spec.reset(new AllDepSpec);
}
}
@@ -163,11 +163,11 @@ namespace paludis
s_end(set_use_prefixes_that_have_minus_star.end()) ; s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = env->package_set(s->set_name);
+ s->dep_spec = env->package_set(*s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
- stringify(s->set_name) + "' doesn't exist");
+ stringify(*s->set_name) + "' doesn't exist");
s->dep_spec.reset(new AllDepSpec);
}
}
@@ -180,11 +180,11 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = env->package_set(s->set_name);
+ s->dep_spec = env->package_set(*s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
- stringify(s->set_name) + "' doesn't exist");
+ stringify(*s->set_name) + "' doesn't exist");
s->dep_spec.reset(new AllDepSpec);
}
}
@@ -197,11 +197,11 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = env->package_set(s->set_name);
+ s->dep_spec = env->package_set(*s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
- stringify(s->set_name) + "' doesn't exist");
+ stringify(*s->set_name) + "' doesn't exist");
s->dep_spec.reset(new AllDepSpec);
}
}
@@ -214,11 +214,11 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = env->package_set(s->set_name);
+ s->dep_spec = env->package_set(*s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
- stringify(s->set_name) + "' doesn't exist");
+ stringify(*s->set_name) + "' doesn't exist");
s->dep_spec.reset(new AllDepSpec);
}
}
@@ -231,11 +231,11 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = env->package_set(s->set_name);
+ s->dep_spec = env->package_set(*s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
- stringify(s->set_name) + "' doesn't exist");
+ stringify(*s->set_name) + "' doesn't exist");
s->dep_spec.reset(new AllDepSpec);
}
}
@@ -415,14 +415,21 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
_imp->set_keywords.push_back(SetKeywordConfigEntry(
- SetName(tokens.at(0)), std::tr1::shared_ptr<DepSpec>(), KeywordName(*t)));
+ std::tr1::shared_ptr<SetName>(new SetName(tokens.at(0))),
+ std::tr1::shared_ptr<DepSpec>(), KeywordName(*t)));
}
else
{
std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(tokens.at(0)));
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
- _imp->keywords[a->package()].push_back(std::make_pair(a, *t));
+ {
+ if (a->package_ptr())
+ _imp->keywords[*a->package_ptr()].push_back(std::make_pair(a, *t));
+ else
+ _imp->set_keywords.push_back(SetKeywordConfigEntry(
+ std::tr1::shared_ptr<const SetName>(), a, KeywordName(*t)));
+ }
}
}
}
@@ -458,12 +465,24 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
continue;
if ("*" == tokens.at(0))
std::copy(next(tokens.begin()), tokens.end(), std::back_inserter(_imp->default_licenses));
+ else if (std::string::npos == tokens.at(0).find('/'))
+ {
+ for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
+ t != t_end ; ++t)
+ _imp->set_licenses.push_back(SetLicenseConfigEntry(
+ std::tr1::shared_ptr<SetName>(new SetName(tokens.at(0))),
+ std::tr1::shared_ptr<DepSpec>(), *t));
+ }
else
{
std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(tokens.at(0)));
for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
- _imp->licenses[a->package()].push_back(std::make_pair(a, *t));
+ if (a->package_ptr())
+ _imp->licenses[*a->package_ptr()].push_back(std::make_pair(a, *t));
+ else
+ _imp->set_licenses.push_back(SetLicenseConfigEntry(
+ std::tr1::shared_ptr<SetName>(), a, *t));
}
}
}
@@ -498,12 +517,17 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
continue;
if (std::string::npos == line->find('/'))
- _imp->set_masks.push_back(SetMaskConfigEntry(SetName(*line),
+ _imp->set_masks.push_back(SetMaskConfigEntry(
+ std::tr1::shared_ptr<SetName>(new SetName(*line)),
std::tr1::shared_ptr<const DepSpec>()));
else
{
std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
- _imp->user_masks[a->package()].push_back(a);
+ if (a->package_ptr())
+ _imp->user_masks[*a->package_ptr()].push_back(a);
+ else
+ _imp->set_masks.push_back(SetMaskConfigEntry(
+ std::tr1::shared_ptr<SetName>(), a));
}
}
}
@@ -533,12 +557,17 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
continue;
if (std::string::npos == line->find('/'))
- _imp->set_unmasks.push_back(SetMaskConfigEntry(SetName(*line),
+ _imp->set_unmasks.push_back(SetMaskConfigEntry(
+ std::tr1::shared_ptr<SetName>(new SetName(*line)),
std::tr1::shared_ptr<const DepSpec>()));
else
{
std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
- _imp->user_unmasks[a->package()].push_back(a);
+ if (a->package_ptr())
+ _imp->user_unmasks[*a->package_ptr()].push_back(a);
+ else
+ _imp->set_unmasks.push_back(SetMaskConfigEntry(
+ std::tr1::shared_ptr<SetName>(), a));
}
}
}
@@ -609,10 +638,13 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
{
if ("-*" == *t)
_imp->set_use_prefixes_that_have_minus_star.push_back(SetUseConfigMinusStarEntry(
- SetName(tokens.at(0)), std::tr1::shared_ptr<const DepSpec>(), prefix));
+ std::tr1::shared_ptr<SetName>(new SetName(tokens.at(0))),
+ std::tr1::shared_ptr<const DepSpec>(), prefix));
else
- _imp->set_use.push_back(SetUseConfigEntry(SetName(tokens.at(0)),
- std::tr1::shared_ptr<const DepSpec>(), UseFlagName(prefix + t->substr(1)), use_disabled));
+ _imp->set_use.push_back(SetUseConfigEntry(
+ std::tr1::shared_ptr<const SetName>(new SetName(tokens.at(0))),
+ std::tr1::shared_ptr<const DepSpec>(),
+ UseFlagName(prefix + t->substr(1)), use_disabled));
}
else if (':' == t->at(t->length() - 1))
{
@@ -622,7 +654,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
prefix.append("_");
}
else
- _imp->set_use.push_back(SetUseConfigEntry(SetName(tokens.at(0)),
+ _imp->set_use.push_back(SetUseConfigEntry(
+ std::tr1::shared_ptr<SetName>(new SetName(tokens.at(0))),
std::tr1::shared_ptr<const DepSpec>(), UseFlagName(prefix + *t), use_enabled));
}
}
@@ -635,10 +668,17 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if ('-' == t->at(0))
{
if ("-*" == *t)
- _imp->use_prefixes_that_have_minus_star[a->package()].push_back(
- std::make_pair(a, prefix));
+ {
+ if (a->package_ptr())
+ _imp->use_prefixes_that_have_minus_star[*a->package_ptr()].push_back(
+ std::make_pair(a, prefix));
+ else
+ _imp->set_use_prefixes_that_have_minus_star.push_back(
+ SetUseConfigMinusStarEntry(std::tr1::shared_ptr<SetName>(),
+ a, prefix));
+ }
else
- _imp->use[a->package()].push_back(UseConfigEntry(
+ _imp->use[*a->package_ptr()].push_back(UseConfigEntry(
a, UseFlagName(prefix + t->substr(1)), use_disabled));
}
else if (':' == t->at(t->length() - 1))
@@ -648,9 +688,13 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
&::tolower);
prefix.append("_");
}
- else
- _imp->use[a->package()].push_back(UseConfigEntry(
+ else if (a->package_ptr())
+ _imp->use[*a->package_ptr()].push_back(UseConfigEntry(
a, UseFlagName(prefix + *t), use_enabled));
+ else
+ _imp->set_use.push_back(SetUseConfigEntry(
+ std::tr1::shared_ptr<SetName>(), a, UseFlagName(prefix + *t),
+ use_enabled));
}
}
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 36a3a8f..26b0db8 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -728,10 +728,17 @@ PaludisEnvironment::local_package_set(const SetName & s) const
{
std::tr1::shared_ptr<PackageDepSpec> p(new PackageDepSpec(tokens.at(1)));
p->set_tag(tag);
- if (! package_database()->query(
- query::Package(p->package()) & query::InstalledAtRoot(root()),
- qo_whatever)->empty())
- result->add_child(p);
+
+ if (p->package_ptr())
+ {
+ if (! package_database()->query(
+ query::Package(*p->package_ptr()) & query::InstalledAtRoot(root()),
+ qo_whatever)->empty())
+ result->add_child(p);
+ }
+ else
+ Log::get_instance()->message(ll_warning, lc_context, "Line '" + *line + "' in set file '"
+ + stringify(ff) + "' uses ? operator but does not specify an unambiguous package");
}
else
Log::get_instance()->message(ll_warning, lc_context, "Line '" + *line + "' in set file '"
diff --git a/paludis/environments/paludis/use_config_entry.sr b/paludis/environments/paludis/use_config_entry.sr
index 97dbe6b..046c045 100644
--- a/paludis/environments/paludis/use_config_entry.sr
+++ b/paludis/environments/paludis/use_config_entry.sr
@@ -20,7 +20,7 @@ END
make_class_SetUseConfigEntry()
{
- key set_name SetName
+ key set_name "std::tr1::shared_ptr<const SetName>"
key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key flag_name UseFlagName
key flag_state UseFlagState
@@ -38,7 +38,7 @@ END
make_class_SetUseConfigMinusStarEntry()
{
- key set_name SetName
+ key set_name "std::tr1::shared_ptr<const SetName>"
key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key prefix std::string
@@ -55,7 +55,7 @@ END
make_class_SetKeywordConfigEntry()
{
- key set_name SetName
+ key set_name "std::tr1::shared_ptr<const SetName>"
key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key keyword KeywordName
@@ -72,7 +72,7 @@ END
make_class_SetLicenseConfigEntry()
{
- key set_name SetName
+ key set_name "std::tr1::shared_ptr<const SetName>"
key dep_spec "std::tr1::shared_ptr<const DepSpec>"
key license std::string
@@ -89,7 +89,7 @@ END
make_class_SetMaskConfigEntry()
{
- key set_name SetName
+ key set_name "std::tr1::shared_ptr<const SetName>"
key dep_spec "std::tr1::shared_ptr<const DepSpec>"
doxygen_comment << "END"
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 020406c..b67becc 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -33,7 +33,7 @@ paludis::match_package(
const PackageDepSpec & spec,
const PackageDatabaseEntry & entry)
{
- if (spec.package() != entry.name)
+ if (spec.package_ptr() && *spec.package_ptr() != entry.name)
return false;
if (spec.version_requirements_ptr())
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index da5dfa8..c6e2a6d 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -57,9 +57,10 @@ namespace
void visit(const PackageDepSpec * const p)
{
- if (suspicious.end() != suspicious.find(p->package()))
- result << Message(qal_maybe, "Suspicious " + role + " entry '"
- + stringify(p->package()) + "'");
+ if (p->package_ptr())
+ if (suspicious.end() != suspicious.find(*p->package_ptr()))
+ result << Message(qal_maybe, "Suspicious " + role + " entry '"
+ + stringify(*p->package_ptr()) + "'");
}
void visit(const PlainTextDepSpec * const)
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index d029de0..0ca565b 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -55,7 +55,8 @@ namespace
void visit(const PackageDepSpec * const p)
{
- if (env->package_database()->query(query::Package(p->package()), qo_whatever)->empty())
+ if (p->package_ptr() &&
+ env->package_database()->query(query::Package(*p->package_ptr()), qo_whatever)->empty())
{
if (in_any)
result << Message(qal_maybe, "No match for " + role + " entry '"
@@ -75,10 +76,11 @@ namespace
void visit(const BlockDepSpec * const b)
{
- if (env->package_database()->query(query::Package(b->blocked_spec()->package()),
+ if (b->blocked_spec()->package_ptr() &&
+ env->package_database()->query(query::Package(*b->blocked_spec()->package_ptr()),
qo_whatever)->empty())
result << Message(qal_maybe, "No match for " + role + " block '!"
- + stringify(b->blocked_spec()->package()) + "'");
+ + stringify(*b->blocked_spec()->package_ptr()) + "'");
}
void visit(const PlainTextDepSpec * const)
diff --git a/paludis/qa/extract_check.cc b/paludis/qa/extract_check.cc
index 67cc3ab..b701b4b 100644
--- a/paludis/qa/extract_check.cc
+++ b/paludis/qa/extract_check.cc
@@ -63,7 +63,7 @@ namespace
void visit(const PackageDepSpec * const p)
{
- if (p->package() == QualifiedPackageName("app-arch/unzip"))
+ if (p->package_ptr() && *p->package_ptr() == QualifiedPackageName("app-arch/unzip"))
have_zip = true;
}
};
diff --git a/paludis/qa/pdepend_overlap_check.cc b/paludis/qa/pdepend_overlap_check.cc
index 87af6c2..09ac918 100644
--- a/paludis/qa/pdepend_overlap_check.cc
+++ b/paludis/qa/pdepend_overlap_check.cc
@@ -50,7 +50,8 @@ namespace
void visit(const PackageDepSpec * const p)
{
- result.insert(p->package());
+ if (p->package_ptr())
+ result.insert(*p->package_ptr());
}
void visit(const BlockDepSpec * const)
diff --git a/paludis/query.cc b/paludis/query.cc
index b8fb0e1..52b211f 100644
--- a/paludis/query.cc
+++ b/paludis/query.cc
@@ -105,21 +105,27 @@ namespace
}
std::tr1::shared_ptr<CategoryNamePartCollection>
- categories(const Environment &,
- std::tr1::shared_ptr<const RepositoryNameCollection>) const
+ categories(const Environment & e,
+ std::tr1::shared_ptr<const RepositoryNameCollection> r) const
{
+ if (! spec.package_ptr())
+ return QueryDelegate::categories(e, r);
+
std::tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
- result->insert(spec.package().category);
+ result->insert(spec.package_ptr()->category);
return result;
}
std::tr1::shared_ptr<QualifiedPackageNameCollection>
- packages(const Environment &,
- std::tr1::shared_ptr<const RepositoryNameCollection>,
- std::tr1::shared_ptr<const CategoryNamePartCollection>) const
+ packages(const Environment & e,
+ std::tr1::shared_ptr<const RepositoryNameCollection> r,
+ std::tr1::shared_ptr<const CategoryNamePartCollection> c) const
{
+ if (! spec.package_ptr())
+ return QueryDelegate::packages(e, r, c);
+
std::tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
- result->insert(spec.package());
+ result->insert(*spec.package_ptr());
return result;
}
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index f42df20..7202c70 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -63,13 +63,21 @@ std::tr1::shared_ptr<const VersionMetadata>
FakeRepository::virtual_package_version_metadata(
const RepositoryVirtualsEntry & p, const VersionSpec & v) const
{
- std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(p.provided_by_spec->package(), v));
+ Context context("When fetching virtual package version metadata for '" + stringify(*p.provided_by_spec)
+ + "' version '" + stringify(v) + "':");
+
+ if (! p.provided_by_spec->package_ptr())
+ throw ConfigurationError("Virtual provider atom does not specify an unambiguous package");
+
+ std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(*p.provided_by_spec->package_ptr(), v));
std::tr1::shared_ptr<FakeVirtualVersionMetadata> result(new FakeVirtualVersionMetadata(
- m->slot, PackageDatabaseEntry(p.provided_by_spec->package(), v, name())));
+ m->slot, PackageDatabaseEntry(*p.provided_by_spec->package_ptr(), v, name())));
result->eapi = m->eapi;
- result->deps_interface->build_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
- result->deps_interface->run_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
+ result->deps_interface->build_depend_string = "=" + stringify(*p.provided_by_spec->package_ptr())
+ + "-" + stringify(v);
+ result->deps_interface->run_depend_string = "=" + stringify(*p.provided_by_spec->package_ptr())
+ + "-" + stringify(v);
return result;
}
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index c682629..e60ec69 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -657,14 +657,30 @@ PortageRepository::do_query_repository_masks(const QualifiedPackageName & q, con
p_end(_imp->profiles_dir_locations.end()) ; p != p_end ; ++p)
{
FSEntry fff(*p / "package.mask");
+ Context context_local("When reading '" + stringify(fff) + "':");
+
if (fff.exists())
{
LineConfigFile ff(fff);
for (LineConfigFile::Iterator line(ff.begin()), line_end(ff.end()) ;
line != line_end ; ++line)
{
- std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
- _imp->repo_mask[a->package()].push_back(a);
+ try
+ {
+ std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
+ if (a->package_ptr())
+ _imp->repo_mask[*a->package_ptr()].push_back(a);
+ else
+ Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask spec '"
+ + stringify(*line) + "' failed because specification does not restrict to a "
+ "unique package");
+ }
+ catch (const NameError & e)
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask spec '"
+ + stringify(*line) + "' failed due to exception '" + e.message() + "' ("
+ + e.what() + ")");
+ }
}
}
}
@@ -1033,13 +1049,19 @@ std::tr1::shared_ptr<const VersionMetadata>
PortageRepository::virtual_package_version_metadata(const RepositoryVirtualsEntry & p,
const VersionSpec & v) const
{
- std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(p.provided_by_spec->package(), v));
+ Context context("When fetching virtual package version metadata for '" + stringify(*p.provided_by_spec)
+ + "' version '" + stringify(v) + "':");
+
+ if (! p.provided_by_spec->package_ptr())
+ throw ConfigurationError("Virtual provider atom does not specify an unambiguous package");
+
+ std::tr1::shared_ptr<const VersionMetadata> m(version_metadata(*p.provided_by_spec->package_ptr(), v));
std::tr1::shared_ptr<PortageVirtualVersionMetadata> result(new PortageVirtualVersionMetadata(
- m->slot, PackageDatabaseEntry(p.provided_by_spec->package(), v, name())));
+ m->slot, PackageDatabaseEntry(*p.provided_by_spec->package_ptr(), v, name())));
result->eapi = m->eapi;
- result->build_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
- result->run_depend_string = "=" + stringify(p.provided_by_spec->package()) + "-" + stringify(v);
+ result->build_depend_string = "=" + stringify(*p.provided_by_spec->package_ptr()) + "-" + stringify(v);
+ result->run_depend_string = "=" + stringify(*p.provided_by_spec->package_ptr()) + "-" + stringify(v);
return result;
diff --git a/paludis/repositories/gentoo/portage_repository_profile.cc b/paludis/repositories/gentoo/portage_repository_profile.cc
index 8a58c71..2501b21 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.cc
+++ b/paludis/repositories/gentoo/portage_repository_profile.cc
@@ -411,7 +411,12 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
try
{
std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(*line));
- package_mask[a->package()].push_back(a);
+ if (a->package_ptr())
+ package_mask[*a->package_ptr()].push_back(a);
+ else
+ Log::get_instance()->message(ll_warning, lc_context, "Loading package.mask spec '"
+ + stringify(*line) + "' failed because specification does not restrict to a "
+ "unique package");
}
catch (const NameError & e)
{
diff --git a/paludis/repositories/gentoo/portage_repository_sets.cc b/paludis/repositories/gentoo/portage_repository_sets.cc
index b03f32d..1fac666 100644
--- a/paludis/repositories/gentoo/portage_repository_sets.cc
+++ b/paludis/repositories/gentoo/portage_repository_sets.cc
@@ -121,10 +121,16 @@ PortageRepositorySets::package_set(const SetName & s) const
{
std::tr1::shared_ptr<PackageDepSpec> p(new PackageDepSpec(tokens.at(1)));
p->set_tag(tag);
- if (! _imp->environment->package_database()->query(
- query::Package(p->package()) & query::InstalledAtRoot(
- _imp->params.environment->root()), qo_whatever)->empty())
- result->add_child(p);
+ if (p->package_ptr())
+ {
+ if (! _imp->environment->package_database()->query(
+ query::Package(*p->package_ptr()) & query::InstalledAtRoot(
+ _imp->params.environment->root()), qo_whatever)->empty())
+ result->add_child(p);
+ }
+ else
+ Log::get_instance()->message(ll_warning, lc_context, "Line '" + *line + "' in set file '"
+ + stringify(ff) + "' uses ? operator but does not specify an unambiguous package");
}
else
Log::get_instance()->message(ll_warning, lc_context,
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index c0b93a8..5f7eff9 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -390,7 +390,7 @@ namespace paludis
try
{
PackageDepSpec spec("=" + stringify(cat) + "/" + pkg_i->basename());
- entries.push_back(VDBEntry(spec.package(),
+ entries.push_back(VDBEntry(*spec.package_ptr(),
spec.version_requirements_ptr()->begin()->version_spec));
}
catch (const Exception & e)
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 8543a0f..cd626bb 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -146,7 +146,7 @@ namespace
/*
* call-seq:
- * package -> String
+ * package -> String or Nil
*
* Fetch the package name.
*/
@@ -155,7 +155,9 @@ namespace
{
std::tr1::shared_ptr<const PackageDepSpec> * ptr;
Data_Get_Struct(self, std::tr1::shared_ptr<const PackageDepSpec>, ptr);
- return rb_str_new2(stringify((*ptr)->package()).c_str());
+ if (0 == (*ptr)->package_ptr())
+ return Qnil;
+ return rb_str_new2(stringify(*(*ptr)->package_ptr()).c_str());
}
/*
diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
index bd13744..75f8537 100644
--- a/src/clients/paludis/uninstall.cc
+++ b/src/clients/paludis/uninstall.cc
@@ -153,7 +153,8 @@ namespace
virtual void on_update_world(const PackageDepSpec & a)
{
- cout << "* removing " << colour(cl_package_name, a.package()) << endl;
+ if (a.package_ptr())
+ cout << "* removing " << colour(cl_package_name, *a.package_ptr()) << endl;
}
virtual void on_update_world(const SetName & a)