aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-29 21:15:14 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-29 21:15:14 +0000
commit3993ba5b86f8a68e9ea64723198e4a06cbc1d8ff (patch)
tree192e5002e566ccf7de2e16fdead77dd2418a057b
parent4a9ff7cee60549d181f28bee92b3bf7ab7775c2b (diff)
downloadpaludis-3993ba5b86f8a68e9ea64723198e4a06cbc1d8ff.tar.gz
paludis-3993ba5b86f8a68e9ea64723198e4a06cbc1d8ff.tar.xz
Enable updates by default
-rw-r--r--doc/faq/operation.html.part11
-rw-r--r--paludis/repositories/e/vdb_repository.cc167
2 files changed, 62 insertions, 116 deletions
diff --git a/doc/faq/operation.html.part b/doc/faq/operation.html.part
index 7cd6089..97cba1b 100644
--- a/doc/faq/operation.html.part
+++ b/doc/faq/operation.html.part
@@ -86,15 +86,8 @@ If it's an installed package, <em>spec</em> can usually just be the qualified pa
<p>Gentoo includes support for repositories specifying that a package has moved (e.g. <code>app-misc/foo</code> is now
called <code>app-admin/foo</code>) or changed slot (e.g. <code>app-misc/foo:0</code> is now
-<code>app-misc/foo:2</code>). Paludis has experimental support for performing these updates after a sync, but by default
-updates are not carried out.</p>
-
-<p><strong>Carrying out updates is not guaranteed to work. Before allowing Paludis to carry out updates, you should back
- up your VDB. If you don't know what this means, wait until updates have received wider testing. If you don't have a
- backup of your VDB and things do go wrong, you will have to do a full system reinstall to fix things.</strong></p>
-
-<p>If you fully understand the above paragraph, you can set the <code>PALUDIS_CARRY_OUT_UPDATES</code> environment
-variable to <code>yes</code> and then sync to perform updates.</p>
+<code>app-misc/foo:2</code>). These are known as 'profiles updates'. Paludis will perform profiles updates after a
+sync.</p>
<p>Sometimes it is possible for renames to cause collisions. For example, if <code>foo</code> is being renamed to
<code>bar</code>, and you have both <code>foo</code> and <code>bar</code> installed, Paludis will be unable to perform
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 777abe4..a3c92ad 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1268,14 +1268,9 @@ namespace
key->value()->root()->accept(v);
if (v.changed)
{
- 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;
+ std::cout << " Rewriting " << f << std::endl;
+ SafeOFStream ff(f);
+ ff << v.str.str() << std::endl;
}
return v.changed;
@@ -1434,125 +1429,90 @@ VDBRepository::perform_updates()
if (! moves.empty())
{
- if ("yes" == getenv_with_default("PALUDIS_CARRY_OUT_UPDATES", ""))
+ std::cout << std::endl << "Performing moves:" << std::endl;
+ for (Moves::const_iterator m(moves.begin()), m_end(moves.end()) ;
+ m != m_end ; ++m)
{
- std::cout << std::endl << "Performing moves:" << std::endl;
- for (Moves::const_iterator m(moves.begin()), m_end(moves.end()) ;
- m != m_end ; ++m)
- {
- std::cout << " " << *m->first << " to " << m->second << std::endl;
+ std::cout << " " << *m->first << " to " << m->second << std::endl;
- FSEntry target_cat_dir(_imp->params.location() / stringify(m->second.category()));
- target_cat_dir.mkdir();
+ FSEntry target_cat_dir(_imp->params.location() / stringify(m->second.category()));
+ target_cat_dir.mkdir();
- FSEntry from_dir(m->first->fs_location_key()->value());
- FSEntry to_dir(target_cat_dir / ((stringify(m->second.package()) + "-" + stringify(m->first->version()))));
+ FSEntry from_dir(m->first->fs_location_key()->value());
+ FSEntry to_dir(target_cat_dir / ((stringify(m->second.package()) + "-" + stringify(m->first->version()))));
- if (to_dir.exists())
+ if (to_dir.exists())
+ {
+ /* Uh oh. It's possible to install both a package and its renamed version. */
+ Log::get_instance()->message("e.vdb.updates.collision", ll_warning, lc_context) <<
+ "I wanted to rename '" << from_dir << "' to '" << to_dir << "' for a package move, but the "
+ "latter already exists. Consult the Paludis FAQ for how to proceed.";
+ failed = true;
+ }
+ else
+ {
+ std::string oldpf(stringify(m->first->name().package()) + "-" + stringify(m->first->version()));
+ std::string newpf(stringify(m->second.package()) + "-" + stringify(m->first->version()));
+
+ from_dir.rename(to_dir);
+
+ std::tr1::shared_ptr<const EAPI> eapi(std::tr1::static_pointer_cast<const VDBID>(m->first)->eapi());
+ if (eapi->supported())
{
- /* Uh oh. It's possible to install both a package and its renamed version. */
- Log::get_instance()->message("e.vdb.updates.collision", ll_warning, lc_context) <<
- "I wanted to rename '" << from_dir << "' to '" << to_dir << "' for a package move, but the "
- "latter already exists. Consult the Paludis FAQ for how to proceed.";
- failed = true;
+ SafeOFStream pf(to_dir / eapi->supported()->ebuild_environment_variables()->env_pf());
+ pf << newpf << std::endl;
}
else
{
- std::string oldpf(stringify(m->first->name().package()) + "-" + stringify(m->first->version()));
- std::string newpf(stringify(m->second.package()) + "-" + stringify(m->first->version()));
-
- from_dir.rename(to_dir);
-
- std::tr1::shared_ptr<const EAPI> eapi(std::tr1::static_pointer_cast<const VDBID>(m->first)->eapi());
- if (eapi->supported())
- {
- SafeOFStream pf(to_dir / eapi->supported()->ebuild_environment_variables()->env_pf());
- pf << newpf << std::endl;
- }
- else
- {
- Log::get_instance()->message("e.vdb.updates.eapi", ll_warning, lc_context)
- << "Unsupported EAPI '" << eapi->name() << "' for '" << *m->first
- << "', cannot update PF-equivalent VDB key for move";
- }
+ Log::get_instance()->message("e.vdb.updates.eapi", ll_warning, lc_context)
+ << "Unsupported EAPI '" << eapi->name() << "' for '" << *m->first
+ << "', cannot update PF-equivalent VDB key for move";
+ }
- SafeOFStream category(to_dir / "CATEGORY");
- category << m->second.category() << std::endl;
+ SafeOFStream category(to_dir / "CATEGORY");
+ category << m->second.category() << std::endl;
- if (newpf != oldpf)
+ if (newpf != oldpf)
+ {
+ for (DirIterator it(to_dir, DirIteratorOptions() + dio_inode_sort),
+ it_end; it_end != it; ++it)
{
- for (DirIterator it(to_dir, DirIteratorOptions() + dio_inode_sort),
- it_end; it_end != it; ++it)
- {
- std::string::size_type lastdot(it->basename().rfind('.'));
- if (std::string::npos != lastdot && 0 == it->basename().compare(0, lastdot, oldpf, 0, oldpf.length()))
- FSEntry(*it).rename(to_dir / (newpf + it->basename().substr(lastdot)));
- }
+ std::string::size_type lastdot(it->basename().rfind('.'));
+ if (std::string::npos != lastdot && 0 == it->basename().compare(0, lastdot, oldpf, 0, oldpf.length()))
+ FSEntry(*it).rename(to_dir / (newpf + it->basename().substr(lastdot)));
}
}
}
}
- else
- {
- std::cout << std::endl << "The following package moves need to be performed:" << std::endl;
- for (Moves::const_iterator m(moves.begin()), m_end(moves.end()) ;
- m != m_end ; ++m)
- std::cout << " " << *m->first << " to " << m->second << std::endl;
- std::cout << std::endl;
- }
}
if (! slot_moves.empty())
{
- if ("yes" == getenv_with_default("PALUDIS_CARRY_OUT_UPDATES", ""))
+ std::cout << std::endl << "Performing slot moves:" << std::endl;
+ for (SlotMoves::const_iterator m(slot_moves.begin()), m_end(slot_moves.end()) ;
+ m != m_end ; ++m)
{
- std::cout << std::endl << "Performing slot moves:" << std::endl;
- for (SlotMoves::const_iterator m(slot_moves.begin()), m_end(slot_moves.end()) ;
- m != m_end ; ++m)
- {
- std::cout << " " << *m->first << " to " << m->second << std::endl;
+ std::cout << " " << *m->first << " to " << m->second << std::endl;
- SafeOFStream f(m->first->fs_location_key()->value() / "SLOT");
- f << m->second << std::endl;
- }
- }
- else
- {
- std::cout << std::endl << "The following slot moves need to be performed:" << std::endl;
- for (SlotMoves::const_iterator m(slot_moves.begin()), m_end(slot_moves.end()) ;
- m != m_end ; ++m)
- std::cout << " " << *m->first << " to " << m->second << std::endl;
- std::cout << std::endl;
+ SafeOFStream f(m->first->fs_location_key()->value() / "SLOT");
+ f << m->second << std::endl;
}
}
if ((! moves.empty()) || (! slot_moves.empty()))
+ {
invalidate();
- if ("yes" != getenv_with_default("PALUDIS_CARRY_OUT_UPDATES", ""))
- {
- if ((! moves.empty()) || (! slot_moves.empty()))
- {
- std::cout << "Profile updates support is currently considered experimental. See the Paludis" << std::endl;
- std::cout << "FAQ for how to proceed." << std::endl;
- std::cout << std::endl;
- }
- }
- else
- {
- if ((! moves.empty()) || (! slot_moves.empty()))
- {
- if (_imp->params.provides_cache() != FSEntry("/var/empty"))
- if (_imp->params.provides_cache().is_regular_file_or_symlink_to_regular_file())
- {
- std::cout << std::endl << "Invalidating provides cache following updates" << std::endl;
- FSEntry(_imp->params.provides_cache()).unlink();
- regenerate_provides_cache();
- }
+ if (_imp->params.provides_cache() != FSEntry("/var/empty"))
+ if (_imp->params.provides_cache().is_regular_file_or_symlink_to_regular_file())
+ {
+ std::cout << std::endl << "Invalidating provides cache following updates" << std::endl;
+ FSEntry(_imp->params.provides_cache()).unlink();
+ regenerate_provides_cache();
+ }
- std::cout << std::endl << "Invalidating names cache following updates" << std::endl;
- _imp->names_cache->regenerate_cache();
- }
+ std::cout << std::endl << "Invalidating names cache following updates" << std::endl;
+ _imp->names_cache->regenerate_cache();
}
if (! dep_rewrites.empty())
@@ -1578,16 +1538,9 @@ VDBRepository::perform_updates()
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->suggested_dependencies_key()->raw_name(),
(*i)->suggested_dependencies_key(), dep_rewrites);
}
-
- if ((rewrite_done) && ("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;
- }
}
- if ((! failed) && ("yes" == getenv_with_default("PALUDIS_CARRY_OUT_UPDATES", "")))
+ if (! failed)
{
cache_dir.mkdir();
SafeOFStream cache_file_f(cache_file);