aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-07-23 19:38:39 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-07-23 19:38:39 +0000
commitd0b17f294b1590abdd666367922b1ef8025569a5 (patch)
treeae829b51c02038a1cd7280c8dee36b6762903958
parent31e8add11f76654b4da9a476a8a03a8bfc43fae1 (diff)
downloadpaludis-d0b17f294b1590abdd666367922b1ef8025569a5.tar.gz
paludis-d0b17f294b1590abdd666367922b1ef8025569a5.tar.xz
Add invalidate_masks method to Repository and PackageID, and use them when appropriate. Fixes: ticket:325
-rw-r--r--paludis/environments/no_config/no_config_environment.cc4
-rw-r--r--paludis/package_id.cc6
-rw-r--r--paludis/package_id.hh2
-rw-r--r--paludis/repositories/e/e_repository.cc13
-rw-r--r--paludis/repositories/e/e_repository.hh2
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc39
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh7
-rw-r--r--paludis/repositories/e/ebuild_id.cc12
-rw-r--r--paludis/repositories/e/ebuild_id.hh2
-rw-r--r--paludis/repositories/e/exheres_layout.cc11
-rw-r--r--paludis/repositories/e/exheres_layout.hh2
-rw-r--r--paludis/repositories/e/layout.hh2
-rw-r--r--paludis/repositories/e/traditional_layout.cc11
-rw-r--r--paludis/repositories/e/traditional_layout.hh2
-rw-r--r--paludis/repositories/e/vdb_repository.cc5
-rw-r--r--paludis/repositories/e/vdb_repository.hh2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc12
-rw-r--r--paludis/repositories/fake/fake_package_id.hh2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc10
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh2
-rw-r--r--paludis/repositories/gems/gem_specification.cc12
-rw-r--r--paludis/repositories/gems/gem_specification.hh2
-rw-r--r--paludis/repositories/gems/gems_repository.cc12
-rw-r--r--paludis/repositories/gems/gems_repository.hh2
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc5
-rw-r--r--paludis/repositories/gems/installed_gems_repository.hh2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc5
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh2
-rw-r--r--paludis/repositories/virtuals/package_id.cc12
-rw-r--r--paludis/repositories/virtuals/package_id.hh2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc11
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh2
-rw-r--r--paludis/repository.hh5
33 files changed, 218 insertions, 4 deletions
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 832e239..8d053a2 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -231,6 +231,10 @@ void
NoConfigEnvironment::set_accept_unstable(const bool value)
{
_imp->accept_unstable = value;
+ for (PackageDatabase::RepositoryIterator it(_imp->package_database->begin_repositories()),
+ it_end(_imp->package_database->end_repositories());
+ it_end != it; ++it)
+ (*it)->invalidate_masks();
}
tr1::shared_ptr<Repository>
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index 183aedb..2609495 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -116,6 +116,12 @@ PackageID::masked() const
return begin_masks() != end_masks();
}
+void
+PackageID::invalidate_masks() const
+{
+ _imp->masks.clear();
+}
+
PackageID::MetadataIterator
PackageID::find_metadata(const std::string & s) const
{
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 9ab46a2..a447ec5 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -116,6 +116,8 @@ namespace paludis
MasksIterator end_masks() const PALUDIS_ATTRIBUTE((warn_unused_result));
bool masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void invalidate_masks() const;
+
/**
* Do we break Portage?
*
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 219a20a..a310b56 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -605,6 +605,17 @@ ERepository::invalidate()
}
void
+ERepository::invalidate_masks()
+{
+ _imp->layout->invalidate_masks();
+
+ if (DistributionData::get_instance()->distribution_from_string(_imp->params.environment->default_distribution())->support_old_style_virtuals)
+ if (_imp->params.environment->package_database()->has_repository_named(RepositoryName("virtuals")))
+ _imp->params.environment->package_database()->fetch_repository(
+ RepositoryName("virtuals"))->invalidate_masks();
+}
+
+void
ERepository::update_news() const
{
Lock l(_imp->news_ptr_mutex);
@@ -882,6 +893,8 @@ ERepository::set_profile(const ProfilesIterator & iter)
if (_imp->params.environment->package_database()->has_repository_named(RepositoryName("virtuals")))
_imp->params.environment->package_database()->fetch_repository(
RepositoryName("virtuals"))->invalidate();
+
+ invalidate_masks();
}
void
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 7ca800f..629a299 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -157,6 +157,8 @@ namespace paludis
virtual void invalidate();
+ virtual void invalidate_masks();
+
/* RepositoryMirrorsInterface */
virtual MirrorsIterator begin_mirrors(const std::string & s) const
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 8193d3f..207eefd 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -657,15 +657,46 @@ namespace test_cases
TEST_CHECK((*env.package_database()->query(query::Matches(PackageDepSpec("=cat/masked-0", pds_pm_unspecific)),
qo_require_exactly_one)->begin())->masked());
- TEST_CHECK((*env.package_database()->query(query::Matches(PackageDepSpec("=cat/was_masked-0", pds_pm_unspecific)),
- qo_require_exactly_one)->begin())->masked());
- TEST_CHECK((*env.package_database()->query(query::Matches(PackageDepSpec("=cat/not_masked-0", pds_pm_unspecific)),
- qo_require_exactly_one)->begin())->masked());
+ TEST_CHECK(! (*env.package_database()->query(query::Matches(PackageDepSpec("=cat/was_masked-0", pds_pm_unspecific)),
+ qo_require_exactly_one)->begin())->masked());
+ TEST_CHECK(! (*env.package_database()->query(query::Matches(PackageDepSpec("=cat/not_masked-0", pds_pm_unspecific)),
+ qo_require_exactly_one)->begin())->masked());
}
}
} test_e_repository_query_profile_masks;
/**
+ * \test Test ERepository invalidate_masks functions.
+ *
+ */
+ struct ERepositoryInvalidateMasksTest : TestCase
+ {
+ ERepositoryInvalidateMasksTest() : TestCase("invalidate_masks") { }
+
+ void run()
+ {
+ TestEnvironment env;
+ tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", "e_repository_TEST_dir/repo10");
+ keys->insert("profiles", "e_repository_TEST_dir/repo10/profiles/profile");
+ tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
+ env.package_database()->add_repository(1, repo);
+
+ TEST_CHECK((*env.package_database()->query(query::Matches(PackageDepSpec("=cat/was_masked-0", pds_pm_unspecific)),
+ qo_require_exactly_one)->begin())->masked());
+ repo->set_profile(repo->find_profile(repo->params().location / "profiles/profile/subprofile"));
+ TEST_CHECK(! (*env.package_database()->query(query::Matches(PackageDepSpec("=cat/was_masked-0", pds_pm_unspecific)),
+ qo_require_exactly_one)->begin())->masked());
+ repo->set_profile(repo->find_profile(repo->params().location / "profiles/profile"));
+ TEST_CHECK((*env.package_database()->query(query::Matches(PackageDepSpec("=cat/was_masked-0", pds_pm_unspecific)),
+ qo_require_exactly_one)->begin())->masked());
+ }
+ } test_e_repository_invalidate_masks;
+
+ /**
* \test Test ERepository Manifest2 generation.
*
*/
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 3b65f7e..8e7d991 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -221,6 +221,10 @@ cd ..
mkdir -p repo10/{eclass,distfiles,profiles/profile/subprofile,cat/masked,cat/not_masked,cat/was_masked} || exit 1
cd repo10 || exit 1
echo "test-repo-10" > profiles/repo_name || exit 1
+cat <<END >profiles/profiles.desc || exit 1
+test profile stable
+test profile/subprofile stable
+END
cat <<END >profiles/profile/make.defaults || exit 1
ARCH=test
USE="flag1 flag2 flag3 -flag4 -flag5"
@@ -239,10 +243,13 @@ cat <<END >profiles/profile/subprofile/parent
..
END
cat <<END > cat/masked/masked-0.ebuild
+KEYWORDS="test"
END
cat <<END > cat/not_masked/not_masked-0.ebuild
+KEYWORDS="test"
END
cat <<END > cat/was_masked/was_masked-0.ebuild
+KEYWORDS="test"
END
cd ..
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 1c62c96..46911b5 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -373,6 +373,18 @@ EbuildID::need_masks_added() const
add_mask(breaks_mask);
}
+void
+EbuildID::invalidate_masks() const
+{
+ Lock l(_imp->mutex);
+
+ if (! _imp->has_masks)
+ return;
+
+ _imp->has_masks = false;
+ PackageID::invalidate_masks();
+}
+
const std::string
EbuildID::canonical_form(const PackageIDCanonicalForm f) const
{
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index e249e06..33f2d2c 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -114,6 +114,8 @@ namespace paludis
virtual void perform_action(Action &) const;
virtual const tr1::shared_ptr<const EAPI> eapi() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void invalidate_masks() const;
};
}
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 391e3fe..037a5a9 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -516,3 +516,14 @@ ExheresLayout::manifest_files(const QualifiedPackageName & qpn) const
return result;
}
+
+void
+ExheresLayout::invalidate_masks()
+{
+ Lock l(_imp->big_nasty_mutex);
+
+ for (IDMap::iterator it(_imp->ids.begin()), it_end(_imp->ids.end()); it_end != it; ++it)
+ for (PackageIDSequence::Iterator it2(it->second->begin()), it2_end(it->second->end());
+ it2_end != it2; ++it2)
+ (*it2)->invalidate_masks();
+}
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index e8edc6c..8718f1d 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -113,6 +113,8 @@ namespace paludis
virtual tr1::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void invalidate_masks();
};
}
}
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index 356f041..42bd400 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -135,6 +135,8 @@ namespace paludis
virtual tr1::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual void invalidate_masks() = 0;
+
///\}
};
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 099dbe2..3bfa77c 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -535,3 +535,14 @@ TraditionalLayout::manifest_files(const QualifiedPackageName & qpn) const
return result;
}
+
+void
+TraditionalLayout::invalidate_masks()
+{
+ Lock l(_imp->big_nasty_mutex);
+
+ for (IDMap::iterator it(_imp->ids.begin()), it_end(_imp->ids.end()); it_end != it; ++it)
+ for (PackageIDSequence::Iterator it2(it->second->begin()), it2_end(it->second->end());
+ it2_end != it2; ++it2)
+ (*it2)->invalidate_masks();
+}
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index 8427b63..d7433bb 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -115,6 +115,8 @@ namespace paludis
virtual tr1::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void invalidate_masks();
};
}
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 9e40be6..e86ea7b 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -553,6 +553,11 @@ VDBRepository::invalidate()
}
void
+VDBRepository::invalidate_masks()
+{
+}
+
+void
VDBRepository::add_string_to_world(const std::string & n) const
{
Lock l(_imp->big_nasty_mutex);
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index ca5661e..058a293 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -222,6 +222,8 @@ namespace paludis
virtual void invalidate();
+ virtual void invalidate_masks();
+
virtual void regenerate_cache() const;
///\name For use by VDBID
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index b890037..6e07fe8 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -664,6 +664,18 @@ FakePackageID::need_masks_added() const
add_mask(breaks_mask);
}
+void
+FakePackageID::invalidate_masks() const
+{
+ Lock l(_imp->mutex);
+
+ if (! _imp->has_masks)
+ return;
+
+ _imp->has_masks = false;
+ PackageID::invalidate_masks();
+}
+
namespace
{
struct PerformAction :
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 3114b38..276addc 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -183,6 +183,8 @@ namespace paludis
virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual void invalidate_masks() const;
+
};
}
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 967fcb1..b7d1647 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -189,6 +189,16 @@ FakeRepositoryBase::invalidate()
{
}
+void
+FakeRepositoryBase::invalidate_masks()
+{
+ for (std::map<QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::iterator it(_imp->ids.begin()), it_end(_imp->ids.end());
+ it_end != it; ++it)
+ for (PackageIDSequence::Iterator it2(it->second->begin()), it2_end(it->second->end());
+ it2_end != it2; ++it2)
+ (*it2)->invalidate_masks();
+}
+
tr1::shared_ptr<const UseFlagNameSet>
FakeRepositoryBase::do_use_expand_flags() const
{
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index c07c9a6..3bdfd72 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -149,6 +149,8 @@ namespace paludis
virtual void invalidate();
+ virtual void invalidate_masks();
+
/**
* Fetch our associated environment.
*/
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 6f2cd22..ac61a19 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -627,6 +627,18 @@ GemSpecification::need_masks_added() const
add_mask(breaks_mask);
}
+void
+GemSpecification::invalidate_masks() const
+{
+ Lock l(_imp->mutex);
+
+ if (! _imp->has_masks)
+ return;
+
+ _imp->has_masks = false;
+ PackageID::invalidate_masks();
+}
+
bool
GemSpecification::breaks_portage() const
{
diff --git a/paludis/repositories/gems/gem_specification.hh b/paludis/repositories/gems/gem_specification.hh
index 3870c76..ffded7a 100644
--- a/paludis/repositories/gems/gem_specification.hh
+++ b/paludis/repositories/gems/gem_specification.hh
@@ -120,6 +120,8 @@ namespace paludis
virtual std::size_t extra_hash_value() const;
virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void invalidate_masks() const;
};
}
}
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 5274ac7..64b0716 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -109,6 +109,18 @@ GemsRepository::invalidate()
_imp.reset(new Implementation<GemsRepository>(_imp->params));
}
+void
+GemsRepository::invalidate_masks()
+{
+ Lock l(_imp->big_nasty_mutex);
+
+ for (MakeHashedMap<QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::Type::iterator it(_imp->ids.begin()), it_end(_imp->ids.end());
+ it_end != it; ++it)
+ for (PackageIDSequence::Iterator it2(it->second->begin()), it2_end(it->second->end());
+ it2_end != it2; ++it2)
+ (*it2)->invalidate_masks();
+}
+
bool
GemsRepository::do_has_category_named(const CategoryNamePart & c) const
{
diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh
index bef9627..4f18aea 100644
--- a/paludis/repositories/gems/gems_repository.hh
+++ b/paludis/repositories/gems/gems_repository.hh
@@ -76,6 +76,8 @@ namespace paludis
~GemsRepository();
virtual void invalidate();
+
+ virtual void invalidate_masks();
};
}
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 3c9b7ca..557c85c 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -114,6 +114,11 @@ InstalledGemsRepository::invalidate()
_imp.reset(new Implementation<InstalledGemsRepository>(_imp->params));
}
+void
+InstalledGemsRepository::invalidate_masks()
+{
+}
+
bool
InstalledGemsRepository::do_has_category_named(const CategoryNamePart & c) const
{
diff --git a/paludis/repositories/gems/installed_gems_repository.hh b/paludis/repositories/gems/installed_gems_repository.hh
index eea593c..4e36199 100644
--- a/paludis/repositories/gems/installed_gems_repository.hh
+++ b/paludis/repositories/gems/installed_gems_repository.hh
@@ -83,6 +83,8 @@ namespace paludis
virtual void invalidate();
+ virtual void invalidate_masks();
+
/* RepositoryDestinationInterface */
virtual bool is_suitable_destination_for(const PackageID &) const
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index d6ebe6a..8f7e650 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -243,6 +243,11 @@ InstalledVirtualsRepository::invalidate()
_imp.reset(new Implementation<InstalledVirtualsRepository>(_imp->env, _imp->root));
}
+void
+InstalledVirtualsRepository::invalidate_masks()
+{
+}
+
FSEntry
InstalledVirtualsRepository::root() const
{
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 8e8fa77..ab08536 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -88,6 +88,8 @@ namespace paludis
virtual void invalidate();
+ virtual void invalidate_masks();
+
virtual bool can_be_favourite_repository() const;
virtual FSEntry root() const;
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 85491cc..9c2fb6f 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -471,6 +471,18 @@ VirtualsPackageID::need_masks_added() const
_imp->has_masks = true;
}
+void
+VirtualsPackageID::invalidate_masks() const
+{
+ Lock l(_imp->mutex);
+
+ if (! _imp->has_masks)
+ return;
+
+ _imp->has_masks = false;
+ PackageID::invalidate_masks();
+}
+
bool
VirtualsPackageID::breaks_portage() const
{
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index 304ee17..77204dc 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -124,6 +124,8 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void invalidate_masks() const;
};
}
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index bfcdfc0..b7ffa6f 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -308,6 +308,17 @@ VirtualsRepository::invalidate()
_imp.reset(new Implementation<VirtualsRepository>(_imp->env));
}
+void
+VirtualsRepository::invalidate_masks()
+{
+ Lock l(_imp->big_nasty_mutex);
+
+ for (IDMap::iterator it(_imp->ids.begin()), it_end(_imp->ids.end()); it_end != it; ++it)
+ for (PackageIDSequence::Iterator it2(it->second->begin()), it2_end(it->second->end());
+ it2_end != it2; ++it2)
+ (*it2)->invalidate_masks();
+}
+
const tr1::shared_ptr<const PackageID>
VirtualsRepository::make_virtual_package_id(
const QualifiedPackageName & virtual_name, const tr1::shared_ptr<const PackageID> & provider) const
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index e1c30ac..eeb6d9a 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -88,6 +88,8 @@ namespace paludis
virtual void invalidate();
+ virtual void invalidate_masks();
+
virtual bool can_be_favourite_repository() const;
};
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index d334966..370367b 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -228,6 +228,11 @@ namespace paludis
virtual void invalidate() = 0;
/**
+ * Invalidate cached masks.
+ */
+ virtual void invalidate_masks() = 0;
+
+ /**
* Regenerate any on disk cache.
*/
virtual void regenerate_cache() const;