diff options
author | 2008-03-09 14:07:05 +0000 | |
---|---|---|
committer | 2008-03-09 14:07:05 +0000 | |
commit | a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d (patch) | |
tree | f3d4c5c11709d26bebdf0e7e424b569dcd992253 /paludis/repositories | |
parent | 410f8b38e6bb0feb13e2d5e5c3ac34c4e87c0fee (diff) | |
download | paludis-a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d.tar.gz paludis-a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d.tar.xz |
world is now in env, not repos. Fixes: ticket:421
Diffstat (limited to 'paludis/repositories')
21 files changed, 33 insertions, 389 deletions
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc index 842918e31..1f1dc3435 100644 --- a/paludis/repositories/cran/cran_installed_repository.cc +++ b/paludis/repositories/cran/cran_installed_repository.cc @@ -158,7 +158,6 @@ CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryPa (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), static_cast<RepositoryUseInterface *>(0)) - (k::world_interface(), this) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0)) @@ -385,14 +384,13 @@ CRANInstalledRepository::make_cran_installed_repository( root = stringify(env->root()); std::string world; - if (m->end() == m->find("world") || ((world = m->find("world")->second)).empty()) - world = location + "/world"; + if (m->end() != m->find("world") && ! ((world = m->find("world")->second)).empty()) + throw CRANInstalledRepositoryConfigurationError("Key 'world' is no longer supported."); return tr1::shared_ptr<Repository>(new CRANInstalledRepository(CRANInstalledRepositoryParams::create() .environment(env) .location(location) - .root(root) - .world(world))); + .root(root))); } CRANInstalledRepositoryConfigurationError::CRANInstalledRepositoryConfigurationError( @@ -452,30 +450,6 @@ CRANInstalledRepository::package_set(const SetName & s) const return result; } - else if ("world" == s.data()) - { - tr1::shared_ptr<ConstTreeSequence<SetSpecTree, AllDepSpec> > result(new ConstTreeSequence<SetSpecTree, AllDepSpec>( - tr1::shared_ptr<AllDepSpec>(new AllDepSpec))); - tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name()))); - - if (_imp->params.world.exists()) - { - using namespace tr1::placeholders; - SetFile world(SetFileParams::create() - .file_name(_imp->params.world) - .type(sft_simple) - .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions())) - .tag(tag) - .environment(_imp->params.environment)); - - return world.contents(); - } - else - { - Log::get_instance()->message(ll_warning, lc_no_context) << "World file '" << _imp->params.world << "' doesn't exist"; - return result; - } - } else return tr1::shared_ptr<SetSpecTree::ConstItem>(); } @@ -487,7 +461,6 @@ CRANInstalledRepository::sets_list() const tr1::shared_ptr<SetNameSet> result(new SetNameSet); result->insert(SetName("everything")); - result->insert(SetName("world")); return result; } @@ -503,86 +476,12 @@ CRANInstalledRepository::invalidate_masks() { } -void -CRANInstalledRepository::add_string_to_world(const std::string & n) const -{ - using namespace tr1::placeholders; - - Context context("When adding '" + n + "' to world file '" + stringify(_imp->params.world) + "':"); - - if (! _imp->params.world.exists()) - { - std::ofstream f(stringify(_imp->params.world).c_str()); - if (! f) - { - Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '" - + stringify(_imp->params.world) + "'"); - return; - } - } - - SetFile world(SetFileParams::create() - .file_name(_imp->params.world) - .type(sft_simple) - .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions())) - .tag(tr1::shared_ptr<DepTag>()) - .environment(_imp->params.environment)); - world.add(n); - world.rewrite(); -} - -void -CRANInstalledRepository::remove_string_from_world(const std::string & n) const -{ - using namespace tr1::placeholders; - - Context context("When removing '" + n + "' from world file '" + stringify(_imp->params.world) + "':"); - - if (_imp->params.world.exists()) - { - SetFile world(SetFileParams::create() - .file_name(_imp->params.world) - .type(sft_simple) - .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions())) - .tag(tr1::shared_ptr<DepTag>()) - .environment(_imp->params.environment)); - - world.remove(n); - world.rewrite(); - } -} - bool CRANInstalledRepository::is_suitable_destination_for(const PackageID & e) const { std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : ""); return f == "cran"; } - -void -CRANInstalledRepository::add_to_world(const QualifiedPackageName & n) const -{ - add_string_to_world(stringify(n)); -} - -void -CRANInstalledRepository::remove_from_world(const QualifiedPackageName & n) const -{ - remove_string_from_world(stringify(n)); -} - -void -CRANInstalledRepository::add_to_world(const SetName & n) const -{ - add_string_to_world(stringify(n)); -} - -void -CRANInstalledRepository::remove_from_world(const SetName & n) const -{ - remove_string_from_world(stringify(n)); -} - bool CRANInstalledRepository::is_default_destination() const { diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh index d3f784096..1ca3ea975 100644 --- a/paludis/repositories/cran/cran_installed_repository.hh +++ b/paludis/repositories/cran/cran_installed_repository.hh @@ -47,7 +47,6 @@ namespace paludis class PALUDIS_VISIBLE CRANInstalledRepository : public Repository, public RepositorySetsInterface, - public RepositoryWorldInterface, public RepositoryDestinationInterface, public PrivateImplementationPattern<CRANInstalledRepository> { @@ -56,8 +55,6 @@ namespace paludis void _add_metadata_keys() const; void need_ids() const; - void add_string_to_world(const std::string & n) const; - void remove_string_from_world(const std::string &) const; protected: virtual void need_keys_added() const; @@ -88,13 +85,6 @@ namespace paludis virtual tr1::shared_ptr<const SetNameSet> sets_list() const PALUDIS_ATTRIBUTE((warn_unused_result)); - /* RepositoryWorldInterface */ - - virtual void add_to_world(const QualifiedPackageName &) const; - virtual void add_to_world(const SetName &) const; - virtual void remove_from_world(const QualifiedPackageName &) const; - virtual void remove_from_world(const SetName &) const; - /* RepositoryDestinationInterface */ virtual bool is_suitable_destination_for(const PackageID &) const diff --git a/paludis/repositories/cran/cran_installed_repository.sr b/paludis/repositories/cran/cran_installed_repository.sr index 150c7d97e..c892bb2c6 100644 --- a/paludis/repositories/cran/cran_installed_repository.sr +++ b/paludis/repositories/cran/cran_installed_repository.sr @@ -8,7 +8,6 @@ make_class_CRANInstalledRepositoryParams() key environment "const Environment *" key location FSEntry key root FSEntry - key world FSEntry doxygen_comment << "END" /** diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc index a86d6aa84..12c2ff9c9 100644 --- a/paludis/repositories/cran/cran_repository.cc +++ b/paludis/repositories/cran/cran_repository.cc @@ -103,7 +103,6 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) : (k::sets_interface(), this) (k::syncable_interface(), this) (k::use_interface(), static_cast<RepositoryUseInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc index 177c0683c..a7cec5cbf 100644 --- a/paludis/repositories/e/e_installed_repository.cc +++ b/paludis/repositories/e/e_installed_repository.cc @@ -147,83 +147,6 @@ EInstalledRepository::want_pre_post_phases() const return true; } -void -EInstalledRepository::add_string_to_world(const std::string & n) const -{ - using namespace tr1::placeholders; - - Lock l(_imp->world_mutex); - - Context context("When adding '" + n + "' to world file '" + stringify(_imp->params.world) + "':"); - - if (! _imp->params.world.exists()) - { - std::ofstream f(stringify(_imp->params.world).c_str()); - if (! f) - { - Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '" - + stringify(_imp->params.world) + "'"); - return; - } - } - - SetFile world(SetFileParams::create() - .file_name(_imp->params.world) - .type(sft_simple) - .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions())) - .tag(tr1::shared_ptr<DepTag>()) - .environment(_imp->params.environment)); - world.add(n); - world.rewrite(); -} - -void -EInstalledRepository::remove_string_from_world(const std::string & n) const -{ - using namespace tr1::placeholders; - - Lock l(_imp->world_mutex); - - Context context("When removing '" + n + "' from world file '" + stringify(_imp->params.world) + "':"); - - if (_imp->params.world.exists()) - { - SetFile world(SetFileParams::create() - .file_name(_imp->params.world) - .type(sft_simple) - .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions())) - .tag(tr1::shared_ptr<DepTag>()) - .environment(_imp->params.environment)); - - world.remove(n); - world.rewrite(); - } -} - -void -EInstalledRepository::add_to_world(const QualifiedPackageName & n) const -{ - add_string_to_world(stringify(n)); -} - -void -EInstalledRepository::add_to_world(const SetName & n) const -{ - add_string_to_world(stringify(n)); -} - -void -EInstalledRepository::remove_from_world(const QualifiedPackageName & n) const -{ - remove_string_from_world(stringify(n)); -} - -void -EInstalledRepository::remove_from_world(const SetName & n) const -{ - remove_string_from_world(stringify(n)); -} - UseFlagState EInstalledRepository::query_use(const UseFlagName & f, const PackageID & e) const { @@ -316,22 +239,18 @@ EInstalledRepository::package_set(const SetName & s) const } else if ("world" == s.data()) { - tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name()))); - - if (_imp->params.world.exists()) + if (_imp->params.deprecated_world.exists()) { + tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name()))); + SetFile world(SetFileParams::create() - .file_name(_imp->params.world) + .file_name(_imp->params.deprecated_world) .type(sft_simple) .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions())) .tag(tag) .environment(_imp->params.environment)); return world.contents(); } - else - Log::get_instance()->message(ll_warning, lc_no_context, - "World file '" + stringify(_imp->params.world) + - "' doesn't exist"); return tr1::shared_ptr<SetSpecTree::ConstItem>(new ConstTreeSequence<SetSpecTree, AllDepSpec>( tr1::shared_ptr<AllDepSpec>(new AllDepSpec))); @@ -347,7 +266,8 @@ EInstalledRepository::sets_list() const tr1::shared_ptr<SetNameSet> result(new SetNameSet); result->insert(SetName("everything")); - result->insert(SetName("world")); + if (_imp->params.deprecated_world.exists()) + result->insert(SetName("world")); return result; } diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh index 4a1a3cb10..342bffb9c 100644 --- a/paludis/repositories/e/e_installed_repository.hh +++ b/paludis/repositories/e/e_installed_repository.hh @@ -34,16 +34,12 @@ namespace paludis public Repository, public RepositoryUseInterface, public RepositorySetsInterface, - public RepositoryWorldInterface, public RepositoryEnvironmentVariableInterface, public RepositoryDestinationInterface, public RepositoryHookInterface, private PrivateImplementationPattern<EInstalledRepository> { private: - void add_string_to_world(const std::string & n) const; - void remove_string_from_world(const std::string &) const; - PrivateImplementationPattern<EInstalledRepository>::ImpPtr & _imp; protected: @@ -89,16 +85,6 @@ namespace paludis virtual tr1::shared_ptr<const SetNameSet> sets_list() const PALUDIS_ATTRIBUTE((warn_unused_result)); - /* RepositoryWorldInterface */ - - virtual void add_to_world(const QualifiedPackageName &) const; - - virtual void add_to_world(const SetName &) const; - - virtual void remove_from_world(const QualifiedPackageName &) const; - - virtual void remove_from_world(const SetName &) const; - /* RepositoryEnvironmentVariableInterface */ virtual std::string get_environment_variable( diff --git a/paludis/repositories/e/e_installed_repository.sr b/paludis/repositories/e/e_installed_repository.sr index a56ace37c..c9914dbee 100644 --- a/paludis/repositories/e/e_installed_repository.sr +++ b/paludis/repositories/e/e_installed_repository.sr @@ -6,7 +6,7 @@ make_class_EInstalledRepositoryParams() visible key environment "Environment *" - key world "FSEntry" + key deprecated_world "FSEntry" key root "FSEntry" key builddir "FSEntry" diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc index 9296d167e..93e9581a2 100644 --- a/paludis/repositories/e/e_repository.cc +++ b/paludis/repositories/e/e_repository.cc @@ -457,7 +457,6 @@ ERepository::ERepository(const ERepositoryParams & p) : (k::sets_interface(), this) (k::syncable_interface(), this) (k::use_interface(), this) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::environment_variable_interface(), this) (k::mirrors_interface(), this) (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string( diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc index b4d93670a..06e364373 100644 --- a/paludis/repositories/e/exndbam_repository.cc +++ b/paludis/repositories/e/exndbam_repository.cc @@ -69,7 +69,6 @@ namespace paludis tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key; tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key; tr1::shared_ptr<const MetadataValueKey<std::string> > format_key; - tr1::shared_ptr<const MetadataValueKey<FSEntry> > world_key; tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key; Implementation(const ExndbamRepositoryParams & p) : @@ -81,8 +80,6 @@ namespace paludis mkt_normal, params.root)), format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "vdb")), - world_key(new LiteralMetadataValueKey<FSEntry> ("world", "world", - mkt_normal, params.world)), builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir", mkt_normal, params.builddir)) { @@ -93,15 +90,14 @@ namespace paludis ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepositoryParams & p) : EInstalledRepository( EInstalledRepositoryParams::create() + .deprecated_world(p.deprecated_world) .environment(p.environment) - .world(p.world) .builddir(p.builddir) .root(p.root), n, RepositoryCapabilities::named_create() (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), this) - (k::world_interface(), this) (k::environment_variable_interface(), this) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) @@ -129,7 +125,6 @@ ExndbamRepository::_add_metadata_keys() const add_metadata_key(_imp->location_key); add_metadata_key(_imp->root_key); add_metadata_key(_imp->format_key); - add_metadata_key(_imp->world_key); add_metadata_key(_imp->builddir_key); } @@ -150,10 +145,6 @@ ExndbamRepository::make_exndbam_repository( if (m->end() == m->find("root") || ((root = m->find("root")->second)).empty()) root = "/"; - std::string world; - if (m->end() == m->find("world") || ((world = m->find("world")->second)).empty()) - world = location + "/world"; - std::string builddir; if (m->end() == m->find("builddir") || ((builddir = m->find("builddir")->second)).empty()) { @@ -168,13 +159,22 @@ ExndbamRepository::make_exndbam_repository( if (m->end() == m->find("name") || ((name = m->find("name")->second)).empty()) name = "installed"; + std::string deprecated_world; + if (m->end() == m->find("world") || ((deprecated_world = m->find("world")->second)).empty()) + deprecated_world = "/DOESNOTEXIST"; + else + Log::get_instance()->message(ll_warning, lc_context) << "Specifying world location " << + "in repository configuration files is deprecated. File '" << deprecated_world << "' will be " + "read but not updated. If you have recently upgraded from <paludis-0.26.0_alpha13, consult " + "the FAQ Upgrades section."; + return tr1::shared_ptr<Repository>(new ExndbamRepository( RepositoryName(name), ExndbamRepositoryParams::create() .environment(env) .location(location) .root(root) - .world(world) + .deprecated_world(deprecated_world) .builddir(builddir))); } diff --git a/paludis/repositories/e/exndbam_repository.sr b/paludis/repositories/e/exndbam_repository.sr index e63f68d32..5f1d6fe0f 100644 --- a/paludis/repositories/e/exndbam_repository.sr +++ b/paludis/repositories/e/exndbam_repository.sr @@ -8,7 +8,7 @@ make_class_ExndbamRepositoryParams() key environment "Environment *" key location FSEntry key root FSEntry - key world FSEntry + key deprecated_world FSEntry key builddir FSEntry allow_named_args diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc index e5278e271..447eb1b17 100644 --- a/paludis/repositories/e/vdb_repository.cc +++ b/paludis/repositories/e/vdb_repository.cc @@ -105,7 +105,6 @@ namespace paludis tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key; tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key; tr1::shared_ptr<const MetadataValueKey<std::string> > format_key; - tr1::shared_ptr<const MetadataValueKey<FSEntry> > world_key; tr1::shared_ptr<const MetadataValueKey<FSEntry> > provides_cache_key; tr1::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key; tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key; @@ -123,8 +122,6 @@ namespace paludis mkt_normal, params.root)), format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "vdb")), - world_key(new LiteralMetadataValueKey<FSEntry> ("world", "world", - mkt_normal, params.world)), provides_cache_key(new LiteralMetadataValueKey<FSEntry> ("provides_cache", "provides_cache", mkt_normal, params.provides_cache)), names_cache_key(new LiteralMetadataValueKey<FSEntry> ("names_cache", "names_cache", @@ -145,13 +142,12 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) : .environment(p.environment) .root(p.root) .builddir(p.builddir) - .world(p.world), + .deprecated_world(p.deprecated_world), p.name, RepositoryCapabilities::named_create() (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), this) - (k::world_interface(), this) (k::environment_variable_interface(), this) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::provides_interface(), this) @@ -179,7 +175,6 @@ VDBRepository::_add_metadata_keys() const add_metadata_key(_imp->location_key); add_metadata_key(_imp->root_key); add_metadata_key(_imp->format_key); - add_metadata_key(_imp->world_key); add_metadata_key(_imp->provides_cache_key); add_metadata_key(_imp->names_cache_key); add_metadata_key(_imp->builddir_key); @@ -288,9 +283,14 @@ VDBRepository::make_vdb_repository( if (m->end() == m->find("root") || ((root = m->find("root")->second)).empty()) root = "/"; - std::string world; - if (m->end() == m->find("world") || ((world = m->find("world")->second)).empty()) - world = location + "/world"; + std::string deprecated_world; + if (m->end() == m->find("world") || ((deprecated_world = m->find("world")->second)).empty()) + deprecated_world = "/DOESNOTEXIST"; + else + Log::get_instance()->message(ll_warning, lc_context) << "Specifying world location " << + "in repository configuration files is deprecated. File '" << deprecated_world << "' will be " + "read but not updated. If you have recently upgraded from <paludis-0.26.0_alpha13, consult " + "the FAQ Upgrades section."; std::string provides_cache; if (m->end() == m->find("provides_cache") || ((provides_cache = m->find("provides_cache")->second)).empty()) @@ -338,7 +338,7 @@ VDBRepository::make_vdb_repository( .environment(env) .location(location) .root(root) - .world(world) + .deprecated_world(deprecated_world) .builddir(builddir) .provides_cache(provides_cache) .name(RepositoryName(name)) diff --git a/paludis/repositories/e/vdb_repository.sr b/paludis/repositories/e/vdb_repository.sr index cfa8adac9..f18fe1391 100644 --- a/paludis/repositories/e/vdb_repository.sr +++ b/paludis/repositories/e/vdb_repository.sr @@ -8,7 +8,7 @@ make_class_VDBRepositoryParams() key environment "Environment *" key location FSEntry key root FSEntry - key world FSEntry + key deprecated_world FSEntry key provides_cache FSEntry key names_cache FSEntry key builddir FSEntry diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc index a44624e0e..bb2a4c017 100644 --- a/paludis/repositories/e/vdb_repository_TEST.cc +++ b/paludis/repositories/e/vdb_repository_TEST.cc @@ -131,145 +131,6 @@ namespace test_cases } test_vdb_repository_query_use; /** - * \test Test VDBRepository add_to_world. - */ - struct VDBRepositoryAddToWorldNewFileTest : TestCase - { - VDBRepositoryAddToWorldNewFileTest() : TestCase("add to world (new file)") { } - - void run() - { - TestEnvironment env; - env.set_paludis_command("/bin/false"); - tr1::shared_ptr<Map<std::string, std::string> > keys( - new Map<std::string, std::string>); - keys->insert("format", "vdb"); - keys->insert("names_cache", "/var/empty"); - keys->insert("provides_cache", "/var/empty"); - keys->insert("location", "vdb_repository_TEST_dir/repo1"); - keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build")); - keys->insert("world", "vdb_repository_TEST_dir/world-new-file"); - tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository( - &env, keys)); - (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo")); - std::ifstream world("vdb_repository_TEST_dir/world-new-file"); - std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>()); - TEST_CHECK_EQUAL(world_content, "cat-one/foofoo\n"); - } - } test_vdb_repository_add_to_world_new_file; - - /** - * \test Test VDBRepository add_to_world. - */ - struct VDBRepositoryAddToWorldEmptyFileTest : TestCase - { - VDBRepositoryAddToWorldEmptyFileTest() : TestCase("add to world (empty file)") { } - - void run() - { - TestEnvironment env; - env.set_paludis_command("/bin/false"); - tr1::shared_ptr<Map<std::string, std::string> > keys( - new Map<std::string, std::string>); - keys->insert("format", "vdb"); - keys->insert("names_cache", "/var/empty"); - keys->insert("provides_cache", "/var/empty"); - keys->insert("location", "vdb_repository_TEST_dir/repo1"); - keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build")); - keys->insert("world", "vdb_repository_TEST_dir/world-empty"); - tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository( - &env, keys)); - (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo")); - std::ifstream world("vdb_repository_TEST_dir/world-empty"); - std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>()); - TEST_CHECK_EQUAL(world_content, "cat-one/foofoo\n"); - } - } test_vdb_repository_add_to_world_empty_file; - - /** - * \test Test VDBRepository add_to_world. - */ - struct VDBRepositoryAddToWorldNoMatchTest : TestCase - { - VDBRepositoryAddToWorldNoMatchTest() : TestCase("add to world (no match)") { } - - void run() - { - TestEnvironment env; - env.set_paludis_command("/bin/false"); - tr1::shared_ptr<Map<std::string, std::string> > keys( - new Map<std::string, std::string>); - keys->insert("format", "vdb"); - keys->insert("names_cache", "/var/empty"); - keys->insert("provides_cache", "/var/empty"); - keys->insert("location", "vdb_repository_TEST_dir/repo1"); - keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build")); - keys->insert("world", "vdb_repository_TEST_dir/world-no-match"); - tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository( - &env, keys)); - (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo")); - std::ifstream world("vdb_repository_TEST_dir/world-no-match"); - std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>()); - TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/bar\ncat-one/oink\ncat-one/foofoo\n"); - } - } test_vdb_repository_add_to_world_no_match; - - /** - * \test Test VDBRepository add_to_world. - */ - struct VDBRepositoryAddToWorldMatchTest : TestCase - { - VDBRepositoryAddToWorldMatchTest() : TestCase("add to world (match)") { } - - void run() - { - TestEnvironment env; - env.set_paludis_command("/bin/false"); - tr1::shared_ptr<Map<std::string, std::string> > keys( - new Map<std::string, std::string>); - keys->insert("format", "vdb"); - keys->insert("names_cache", "/var/empty"); - keys->insert("provides_cache", "/var/empty"); - keys->insert("location", "vdb_repository_TEST_dir/repo1"); - keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build")); - keys->insert("world", "vdb_repository_TEST_dir/world-match"); - tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository( - &env, keys)); - (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo")); - std::ifstream world("vdb_repository_TEST_dir/world-match"); - std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>()); - TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/foofoo\ncat-one/bar\n"); - } - } test_vdb_repository_add_to_world_match; - - /** - * \test Test VDBRepository add_to_world. - */ - struct VDBRepositoryAddToWorldNoMatchNoEOLTest : TestCase - { - VDBRepositoryAddToWorldNoMatchNoEOLTest() : TestCase("add to world (no match, no trailing eol)") { } - - void run() - { - TestEnvironment env; - env.set_paludis_command("/bin/false"); - tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>); - keys->insert("format", "vdb"); - keys->insert("names_cache", "/var/empty"); - keys->insert("provides_cache", "/var/empty"); - keys->insert("location", "vdb_repository_TEST_dir/repo1"); - keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build")); - keys->insert("world", "vdb_repository_TEST_dir/world-no-match-no-eol"); - tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository( - &env, keys)); - (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo")); - std::ifstream world("vdb_repository_TEST_dir/world-no-match-no-eol"); - std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>()); - TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/bar\ncat-one/oink\ncat-one/foofoo\n"); - } - } test_vdb_repository_add_to_world_no_match_no_eol; - - /** * \test Test VDBRepository CONTENTS. */ struct VDBRepositoryContentsTest : TestCase diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc index 29cb158bc..9ec7edb8c 100644 --- a/paludis/repositories/fake/fake_installed_repository.cc +++ b/paludis/repositories/fake/fake_installed_repository.cc @@ -57,7 +57,6 @@ FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, co (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), this) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::provides_interface(), this) diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc index c62704807..128e450e1 100644 --- a/paludis/repositories/fake/fake_repository.cc +++ b/paludis/repositories/fake/fake_repository.cc @@ -64,7 +64,6 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), this) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::mirrors_interface(), this) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) @@ -88,7 +87,6 @@ FakeRepository::FakeRepository(const FakeRepositoryParams & params) : (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), this) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::mirrors_interface(), this) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc index b206cc29b..23c116e76 100644 --- a/paludis/repositories/gems/gems_repository.cc +++ b/paludis/repositories/gems/gems_repository.cc @@ -89,7 +89,6 @@ GemsRepository::GemsRepository(const gems::RepositoryParams & params) : (k::sets_interface(), static_cast<RepositorySetsInterface *>(0)) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), static_cast<RepositoryUseInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0)) diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc index b826cd5c0..151d7f828 100644 --- a/paludis/repositories/gems/installed_gems_repository.cc +++ b/paludis/repositories/gems/installed_gems_repository.cc @@ -89,7 +89,6 @@ InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepository (k::sets_interface(), static_cast<RepositorySetsInterface *>(0)) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), static_cast<RepositoryUseInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0)) diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc index 3f79d2246..aeca2f7dd 100644 --- a/paludis/repositories/unpackaged/installed_repository.cc +++ b/paludis/repositories/unpackaged/installed_repository.cc @@ -87,7 +87,6 @@ InstalledUnpackagedRepository::InstalledUnpackagedRepository( (k::sets_interface(), this) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), static_cast<RepositoryUseInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc index de09f1f03..58f4f29f7 100644 --- a/paludis/repositories/unpackaged/unpackaged_repository.cc +++ b/paludis/repositories/unpackaged/unpackaged_repository.cc @@ -90,7 +90,6 @@ UnpackagedRepository::UnpackagedRepository(const RepositoryName & n, (k::sets_interface(), static_cast<RepositorySetsInterface *>(0)) (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::use_interface(), static_cast<RepositoryUseInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc index 5441beb17..f1c52800a 100644 --- a/paludis/repositories/virtuals/installed_virtuals_repository.cc +++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc @@ -112,7 +112,6 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0)) (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0)) diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc index 0f1c6f449..bb582a41b 100644 --- a/paludis/repositories/virtuals/virtuals_repository.cc +++ b/paludis/repositories/virtuals/virtuals_repository.cc @@ -119,7 +119,6 @@ VirtualsRepository::VirtualsRepository(const Environment * const env) : (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0)) (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0)) (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0)) - (k::world_interface(), static_cast<RepositoryWorldInterface *>(0)) (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0)) (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0)) (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0)) |