aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-10 21:07:03 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-10 21:07:03 +0000
commit3a54ff3f3241ae868b235a94c4be6314954c8409 (patch)
tree92deecd2bac1a9dddd9643343374b72c437bc1b1
parent49fafdd0d12239aac4b99640db336f31be677dfb (diff)
downloadpaludis-3a54ff3f3241ae868b235a94c4be6314954c8409.tar.gz
paludis-3a54ff3f3241ae868b235a94c4be6314954c8409.tar.xz
Use UninstallOptions for uninstalls
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc2
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh2
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc2
-rw-r--r--paludis/repositories/gentoo/vdb_repository.hh2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc8
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh4
-rw-r--r--paludis/repository.hh4
-rw-r--r--paludis/repository.sr14
-rw-r--r--paludis/tasks/install_task.cc5
-rw-r--r--paludis/tasks/uninstall_task.cc9
10 files changed, 29 insertions, 23 deletions
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 775d64d..2455dab 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -517,7 +517,7 @@ CRANInstalledRepository::do_is_licence(const std::string &) const
void
CRANInstalledRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec & v,
- const InstallOptions &) const
+ const UninstallOptions &) const
{
Context context("When uninstalling '" + stringify(q) + "-" + stringify(v) +
"' from '" + stringify(name()) + "':");
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index c90d03d..39eba39 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -84,7 +84,7 @@ namespace paludis
virtual bool do_is_licence(const std::string &) const;
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
- const InstallOptions &) const;
+ const UninstallOptions &) const;
virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index bb75238..3a1f65b 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -896,7 +896,7 @@ VDBRepository::do_is_licence(const std::string &) const
}
void
-VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec & v, const InstallOptions & o) const
+VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec & v, const UninstallOptions & o) const
{
Context context("When uninstalling '" + stringify(q) + "-" + stringify(v) +
"' from '" + stringify(name()) + "':");
diff --git a/paludis/repositories/gentoo/vdb_repository.hh b/paludis/repositories/gentoo/vdb_repository.hh
index ddf85d8..f561526 100644
--- a/paludis/repositories/gentoo/vdb_repository.hh
+++ b/paludis/repositories/gentoo/vdb_repository.hh
@@ -94,7 +94,7 @@ namespace paludis
virtual bool do_is_licence(const std::string &) const;
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
- const InstallOptions &) const;
+ const UninstallOptions &) const;
virtual std::tr1::shared_ptr<DepAtom> do_package_set(const SetName &) const;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 8e124b2..006e0a0 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -92,7 +92,7 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
.news_interface(0)
.sets_interface(0)
.syncable_interface(0)
- .uninstallable_interface(this)
+ .uninstallable_interface(0)
.mirrors_interface(0)
.environment_variable_interface(0)
.world_interface(0)
@@ -333,12 +333,6 @@ InstalledVirtualsRepository::invalidate()
_imp.reset(new Implementation<InstalledVirtualsRepository>(_imp->env, _imp->root));
}
-void
-InstalledVirtualsRepository::do_uninstall(const QualifiedPackageName &, const VersionSpec &,
- const InstallOptions &) const
-{
-}
-
FSEntry
InstalledVirtualsRepository::root() const
{
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 60d4293..2f032b1 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -32,7 +32,6 @@ namespace paludis
class PALUDIS_VISIBLE InstalledVirtualsRepository :
public Repository,
public RepositoryInstalledInterface,
- public RepositoryUninstallableInterface,
public RepositoryMaskInterface,
private PrivateImplementationPattern<InstalledVirtualsRepository>
{
@@ -67,9 +66,6 @@ namespace paludis
virtual bool do_is_licence(const std::string &) const;
- virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
- const InstallOptions &) const;
-
public:
///\name Basic operations
//\{
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 7aa83fe..9a0432f 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -690,7 +690,7 @@ namespace paludis
* Override in descendents: uninstall.
*/
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
- const InstallOptions &) const = 0;
+ const UninstallOptions &) const = 0;
///\}
@@ -701,7 +701,7 @@ namespace paludis
/**
* Uninstall a package.
*/
- void uninstall(const QualifiedPackageName & q, const VersionSpec & v, const InstallOptions & i) const
+ void uninstall(const QualifiedPackageName & q, const VersionSpec & v, const UninstallOptions & i) const
{
do_uninstall(q, v, i);
}
diff --git a/paludis/repository.sr b/paludis/repository.sr
index 71de252..3583d57 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -19,6 +19,20 @@ make_class_InstallOptions()
END
}
+make_class_UninstallOptions()
+{
+ key no_config_protect bool
+
+ doxygen_comment << "END"
+ /**
+ * Options for the Repository::uninstall method.
+ *
+ * \see Repository
+ * \ingroup grprepository
+ */
+END
+}
+
make_class_RepositoryCapabilities()
{
key installable_interface "RepositoryInstallableInterface *"
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index ca875be..a25b778 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -36,6 +36,7 @@ namespace paludis
DepList dep_list;
DepList::Iterator current_dep_list_entry;
InstallOptions install_options;
+ UninstallOptions uninstall_options;
std::list<std::string> raw_targets;
std::tr1::shared_ptr<AllDepAtom> targets;
@@ -52,6 +53,7 @@ namespace paludis
dep_list(e, o),
current_dep_list_entry(dep_list.begin()),
install_options(false, false, ido_none, false, std::tr1::shared_ptr<Repository>()),
+ uninstall_options(false),
targets(new AllDepAtom),
pretend(false),
preserve_world(false),
@@ -344,7 +346,7 @@ InstallTask::execute()
try
{
- uninstall_interface->uninstall(c->name, c->version, _imp->install_options);
+ uninstall_interface->uninstall(c->name, c->version, _imp->uninstall_options);
}
catch (const PackageUninstallActionError & e)
{
@@ -441,6 +443,7 @@ void
InstallTask::set_no_config_protect(const bool value)
{
_imp->install_options.no_config_protect = value;
+ _imp->uninstall_options.no_config_protect = value;
}
void
diff --git a/paludis/tasks/uninstall_task.cc b/paludis/tasks/uninstall_task.cc
index 646b656..4f861c2 100644
--- a/paludis/tasks/uninstall_task.cc
+++ b/paludis/tasks/uninstall_task.cc
@@ -33,7 +33,7 @@ namespace paludis
struct Implementation<UninstallTask>
{
Environment * const env;
- InstallOptions install_options;
+ UninstallOptions uninstall_options;
std::list<std::string> raw_targets;
std::list<std::tr1::shared_ptr<PackageDepAtom> > targets;
@@ -50,7 +50,7 @@ namespace paludis
Implementation<UninstallTask>(Environment * const e) :
env(e),
- install_options(false, false, ido_none, false, std::tr1::shared_ptr<Repository>()),
+ uninstall_options(false),
pretend(false),
preserve_world(false),
all_versions(false),
@@ -82,7 +82,7 @@ UninstallTask::set_pretend(const bool v)
void
UninstallTask::set_no_config_protect(const bool v)
{
- _imp->install_options.no_config_protect = v;
+ _imp->uninstall_options.no_config_protect = v;
}
void
@@ -314,8 +314,7 @@ UninstallTask::execute()
try
{
- _imp->install_options.destination = _imp->env->package_database()->fetch_repository(i->package.repository);
- uninstall_interface->uninstall(i->package.name, i->package.version, _imp->install_options);
+ uninstall_interface->uninstall(i->package.name, i->package.version, _imp->uninstall_options);
}
catch (const PackageUninstallActionError & e)
{