diff options
author | 2008-07-20 14:18:42 +0100 | |
---|---|---|
committer | 2008-07-20 14:18:42 +0100 | |
commit | 94e9ecd9fec55432a79e43b6964fc63ff80d2e89 (patch) | |
tree | ad2679620043d795c789e3710c22c12bf490a8d6 | |
parent | 2f05223862c5c21934b39f2337182b8dfa680f45 (diff) | |
download | paludis-94e9ecd9fec55432a79e43b6964fc63ff80d2e89.tar.gz paludis-94e9ecd9fec55432a79e43b6964fc63ff80d2e89.tar.xz |
Kill --no-config-protection.
It didn't do what you expect anyway.
Fixes: ticket:619
31 files changed, 48 insertions, 339 deletions
diff --git a/paludis/action-fwd.hh b/paludis/action-fwd.hh index b0364271c..ef58a1c40 100644 --- a/paludis/action-fwd.hh +++ b/paludis/action-fwd.hh @@ -81,24 +81,12 @@ namespace paludis * \since 0.26 */ typedef kc::KeyedClass< - kc::Field<k::no_config_protect, bool>, kc::Field<k::debug_build, InstallActionDebugOption>, kc::Field<k::checks, InstallActionChecksOption>, kc::Field<k::destination, std::tr1::shared_ptr<Repository> > > InstallActionOptions; /** - * Options for an UninstallAction. - * - * \see UninstallAction - * \ingroup g_actions - * \since 0.26 - */ - typedef kc::KeyedClass< - kc::Field<k::no_config_protect, bool> - > UninstallActionOptions; - - /** * A failed fetch action part. * * \see FetchActionError diff --git a/paludis/action.cc b/paludis/action.cc index 031aeccf3..df6361633 100644 --- a/paludis/action.cc +++ b/paludis/action.cc @@ -81,23 +81,7 @@ FetchAction::~FetchAction() { } -namespace paludis -{ - template <> - struct Implementation<UninstallAction> - { - const UninstallActionOptions options; - - Implementation(const UninstallActionOptions & o) : - options(o) - { - } - }; -} - -UninstallAction::UninstallAction(const UninstallActionOptions & o) : - PrivateImplementationPattern<UninstallAction>(new Implementation<UninstallAction>(o)), - options(_imp->options) +UninstallAction::UninstallAction() { } @@ -329,7 +313,6 @@ template class PrivateImplementationPattern<FetchAction>; template class PrivateImplementationPattern<InstallAction>; template class PrivateImplementationPattern<PretendAction>; template class PrivateImplementationPattern<PretendFetchAction>; -template class PrivateImplementationPattern<UninstallAction>; template class Sequence<FetchActionFailure>; diff --git a/paludis/action.hh b/paludis/action.hh index 5cb506fde..3aa4c91ea 100644 --- a/paludis/action.hh +++ b/paludis/action.hh @@ -168,20 +168,16 @@ namespace paludis */ class PALUDIS_VISIBLE UninstallAction : public Action, - private PrivateImplementationPattern<UninstallAction>, public AcceptInterfaceVisitsThis<ActionVisitorTypes, UninstallAction> { public: ///\name Basic operations ///\{ - UninstallAction(const UninstallActionOptions &); + UninstallAction(); ~UninstallAction(); ///\} - - /// Options for the action. - const UninstallActionOptions & options; }; /** diff --git a/paludis/args/install_args_group.cc b/paludis/args/install_args_group.cc index 05b88f867..773074784 100644 --- a/paludis/args/install_args_group.cc +++ b/paludis/args/install_args_group.cc @@ -36,7 +36,6 @@ InstallArgsGroup::InstallArgsGroup(ArgsHandler * h, const std::string & our_name a_preserve_world(this, "preserve-world", '1', "Don't modify the world file", true), a_add_to_world_spec(this, "add-to-world-spec", '\0', "Use this spec, rather than all targets, for updating world (for resume commands)"), - a_no_config_protection(this, "no-config-protection", '\0', "Disable config file protection (dangerous)", false), a_debug_build(this, "debug-build", '\0'), a_checks(this, "checks", '\0'), a_fetch(this, "fetch", 'f', "Only fetch sources; don't install anything", false), @@ -111,7 +110,6 @@ InstallArgsGroup::destinations(Environment * env) const void InstallArgsGroup::populate_install_task(const Environment *, InstallTask & task) const { - task.set_no_config_protect(a_no_config_protection.specified()); task.set_fetch_only(a_fetch.specified()); task.set_pretend(a_pretend.specified()); task.set_preserve_world(a_preserve_world.specified()); @@ -201,9 +199,6 @@ InstallArgsGroup::paludis_command_fragment() const { std::string paludis_command; - if (a_no_config_protection.specified()) - paludis_command.append(" --" + a_no_config_protection.long_name()); - if (a_preserve_world.specified()) paludis_command.append(" --" + a_preserve_world.long_name()); diff --git a/paludis/args/install_args_group.hh b/paludis/args/install_args_group.hh index 4689735ad..e16acee16 100644 --- a/paludis/args/install_args_group.hh +++ b/paludis/args/install_args_group.hh @@ -74,9 +74,6 @@ namespace paludis /// --add-to-world-spec paludis::args::StringArg a_add_to_world_spec; - /// --no-config-protection - paludis::args::SwitchArg a_no_config_protection; - /// --debug-build paludis::args::DebugBuildArg a_debug_build; diff --git a/paludis/install_task.cc b/paludis/install_task.cc index b507318e6..ebc0a88af 100644 --- a/paludis/install_task.cc +++ b/paludis/install_task.cc @@ -69,7 +69,6 @@ namespace paludis DepList dep_list; FetchActionOptions fetch_options; InstallActionOptions install_options; - UninstallActionOptions uninstall_options; std::list<std::string> raw_targets; std::tr1::shared_ptr<ConstTreeSequence<SetSpecTree, AllDepSpec> > targets; @@ -99,12 +98,10 @@ namespace paludis ), install_options( InstallActionOptions::named_create() - (k::no_config_protect(), false) (k::debug_build(), iado_none) (k::checks(), iaco_default) (k::destination(), std::tr1::shared_ptr<Repository>()) ), - uninstall_options(false), targets(new ConstTreeSequence<SetSpecTree, AllDepSpec>(std::tr1::shared_ptr<AllDepSpec>(new AllDepSpec))), destinations(d), pretend(false), @@ -785,7 +782,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i try { - UninstallAction uninstall_action(_imp->uninstall_options); + UninstallAction uninstall_action; (*c)->perform_action(uninstall_action); } catch (const UninstallActionError & e) @@ -1113,13 +1110,6 @@ InstallTask::dep_list() const } void -InstallTask::set_no_config_protect(const bool value) -{ - _imp->install_options[k::no_config_protect()] = value; - _imp->uninstall_options[k::no_config_protect()] = value; -} - -void InstallTask::set_fetch_only(const bool value) { _imp->fetch_only = value; diff --git a/paludis/install_task.hh b/paludis/install_task.hh index cc5ef2831..286d0c769 100644 --- a/paludis/install_task.hh +++ b/paludis/install_task.hh @@ -94,7 +94,6 @@ namespace paludis ///\name DepList and Install behaviour options ///\{ - void set_no_config_protect(const bool value); void set_fetch_only(const bool value); void set_pretend(const bool value); void set_preserve_world(const bool value); diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh index 319ef36d2..8a972abd1 100644 --- a/paludis/repositories/e/e_installed_repository.hh +++ b/paludis/repositories/e/e_installed_repository.hh @@ -118,7 +118,7 @@ namespace paludis ///\{ virtual void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id, - const UninstallActionOptions & o, bool reinstalling) const = 0; + bool reinstalling) const = 0; virtual void perform_config(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id) const; diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc index 19beb9a08..667edd7bc 100644 --- a/paludis/repositories/e/e_installed_repository_id.cc +++ b/paludis/repositories/e/e_installed_repository_id.cc @@ -702,10 +702,9 @@ namespace { } - void visit(const UninstallAction & a) + void visit(const UninstallAction &) { - std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_uninstall(id, - a.options, false); + std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_uninstall(id, false); } void visit(const InstalledAction &) diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc index da26ee425..d9c119092 100644 --- a/paludis/repositories/e/e_repository_TEST.cc +++ b/paludis/repositories/e/e_repository_TEST.cc @@ -1114,7 +1114,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), installed_repo) ); @@ -1340,7 +1339,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), installed_repo) ); @@ -1405,7 +1403,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), installed_repo) ); @@ -1575,7 +1572,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), installed_repo) ); @@ -2033,7 +2029,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), installed_repo) ); diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc index 21045e116..778a70b79 100644 --- a/paludis/repositories/e/ebuild.cc +++ b/paludis/repositories/e/ebuild.cc @@ -578,8 +578,6 @@ EbuildInstallCommand::extend_command(const Command & cmd) .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(install_params[k::loadsaveenv_dir()])) .with_setenv("PALUDIS_CONFIG_PROTECT", install_params[k::config_protect()]) .with_setenv("PALUDIS_CONFIG_PROTECT_MASK", install_params[k::config_protect_mask()]) - .with_setenv("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK", - install_params[k::disable_cfgpro()] ? "/" : "") .with_setenv("PALUDIS_PROFILE_DIR", stringify(*install_params[k::profiles()]->begin())) .with_setenv("PALUDIS_PROFILE_DIRS", join(install_params[k::profiles()]->begin(), install_params[k::profiles()]->end(), " ")) @@ -634,8 +632,7 @@ EbuildUninstallCommand::extend_command(const Command & cmd) Command result(Command(cmd) .with_setenv("ROOT", uninstall_params[k::root()]) .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(uninstall_params[k::loadsaveenv_dir()])) - .with_setenv("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK", - uninstall_params[k::disable_cfgpro()] ? "/" : "")); + ); if (uninstall_params[k::load_environment()]) result diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh index ff3fa2131..ebc7ac650 100644 --- a/paludis/repositories/e/ebuild.hh +++ b/paludis/repositories/e/ebuild.hh @@ -103,7 +103,6 @@ namespace paludis kc::Field<k::root, std::string>, kc::Field<k::profiles, std::tr1::shared_ptr<const FSEntrySequence> >, kc::Field<k::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > >, - kc::Field<k::disable_cfgpro, bool>, kc::Field<k::slot, SlotName>, kc::Field<k::config_protect, std::string>, kc::Field<k::config_protect_mask, std::string>, @@ -134,7 +133,6 @@ namespace paludis */ typedef kc::KeyedClass< kc::Field<k::root, std::string>, - kc::Field<k::disable_cfgpro, bool>, kc::Field<k::unmerge_only, bool>, kc::Field<k::load_environment, const FSEntry *>, kc::Field<k::loadsaveenv_dir, FSEntry> diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc index 758c0c58a..d3df168ca 100644 --- a/paludis/repositories/e/ebuild_entries.cc +++ b/paludis/repositories/e/ebuild_entries.cc @@ -708,7 +708,6 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id, (k::root(), o[k::destination()]->installed_root_key() ? stringify(o[k::destination()]->installed_root_key()->value()) : "/") (k::profiles(), _imp->params.profiles) - (k::disable_cfgpro(), o[k::no_config_protect()]) (k::config_protect(), _imp->e_repository->profile_variable("CONFIG_PROTECT")) (k::config_protect_mask(), _imp->e_repository->profile_variable("CONFIG_PROTECT_MASK")) (k::loadsaveenv_dir(), _imp->params.builddir / (stringify(id->name().category) + "-" + diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc index d59a7bdf2..9eb927306 100644 --- a/paludis/repositories/e/exndbam_repository.cc +++ b/paludis/repositories/e/exndbam_repository.cc @@ -368,8 +368,7 @@ ExndbamRepository::merge(const MergeParams & m) if (if_overwritten_id) { - UninstallActionOptions uninstall_options(false); - perform_uninstall(std::tr1::static_pointer_cast<const ERepositoryID>(if_overwritten_id), uninstall_options, true); + perform_uninstall(std::tr1::static_pointer_cast<const ERepositoryID>(if_overwritten_id), true); } VDBPostMergeCommand post_merge_command( @@ -380,8 +379,7 @@ ExndbamRepository::merge(const MergeParams & m) } void -ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id, - const UninstallActionOptions & o, bool replace) const +ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id, bool replace) const { Context context("When uninstalling '" + stringify(*id) + (replace ? "' for a reinstall:" : "':")); @@ -458,7 +456,6 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::named_create() (k::root(), stringify(_imp->params.root)) - (k::disable_cfgpro(), o[k::no_config_protect()]) (k::unmerge_only(), false) (k::loadsaveenv_dir(), ver_dir) (k::load_environment(), load_env.get())); diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh index 49de3fd7b..006c05c38 100644 --- a/paludis/repositories/e/exndbam_repository.hh +++ b/paludis/repositories/e/exndbam_repository.hh @@ -108,7 +108,7 @@ namespace paludis ///\{ void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id, - const UninstallActionOptions & o, bool reinstalling) const; + bool reinstalling) const; ///\} diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc index cd0a136d8..b8dcaf765 100644 --- a/paludis/repositories/e/vdb_repository.cc +++ b/paludis/repositories/e/vdb_repository.cc @@ -368,8 +368,7 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError( } void -VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id, - const UninstallActionOptions & o, bool reinstalling) const +VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> & id, bool reinstalling) const { Context context("When uninstalling '" + stringify(*id) + (reinstalling ? "' for a reinstall:" : "':")); @@ -437,7 +436,6 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID> EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::named_create() (k::root(), stringify(_imp->params.root)) - (k::disable_cfgpro(), o[k::no_config_protect()]) (k::unmerge_only(), false) (k::loadsaveenv_dir(), pkg_dir) (k::load_environment(), load_env.get())); @@ -843,10 +841,7 @@ VDBRepository::merge(const MergeParams & m) merger.merge(); if (is_replace) - { - UninstallActionOptions uninstall_options(false); - perform_uninstall(is_replace, uninstall_options, true); - } + perform_uninstall(is_replace, true); VDBPostMergeCommand post_merge_command( VDBPostMergeCommandParams::named_create() diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh index 67657de34..b47483a39 100644 --- a/paludis/repositories/e/vdb_repository.hh +++ b/paludis/repositories/e/vdb_repository.hh @@ -105,7 +105,7 @@ namespace paludis virtual void regenerate_cache() const; virtual void perform_uninstall(const std::tr1::shared_ptr<const erepository::ERepositoryID> & id, - const UninstallActionOptions & o, bool reinstalling) const; + bool reinstalling) const; /* RepositoryProvidesInterface */ diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc index b895f092f..817239a2a 100644 --- a/paludis/repositories/e/vdb_repository_TEST.cc +++ b/paludis/repositories/e/vdb_repository_TEST.cc @@ -337,13 +337,10 @@ namespace test_cases InstallAction install_action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), vdb_repo) ); - UninstallAction uninstall_action(UninstallActionOptions::named_create() - (k::no_config_protect(), false) - ); + UninstallAction uninstall_action; InfoAction info_action; ConfigAction config_action; @@ -454,13 +451,10 @@ namespace test_cases InstallAction install_action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), vdb_repo) ); - UninstallAction uninstall_action(UninstallActionOptions::named_create() - (k::no_config_protect(), false) - ); + UninstallAction uninstall_action; InfoAction info_action; ConfigAction config_action; @@ -571,13 +565,10 @@ namespace test_cases InstallAction install_action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), vdb_repo) ); - UninstallAction uninstall_action(UninstallActionOptions::named_create() - (k::no_config_protect(), false) - ); + UninstallAction uninstall_action; { std::vector<FSEntry> cache_contents; @@ -933,13 +924,10 @@ namespace test_cases InstallAction install_action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), vdb_repo) ); - UninstallAction uninstall_action(UninstallActionOptions::named_create() - (k::no_config_protect(), false) - ); + UninstallAction uninstall_action; TEST_CHECK_EQUAL(read_file(provides_cache), "paludis-3\ninstalled\n"); @@ -1149,7 +1137,6 @@ namespace test_cases InstallAction install_action(InstallActionOptions::named_create() (k::debug_build(), iado_none) (k::checks(), iaco_default) - (k::no_config_protect(), false) (k::destination(), vdb_repo) ); diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc index 1aa95467d..b4f7bd7eb 100644 --- a/paludis/repositories/unpackaged/installed_id.cc +++ b/paludis/repositories/unpackaged/installed_id.cc @@ -676,9 +676,9 @@ namespace { } - void visit(UninstallAction & a) + void visit(UninstallAction &) { - id->uninstall(a.options, false); + id->uninstall(false); } }; } @@ -724,7 +724,7 @@ InstalledUnpackagedID::extra_hash_value() const } void -InstalledUnpackagedID::uninstall(const UninstallActionOptions &, const bool replace) const +InstalledUnpackagedID::uninstall(const bool replace) const { Context context("When uninstalling '" + stringify(*this) + "':"); diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh index aa68682d9..d81a98532 100644 --- a/paludis/repositories/unpackaged/installed_id.hh +++ b/paludis/repositories/unpackaged/installed_id.hh @@ -87,7 +87,7 @@ namespace paludis virtual std::size_t extra_hash_value() const PALUDIS_ATTRIBUTE((warn_unused_result)); - void uninstall(const UninstallActionOptions &, const bool replace) const; + void uninstall(const bool replace) const; }; } } diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc index 03fe9f70d..acd6f335c 100644 --- a/paludis/repositories/unpackaged/installed_repository.cc +++ b/paludis/repositories/unpackaged/installed_repository.cc @@ -367,9 +367,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m) if (if_overwritten_id) { - std::tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(UninstallActionOptions::named_create() - (k::no_config_protect(), false), - true); + std::tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(true); } } diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc index d8732fd38..bd017326e 100644 --- a/paludis/repositories/unpackaged/installed_repository_TEST.cc +++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc @@ -255,9 +255,7 @@ namespace test_cases const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::All())]->begin()); - UninstallAction action(UninstallActionOptions::named_create() - (k::no_config_protect(), false) - ); + UninstallAction action; id->perform_action(action); TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root2/first").exists()); @@ -306,9 +304,7 @@ namespace test_cases generator::Matches(parse_user_package_dep_spec("cat-one/foo:fred", &env, UserPackageDepSpecOptions())))]->begin()); - UninstallAction action(UninstallActionOptions::named_create() - (k::no_config_protect(), false) - ); + UninstallAction action; id->perform_action(action); TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo3/indices/categories/cat-one/foo").is_symbolic_link()); @@ -391,7 +387,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::destination(), repo) - (k::no_config_protect(), false) (k::checks(), iaco_default) (k::debug_build(), iado_none)); (*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action); @@ -446,7 +441,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::destination(), repo) - (k::no_config_protect(), false) (k::checks(), iaco_default) (k::debug_build(), iado_none)); (*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action); @@ -504,7 +498,6 @@ namespace test_cases InstallAction action(InstallActionOptions::named_create() (k::destination(), repo) - (k::no_config_protect(), false) (k::checks(), iaco_default) (k::debug_build(), iado_none)); (*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action); @@ -544,8 +537,7 @@ namespace test_cases "cat/pkg4a-1.0:foo::installed-unpackaged cat/pkg4b-1.0:foo::installed-unpackaged"); } - UninstallAction action(UninstallActionOptions::named_create() - (k::no_config_protect(), false)); + UninstallAction action; (*env[selection::RequireExactlyOne(generator::Matches( parse_user_package_dep_spec("cat/pkg4a", &env, UserPackageDepSpecOptions())))]->begin())->perform_action(action); @@ -585,8 +577,7 @@ namespace test_cases "cat/pkg4b-1.0:foo::installed-unpackaged"); } - UninstallAction action(UninstallActionOptions::named_create() - (k::no_config_protect(), false)); + UninstallAction action; (*env[selection::RequireExactlyOne(generator::Matches( parse_user_package_dep_spec("cat/pkg4b", &env, UserPackageDepSpecOptions())))]->begin())->perform_action(action); diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc index 0a3915779..90bf59e20 100644 --- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc +++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc @@ -218,7 +218,6 @@ namespace test_cases *env[selection::RequireExactlyOne(generator::All())]->begin()); InstallAction action(InstallActionOptions::named_create() - (k::no_config_protect(), false) (k::debug_build(), iado_none) (k::checks(), iaco_default) (k::destination(), installed_repo) @@ -273,7 +272,6 @@ namespace test_cases *env[selection::RequireExactlyOne(generator::All())]->begin()); InstallAction action(InstallActionOptions::named_create() - (k::no_config_protect(), false) (k::debug_build(), iado_none) (k::checks(), iaco_default) (k::destination(), installed_repo) diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc index 89584f7d1..9a3b3877e 100644 --- a/paludis/uninstall_task.cc +++ b/paludis/uninstall_task.cc @@ -87,7 +87,6 @@ namespace paludis struct Implementation<UninstallTask> { Environment * const env; - UninstallActionOptions uninstall_options; std::list<std::string> raw_targets; std::list<std::tr1::shared_ptr<const PackageDepSpec> > targets; @@ -105,7 +104,6 @@ namespace paludis Implementation<UninstallTask>(Environment * const e) : env(e), - uninstall_options(false), pretend(false), preserve_world(false), all_versions(false), @@ -136,12 +134,6 @@ UninstallTask::set_pretend(const bool v) } void -UninstallTask::set_no_config_protect(const bool v) -{ - _imp->uninstall_options[k::no_config_protect()] = v; -} - -void UninstallTask::set_preserve_world(const bool v) { _imp->preserve_world = v; @@ -367,7 +359,7 @@ UninstallTask::execute() try { - UninstallAction uninstall_action(_imp->uninstall_options); + UninstallAction uninstall_action; i->package_id->perform_action(uninstall_action); } catch (const UninstallActionError & e) diff --git a/paludis/uninstall_task.hh b/paludis/uninstall_task.hh index 5e0d58654..52628a4b3 100644 --- a/paludis/uninstall_task.hh +++ b/paludis/uninstall_task.hh @@ -112,7 +112,6 @@ namespace paludis ///\name Behaviour options ///\{ - void set_no_config_protect(const bool value); void set_pretend(const bool value); void set_preserve_world(const bool value); void set_all_versions(const bool value); diff --git a/paludis/util/keys.hh b/paludis/util/keys.hh index 67e7d49b8..4375c7900 100644 --- a/paludis/util/keys.hh +++ b/paludis/util/keys.hh @@ -28,7 +28,6 @@ namespace paludis { typedef kc::Key<1> fetch_unneeded; typedef kc::Key<2> safe_resume; - typedef kc::Key<3> no_config_protect; typedef kc::Key<4> debug_build; typedef kc::Key<5> checks; typedef kc::Key<6> destination; @@ -131,7 +130,6 @@ namespace paludis typedef kc::Key<102> tools_options; typedef kc::Key<103> rewrite_virtuals; typedef kc::Key<104> no_slot_or_repo; - typedef kc::Key<105> disable_cfgpro; typedef kc::Key<106> slot; typedef kc::Key<107> loadsaveenv_dir; typedef kc::Key<108> unmerge_only; diff --git a/python/action.cc b/python/action.cc index a80ec18e4..c0d5d27bb 100644 --- a/python/action.cc +++ b/python/action.cc @@ -91,17 +91,11 @@ void expose_action() ( "InstallActionOptions", "Options for InstallAction.", - bp::init<const bool &, const InstallActionDebugOption &, const InstallActionChecksOption &, + bp::init<const InstallActionDebugOption &, const InstallActionChecksOption &, const std::tr1::shared_ptr<paludis::Repository> &>( - "__init__(no_config_protect_bool, InstallActionDebugOption,\n" - "InstallActionChecksOption, Repository)" + "__init__(InstallActionDebugOption, InstallActionChecksOption, Repository)" ) ) - .add_property("no_config_protect", - &kc_getter<InstallActionOptions, bool, k::no_config_protect>, - &kc_setter<InstallActionOptions, bool, k::no_config_protect>, - "[rw] bool" - ) .add_property("debug_build", &kc_getter<InstallActionOptions, InstallActionDebugOption, k::debug_build>, @@ -144,22 +138,6 @@ void expose_action() ) ; - /** - * UninstallActionOptions - */ - bp::class_<UninstallActionOptions> - ( - "UninstallActionOptions", - "Options for UninstallAction.", - bp::init<const bool &>("__init__(no_config_protect_bool)") - ) - .add_property("no_config_protect", - &kc_getter<UninstallActionOptions, bool, k::no_config_protect>, - &kc_setter<UninstallActionOptions, bool, k::no_config_protect>, - "[rw] bool" - ) - ; - /** * Action */ @@ -200,7 +178,7 @@ void expose_action() ( "UninstallAction", "An UninstallAction is used by UninstallTask to uninstall a PackageID.", - bp::init<const UninstallActionOptions &>("__init__(UninstallActionOptions)") + bp::init<>("__init__()") ); /** diff --git a/python/action_TEST.py b/python/action_TEST.py index 95e999e70..3becb9611 100755 --- a/python/action_TEST.py +++ b/python/action_TEST.py @@ -31,13 +31,12 @@ class TestCase_01_InstallActionOptions(unittest.TestCase): repo2 = FakeRepository(env, "2") def test_01_create(self): - InstallActionOptions(True, InstallActionDebugOption.values[0], InstallActionChecksOption.values[0], repo1) + InstallActionOptions(InstallActionDebugOption.values[0], InstallActionChecksOption.values[0], repo1) def test_02_data_members(self): - iao = InstallActionOptions(True, InstallActionDebugOption.values[0], + iao = InstallActionOptions(InstallActionDebugOption.values[0], InstallActionChecksOption.values[0], repo1) - self.assertEquals(iao.no_config_protect, True) self.assertEquals(iao.debug_build, InstallActionDebugOption.values[0]) self.assertEquals(iao.checks, InstallActionChecksOption.values[0]) self.assertEquals(str(iao.destination.name), "1") @@ -68,23 +67,11 @@ class TestCase_02_FetchActionOptions(unittest.TestCase): self.assertEquals(fao.fetch_unneeded, False) self.assertEquals(fao.safe_resume, False) -class TestCase_03_UninstallActionOptions(unittest.TestCase): - def test_01_create(self): - UninstallActionOptions(True) - - def test_02_data_members(self): - uao = UninstallActionOptions(True) - - self.assertEquals(uao.no_config_protect, True) - uao.no_config_protect = False - self.assertEquals(uao.no_config_protect, False) - - class TestCase_04_InstallAction(unittest.TestCase): def test_01_create(self): env = TestEnvironment() repo1 = FakeRepository(env, "1") - iao = InstallActionOptions(True, InstallActionDebugOption.values[0], + iao = InstallActionOptions(InstallActionDebugOption.values[0], InstallActionChecksOption.values[0], repo1) InstallAction(iao) @@ -94,7 +81,7 @@ class TestCase_05_FetchAction(unittest.TestCase): class TestCase_06_UninstallAction(unittest.TestCase): def test_01_create(self): - UninstallAction(UninstallActionOptions(True)) + UninstallAction() class TestCase_07_InstalledAction(unittest.TestCase): def test_01_create(self): diff --git a/ruby/action.cc b/ruby/action.cc index fee69b2aa..ee854d944 100644 --- a/ruby/action.cc +++ b/ruby/action.cc @@ -47,7 +47,6 @@ namespace static VALUE c_install_action_checks_option; static VALUE c_install_action; - static VALUE c_uninstall_action_options; static VALUE c_uninstall_action; static VALUE c_installed_action; @@ -130,36 +129,6 @@ namespace } } - const UninstallActionOptions - value_to_uninstall_action_options(VALUE v) - { - if (rb_obj_is_kind_of(v, c_uninstall_action_options)) - { - UninstallActionOptions * v_ptr; - Data_Get_Struct(v, UninstallActionOptions, v_ptr); - return *v_ptr; - } - else - { - rb_raise(rb_eTypeError, "Can't convert %s into UninstallActionOptions", rb_obj_classname(v)); - } - } - - VALUE - uninstall_action_options_to_value(const UninstallActionOptions & m) - { - UninstallActionOptions * m_ptr(new UninstallActionOptions(m)); - try - { - return Data_Wrap_Struct(c_uninstall_action_options, 0, &Common<UninstallActionOptions>::free, m_ptr); - } - catch (const std::exception & e) - { - delete m_ptr; - exception_to_ruby_exception(e); - } - } - const FetchActionFailure value_to_fetch_action_failure(VALUE v) { @@ -419,14 +388,6 @@ namespace * * Did we fail automatic fetching? */ - /* - * Document-method: no_config_protect? - * - * call-seq: - * no_config_protect? -> true or false - * - * Do we ignore config protection. - */ template <typename T_, typename K_, typename R_> struct KCFetch; @@ -522,7 +483,7 @@ namespace /* * call-seq: - * InstallActionOptions.new(no_config_protect, debug_build, checks, destination) -> InstallActionOptions + * InstallActionOptions.new(debug_build, checks, destination) -> InstallActionOptions * InstallActionOptions.new(Hash) -> InstallActionOptions * * InstallActionOptions.new can either be called with all parameters in order, or with one hash @@ -541,8 +502,6 @@ namespace if (1 == argc && rb_obj_is_kind_of(argv[0], rb_cHash)) { - if (Qnil == rb_hash_aref(argv[0], ID2SYM(rb_intern("no_config_protect")))) - rb_raise(rb_eArgError, "Missing Parameter: no_config_protect"); if (Qnil == rb_hash_aref(argv[0], ID2SYM(rb_intern("debug_build")))) rb_raise(rb_eArgError, "Missing Parameter: debug_build"); if (Qnil == rb_hash_aref(argv[0], ID2SYM(rb_intern("checks")))) @@ -559,20 +518,18 @@ namespace )); v_destination = value_to_repository(rb_hash_aref(argv[0], ID2SYM(rb_intern("destination")))); } - else if (4 == argc) + else if (3 == argc) { - v_no_config_protect = value_to_bool(argv[0]); - v_debug_build = static_cast<InstallActionDebugOption>(NUM2INT(argv[1])); - v_checks = static_cast<InstallActionChecksOption>(NUM2INT(argv[2])); - v_destination = value_to_repository(argv[3]); + v_debug_build = static_cast<InstallActionDebugOption>(NUM2INT(argv[0])); + v_checks = static_cast<InstallActionChecksOption>(NUM2INT(argv[1])); + v_destination = value_to_repository(argv[2]); } else { - rb_raise(rb_eArgError, "InstallActionOptions expects one or four arguments, but got %d",argc); + rb_raise(rb_eArgError, "InstallActionOptions expects one or three arguments, but got %d",argc); } ptr = new InstallActionOptions(InstallActionOptions::named_create() - (k::no_config_protect(), v_no_config_protect) (k::debug_build(), v_debug_build) (k::checks(), v_checks) (k::destination(), v_destination) @@ -638,61 +595,13 @@ namespace /* * call-seq: - * UninstallActionOptions.new(no_config_protect) -> UninstallActionOptions - * UninstallActionOptions.new(Hash) -> UninstallActionOptions - * - * UninstallActionOptions.new can either be called with all parameters in order, or with one hash - * parameter, where the hash keys are symbols with the names above. - */ - VALUE - uninstall_action_options_new(int argc, VALUE *argv, VALUE self) - { - UninstallActionOptions * ptr(0); - try - { - bool v_no_config_protect; - - if (1 == argc && rb_obj_is_kind_of(argv[0], rb_cHash)) - { - if (Qnil == rb_hash_aref(argv[0], ID2SYM(rb_intern("no_config_protect")))) - rb_raise(rb_eArgError, "Missing Parameter: no_config_protect"); - v_no_config_protect = - value_to_bool(rb_hash_aref(argv[0], ID2SYM(rb_intern("no_config_protect")))); - } - else if (1 == argc) - { - v_no_config_protect = value_to_bool(argv[0]); - } - else - { - rb_raise(rb_eArgError, "UninstallActionOptions expects one argument, but got %d",argc); - } - - ptr = new UninstallActionOptions(UninstallActionOptions::named_create() - (k::no_config_protect(), v_no_config_protect) - ); - - VALUE tdata(Data_Wrap_Struct(self, 0, &Common<UninstallActionOptions>::free, ptr)); - rb_obj_call_init(tdata, argc, argv); - return tdata; - } - catch (const std::exception & e) - { - delete ptr; - exception_to_ruby_exception(e); - } - } - - /* - * call-seq: * UninstallAction.new -> UninstallAction */ VALUE - uninstall_action_new(VALUE self, VALUE opts) + uninstall_action_new(VALUE self) { - const UninstallActionOptions opts_ptr(value_to_uninstall_action_options(opts)); std::tr1::shared_ptr<Action> * a( - new std::tr1::shared_ptr<Action>(new UninstallAction(opts_ptr))); + new std::tr1::shared_ptr<Action>(new UninstallAction)); VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<Action> >::free, a)); rb_obj_call_init(tdata, 1, &self); return tdata; @@ -700,20 +609,6 @@ namespace /* * call-seq: - * options -> UninstallActionOptions - * - * Our UninstallActionOptions. - */ - VALUE - uninstall_action_options(VALUE self) - { - std::tr1::shared_ptr<Action> * p; - Data_Get_Struct(self, std::tr1::shared_ptr<Action>, p); - return uninstall_action_options_to_value(std::tr1::static_pointer_cast<UninstallAction>(*p)->options); - } - - /* - * call-seq: * failed? -> true or false * * Did our pretend phase fail? @@ -855,8 +750,6 @@ namespace c_install_action_options = rb_define_class_under(paludis_module(), "InstallActionOptions", rb_cObject); rb_define_singleton_method(c_install_action_options, "new", RUBY_FUNC_CAST(&install_action_options_new), -1); rb_define_method(c_install_action_options, "initialize", RUBY_FUNC_CAST(&empty_init), -1); - rb_define_method(c_install_action_options, "no_config_protect?", - RUBY_FUNC_CAST((&KCFetch<InstallActionOptions, k::no_config_protect, bool>::fetch)), 0); rb_define_method(c_install_action_options, "debug_build", RUBY_FUNC_CAST((&KCFetchEnum<InstallActionOptions, k::debug_build>::fetch)), 0); rb_define_method(c_install_action_options, "checks", @@ -874,25 +767,13 @@ namespace rb_define_method(c_install_action, "options", RUBY_FUNC_CAST(&install_action_options), 0); /* - * Document-class: Paludis::UninstallActionOptions - * - * Options for Paludis::UninstallAction. - */ - c_uninstall_action_options = rb_define_class_under(paludis_module(), "UninstallActionOptions", rb_cObject); - rb_define_singleton_method(c_uninstall_action_options, "new", RUBY_FUNC_CAST(&uninstall_action_options_new), -1); - rb_define_method(c_uninstall_action_options, "initialize", RUBY_FUNC_CAST(&empty_init), -1); - rb_define_method(c_uninstall_action_options, "no_config_protect?", - RUBY_FUNC_CAST((&KCFetch<UninstallActionOptions, k::no_config_protect, bool>::fetch)), 0); - - /* * Document-class: Paludis::UninstallAction * * An UninstallAction is used by UninstallTask to uninstall a PackageID. */ c_uninstall_action = rb_define_class_under(paludis_module(), "UninstallAction", c_action); - rb_define_singleton_method(c_uninstall_action, "new", RUBY_FUNC_CAST(&uninstall_action_new), 1); + rb_define_singleton_method(c_uninstall_action, "new", RUBY_FUNC_CAST(&uninstall_action_new), 0); rb_define_method(c_uninstall_action, "initialize", RUBY_FUNC_CAST(&empty_init), -1); - rb_define_method(c_uninstall_action, "options", RUBY_FUNC_CAST(&uninstall_action_options), 0); /* * Document-class: Paludis::InstalledAction diff --git a/ruby/action_TEST.rb b/ruby/action_TEST.rb index c3ca9e32b..c51b353bb 100644 --- a/ruby/action_TEST.rb +++ b/ruby/action_TEST.rb @@ -30,13 +30,13 @@ module Paludis def hash_args InstallActionOptions.new( - {:no_config_protect => true, :debug_build => InstallActionDebugOption::Internal, + {:debug_build => InstallActionDebugOption::Internal, :checks => InstallActionChecksOption::Always, :destination => destination} ) end def long_args - InstallActionOptions.new(false, InstallActionDebugOption::Split, + InstallActionOptions.new(InstallActionDebugOption::Split, InstallActionChecksOption::Default, destination) end @@ -105,7 +105,6 @@ module Paludis def test_methods_hash_args opts = hash_args - assert opts.no_config_protect? assert_equal InstallActionDebugOption::Internal, opts.debug_build assert_equal InstallActionChecksOption::Always, opts.checks assert_equal destination.name, opts.destination.name @@ -113,29 +112,12 @@ module Paludis def test_methods_long_args opts = long_args - assert !opts.no_config_protect? assert_equal InstallActionDebugOption::Split, opts.debug_build assert_equal InstallActionChecksOption::Default, opts.checks assert_equal destination.name, opts.destination.name end end - class TestCase_UninstallActionOptions < Test::Unit::TestCase - def test_create - assert_kind_of UninstallActionOptions, UninstallActionOptions.new(true) - assert_kind_of UninstallActionOptions, UninstallActionOptions.new( - {:no_config_protect => false}) - end - - def test_methods - uao = UninstallActionOptions.new(true) - assert uao.no_config_protect? - - uao = UninstallActionOptions.new({:no_config_protect => false}) - assert !uao.no_config_protect? - end - end - class TestCase_FetchActionFailure < Test::Unit::TestCase def test_create assert_kind_of FetchActionFailure, FetchActionFailure.new('target_file', false, false, 'fic') @@ -250,7 +232,6 @@ module Paludis def test_options_hash_args action = InstallAction.new(hash_args) assert_kind_of InstallActionOptions, action.options - assert action.options.no_config_protect? assert_equal InstallActionDebugOption::Internal, action.options.debug_build assert_equal InstallActionChecksOption::Always, action.options.checks assert_equal destination.name, action.options.destination.name @@ -259,14 +240,12 @@ module Paludis class TestCase_UninstallAction < Test::Unit::TestCase def test_create - assert_kind_of UninstallAction, UninstallAction.new(UninstallActionOptions.new(true)) - assert_kind_of Action, UninstallAction.new(UninstallActionOptions.new(true)) - - assert_kind_of UninstallAction, UninstallAction.new(UninstallActionOptions.new({:no_config_protect => false})) + assert_kind_of UninstallAction, UninstallAction.new + assert_kind_of Action, UninstallAction.new end def test_bad_create - assert_raise TypeError do + assert_raise ArgumentError do UninstallAction.new("foo") end @@ -274,12 +253,6 @@ module Paludis InstallAction.new(InstallActionOptions.new({:monkey => false})) end end - - def test_options_hash_args - action = UninstallAction.new(UninstallActionOptions.new(false)) - assert_kind_of UninstallActionOptions, action.options - assert !action.options.no_config_protect? - end end class TestCase_PretendAction < Test::Unit::TestCase diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc index e58b51c10..c3505e6e5 100644 --- a/src/clients/paludis/uninstall.cc +++ b/src/clients/paludis/uninstall.cc @@ -227,7 +227,6 @@ namespace OurUninstallTask task(env); task.set_pretend(CommandLine::get_instance()->install_args.a_pretend.specified()); - task.set_no_config_protect(CommandLine::get_instance()->install_args.a_no_config_protection.specified()); task.set_preserve_world(CommandLine::get_instance()->install_args.a_preserve_world.specified()); task.set_with_unused_dependencies(CommandLine::get_instance()->a_with_unused_dependencies.specified()); task.set_with_dependencies(CommandLine::get_instance()->a_with_dependencies.specified()); |