aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-15 13:14:23 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-15 13:14:23 +0100
commit503a820e92affef4ec1865679cdc904ac4f7db5c (patch)
tree5f3d29f6d87d0112e8ddfcfd43a81c17d983c73f
parent352b3fb8a500c75d619951750d89cddd9d5a6d4e (diff)
downloadpaludis-503a820e92affef4ec1865679cdc904ac4f7db5c.tar.gz
paludis-503a820e92affef4ec1865679cdc904ac4f7db5c.tar.xz
Control over dep rewrites too
-rw-r--r--paludis/repositories/e/vdb_repository.cc34
1 files changed, 24 insertions, 10 deletions
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 317b7fa..315f29e 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1246,7 +1246,7 @@ namespace
}
};
- void rewrite_dependencies(
+ bool rewrite_dependencies(
const FSEntry & f,
const std::tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > & key,
const DepRewrites & rewrites)
@@ -1255,10 +1255,17 @@ namespace
key->value()->root()->accept(v);
if (v.changed)
{
- std::cout << " Rewriting " << f << std::endl;
- SafeOFStream ff(f);
- ff << v.str.str() << std::endl;
+ if ("yes" == getenv_with_default("PALUDIS_CARRY_OUT_UPDATES", ""))
+ {
+ std::cout << " Rewriting " << f << std::endl;
+ SafeOFStream ff(f);
+ ff << v.str.str() << std::endl;
+ }
+ else
+ std::cout << " Would rewrite " << f << std::endl;
}
+
+ return v.changed;
}
}
@@ -1392,8 +1399,7 @@ VDBRepository::perform_updates()
try
{
- if ((! moves.empty()) || (! slot_moves.empty()))
- std::cout << std::endl;
+ std::cout << std::endl;
if (! moves.empty())
{
@@ -1476,24 +1482,32 @@ VDBRepository::perform_updates()
{
std::cout << "Updating installed package dependencies" << std::endl;
+ bool rewrite_done(false);
const std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->params.environment())[selection::AllVersionsSorted(
generator::InRepository(name()))]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
if ((*i)->build_dependencies_key())
- rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->build_dependencies_key()->raw_name(),
+ rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->build_dependencies_key()->raw_name(),
(*i)->build_dependencies_key(), dep_rewrites);
if ((*i)->run_dependencies_key())
- rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->run_dependencies_key()->raw_name(),
+ rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->run_dependencies_key()->raw_name(),
(*i)->run_dependencies_key(), dep_rewrites);
if ((*i)->post_dependencies_key())
- rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->post_dependencies_key()->raw_name(),
+ rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->post_dependencies_key()->raw_name(),
(*i)->post_dependencies_key(), dep_rewrites);
if ((*i)->suggested_dependencies_key())
- rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->suggested_dependencies_key()->raw_name(),
+ rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->suggested_dependencies_key()->raw_name(),
(*i)->suggested_dependencies_key(), dep_rewrites);
}
+
+ if ("yes" != getenv_with_default("PALUDIS_CARRY_OUT_UPDATES", ""))
+ {
+ std::cout << "Some installed packages have dependencies that need rewriting for package" << std::endl;
+ std::cout << "moves. See the Paludis FAQ for how to proceed." << std::endl;
+ std::cout << std::endl;
+ }
}
}
catch (const Exception & e)