aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-10 21:14:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-10 21:52:33 +0000
commitb03059d8a8d899ba40137b0781fba0df20c9b741 (patch)
treed56703e1768520371c5d18f0749e33c975938549
parent0188868f3ec85fa793f57402e044e61e88335c23 (diff)
downloadpaludis-b03059d8a8d899ba40137b0781fba0df20c9b741.tar.gz
paludis-b03059d8a8d899ba40137b0781fba0df20c9b741.tar.xz
Don't assume CONFIG_PROTECT* exists in vdb.
Portage doesn't write these.
-rw-r--r--paludis/repositories/e/exndbam_repository.cc23
-rw-r--r--paludis/repositories/e/vdb_repository.cc21
2 files changed, 43 insertions, 1 deletions
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 2ac9887..dbec255 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -354,13 +354,23 @@ ExndbamRepository::merge(const MergeParams & m)
/* load CONFIG_PROTECT, CONFIG_PROTECT_MASK back */
std::string config_protect, config_protect_mask;
+ try
{
SafeIFStream c(target_ver_dir / "CONFIG_PROTECT");
config_protect = std::string((std::istreambuf_iterator<char>(c)), std::istreambuf_iterator<char>());
+ }
+ catch (const SafeIFStreamError &)
+ {
+ }
+ try
+ {
SafeIFStream c_m(target_ver_dir / "CONFIG_PROTECT_MASK");
config_protect_mask = std::string((std::istreambuf_iterator<char>(c_m)), std::istreambuf_iterator<char>());
}
+ catch (const SafeIFStreamError &)
+ {
+ }
NDBAMMerger merger(
make_named_values<NDBAMMergerParams>(
@@ -446,15 +456,26 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
{
/* load CONFIG_PROTECT, CONFIG_PROTECT_MASK from vdb, supplement with env */
std::string config_protect, config_protect_mask;
+
+ try
{
SafeIFStream c(ver_dir / "CONFIG_PROTECT");
config_protect = std::string((std::istreambuf_iterator<char>(c)), std::istreambuf_iterator<char>()) +
- " " + getenv_with_default("CONFIG_PROTECT", "");
+ " " + getenv_with_default("CONFIG_PROTECT", "");
+ }
+ catch (const SafeIFStreamError &)
+ {
+ }
+ try
+ {
SafeIFStream c_m(ver_dir / "CONFIG_PROTECT_MASK");
config_protect_mask = std::string((std::istreambuf_iterator<char>(c_m)), std::istreambuf_iterator<char>()) +
" " + getenv_with_default("CONFIG_PROTECT_MASK", "");
}
+ catch (const SafeIFStreamError &)
+ {
+ }
std::string final_config_protect(config_protect + " " + merge_config_protect);
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 9545322..199dc2d 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -408,15 +408,26 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
{
/* load CONFIG_PROTECT, CONFIG_PROTECT_MASK from vdb, supplement with env */
std::string config_protect, config_protect_mask;
+
+ try
{
SafeIFStream c(pkg_dir / "CONFIG_PROTECT");
config_protect = std::string((std::istreambuf_iterator<char>(c)), std::istreambuf_iterator<char>()) +
" " + getenv_with_default("CONFIG_PROTECT", "");
+ }
+ catch (const SafeIFStreamError &)
+ {
+ }
+ try
+ {
SafeIFStream c_m(pkg_dir / "CONFIG_PROTECT_MASK");
config_protect_mask = std::string((std::istreambuf_iterator<char>(c_m)), std::istreambuf_iterator<char>()) +
" " + getenv_with_default("CONFIG_PROTECT_MASK", "");
}
+ catch (const SafeIFStreamError &)
+ {
+ }
std::string final_config_protect(config_protect + " " + merge_config_protect);
@@ -827,13 +838,23 @@ VDBRepository::merge(const MergeParams & m)
/* load CONFIG_PROTECT, CONFIG_PROTECT_MASK from vdb */
std::string config_protect, config_protect_mask;
+ try
{
SafeIFStream c(tmp_vdb_dir / "CONFIG_PROTECT");
config_protect = std::string((std::istreambuf_iterator<char>(c)), std::istreambuf_iterator<char>());
+ }
+ catch (const SafeIFStreamError &)
+ {
+ }
+ try
+ {
SafeIFStream c_m(tmp_vdb_dir / "CONFIG_PROTECT_MASK");
config_protect_mask = std::string((std::istreambuf_iterator<char>(c_m)), std::istreambuf_iterator<char>());
}
+ catch (const SafeIFStreamError &)
+ {
+ }
FSEntry vdb_dir(_imp->params.location());
vdb_dir /= stringify(m.package_id()->name().category());