aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-02-23 04:28:13 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-02-23 04:28:13 +0000
commit3f71c5e3da2bcafa3f14d11778d14c11fc1cb336 (patch)
treeb64f26914f1d79646f5937addbe3131a0bac8f22
parent25297c9a6543061bfc4a737f4d2f6c5bbfe022aa (diff)
downloadpaludis-3f71c5e3da2bcafa3f14d11778d14c11fc1cb336.tar.gz
paludis-3f71c5e3da2bcafa3f14d11778d14c11fc1cb336.tar.xz
Add environment to unmerger hooks.
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc5
-rw-r--r--paludis/repositories/gentoo/vdb_unmerger.cc22
-rw-r--r--paludis/repositories/gentoo/vdb_unmerger.hh3
-rw-r--r--paludis/repositories/gentoo/vdb_unmerger.sr3
4 files changed, 32 insertions, 1 deletions
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index f57cc49..d2b59fe 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -982,7 +982,10 @@ VDBRepository::_uninstall(const QualifiedPackageName & q, const VersionSpec & v,
.root(root())
.contents_file(pkg_dir / "CONTENTS")
.config_protect(config_protect)
- .config_protect_mask(config_protect_mask));
+ .config_protect_mask(config_protect_mask)
+ .package_name(q)
+ .version(v)
+ .repository(this));
unmerger.unmerge();
diff --git a/paludis/repositories/gentoo/vdb_unmerger.cc b/paludis/repositories/gentoo/vdb_unmerger.cc
index ac8904e..e0a6941 100644
--- a/paludis/repositories/gentoo/vdb_unmerger.cc
+++ b/paludis/repositories/gentoo/vdb_unmerger.cc
@@ -68,6 +68,28 @@ VDBUnmerger::~VDBUnmerger()
{
}
+Hook
+VDBUnmerger::extend_hook(const Hook & h)
+{
+ std::string cat(stringify(_imp->options.package_name.category));
+ std::string pn(stringify(_imp->options.package_name.package));
+ std::string pvr(stringify(_imp->options.version));
+ std::string pv(stringify(_imp->options.version.remove_revision()));
+ std::string slot(stringify(_imp->options.repository->version_metadata(_imp->options.package_name, _imp->options.version)->slot));
+
+ return Unmerger::extend_hook(h)
+ ("P", pn + "-" + pv)
+ ("PN", pn)
+ ("CATEGORY", cat)
+ ("PR", _imp->options.version.revision_only())
+ ("PV", pv)
+ ("PVR", pvr)
+ ("PF", pn + "-" + pvr)
+ ("SLOT", slot)
+ ("CONFIG_PROTECT", _imp->options.config_protect)
+ ("CONFIG_PROTECT_MASK", _imp->options.config_protect_mask);
+}
+
void
VDBUnmerger::unmerge()
{
diff --git a/paludis/repositories/gentoo/vdb_unmerger.hh b/paludis/repositories/gentoo/vdb_unmerger.hh
index 8e64332..48f3829 100644
--- a/paludis/repositories/gentoo/vdb_unmerger.hh
+++ b/paludis/repositories/gentoo/vdb_unmerger.hh
@@ -20,6 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_VDB_UNMERGER_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_VDB_UNMERGER_HH 1
+#include <paludis/repository.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/fs_entry.hh>
@@ -56,6 +57,8 @@ namespace paludis
VDBUnmerger(const VDBUnmergerOptions &);
~VDBUnmerger();
+ virtual Hook extend_hook(const Hook &);
+
void unmerge();
};
diff --git a/paludis/repositories/gentoo/vdb_unmerger.sr b/paludis/repositories/gentoo/vdb_unmerger.sr
index 0206c40..273d7ad 100644
--- a/paludis/repositories/gentoo/vdb_unmerger.sr
+++ b/paludis/repositories/gentoo/vdb_unmerger.sr
@@ -8,6 +8,9 @@ make_class_VDBUnmergerOptions()
key contents_file "FSEntry"
key config_protect std::string
key config_protect_mask std::string
+ key package_name "QualifiedPackageName"
+ key version "VersionSpec"
+ key repository "const Repository *"
allow_named_args