aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-26 15:38:13 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-28 10:11:25 +0100
commitd03893141379f242baf6ccbe0e934ebabd1ce626 (patch)
tree62d41a98a0a3bc5aa77d5cc63e15c1102c4fbdee
parent164f1c1f44aedebad33225803bfd56701d1eb82f (diff)
downloadpaludis-d03893141379f242baf6ccbe0e934ebabd1ce626.tar.gz
paludis-d03893141379f242baf6ccbe0e934ebabd1ce626.tar.xz
Merger -> FSMerger
-rw-r--r--.gitignore2
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/fs_merger-fwd.hh (renamed from paludis/merger-fwd.hh)23
-rw-r--r--paludis/fs_merger.cc (renamed from paludis/merger.cc)176
-rw-r--r--paludis/fs_merger.hh (renamed from paludis/merger.hh)57
-rw-r--r--paludis/fs_merger.se (renamed from paludis/merger.se)7
-rw-r--r--paludis/fs_merger_TEST.cc (renamed from paludis/merger_TEST.cc)54
-rwxr-xr-xpaludis/fs_merger_TEST_cleanup.sh (renamed from paludis/merger_TEST_cleanup.sh)4
-rwxr-xr-xpaludis/fs_merger_TEST_setup.sh (renamed from paludis/merger_TEST_setup.sh)4
-rw-r--r--paludis/ndbam_merger.cc28
-rw-r--r--paludis/ndbam_merger.hh16
-rw-r--r--paludis/repositories/accounts/accounts_id.cc2
-rw-r--r--paludis/repositories/e/e_repository.cc2
-rw-r--r--paludis/repositories/e/eapi-fwd.hh4
-rw-r--r--paludis/repositories/e/eapi.cc4
-rw-r--r--paludis/repositories/e/eapi.hh4
-rw-r--r--paludis/repositories/e/ebuild.hh4
-rw-r--r--paludis/repositories/e/vdb_merger.cc44
-rw-r--r--paludis/repositories/e/vdb_merger.hh16
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc16
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc4
-rw-r--r--paludis/repository.hh4
23 files changed, 244 insertions, 235 deletions
diff --git a/.gitignore b/.gitignore
index 7142b13..c96e68d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -248,12 +248,12 @@ paludis-*.*.*.tar.bz2
/paludis/fetchers/dohttps
/paludis/filter_TEST
/paludis/filtered_generator_TEST
+/paludis/fs_merger_TEST
/paludis/fuzzy_finder_TEST
/paludis/generator_TEST
/paludis/hooker_TEST
/paludis/host_tuple_name_TEST
/paludis/ihateautomake.cc
-/paludis/merger_TEST
/paludis/name_TEST
/paludis/package_database_TEST
/paludis/paludis.hh
diff --git a/paludis/files.m4 b/paludis/files.m4
index 9be4205..452897a 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -48,6 +48,7 @@ add(`find_unused_packages_task', `hh', `cc')
add(`format_messages_output_manager', `hh', `fwd', `cc')
add(`formatter', `hh', `fwd', `cc')
add(`forward_at_finish_output_manager', `hh', `fwd', `cc')
+add(`fs_merger', `hh', `cc', `fwd', `se', `test', `testscript')
add(`fuzzy_finder', `hh', `cc', `test')
add(`generator', `hh', `cc', `fwd', `test')
add(`generator_handler', `hh', `cc', `fwd')
@@ -61,7 +62,6 @@ add(`linkage_checker', `hh', `cc')
add(`literal_metadata_key', `hh', `cc')
add(`mask', `hh', `cc', `fwd', `se')
add(`match_package', `hh', `cc', `se', `fwd')
-add(`merger', `hh', `cc', `fwd', `se', `test', `testscript')
add(`merger_entry_type', `hh', `cc', `se')
add(`metadata_key', `hh', `cc', `se', `fwd')
add(`metadata_key_holder', `hh', `cc', `fwd')
diff --git a/paludis/merger-fwd.hh b/paludis/fs_merger-fwd.hh
index eead16f..2ccead7 100644
--- a/paludis/merger-fwd.hh
+++ b/paludis/fs_merger-fwd.hh
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_MERGER_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_MERGER_FWD_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_FS_MERGER_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_FS_MERGER_FWD_HH 1
#include <iosfwd>
#include <paludis/util/attributes.hh>
@@ -28,34 +28,37 @@
#include <functional>
/** \file
- * Forward declarations for paludis/merger.hh .
+ * Forward declarations for paludis/fs_merger.hh .
*
* \ingroup g_repository
+ * \since 0.51
*/
namespace paludis
{
-#include <paludis/merger-se.hh>
+#include <paludis/fs_merger-se.hh>
/**
- * Boolean options for Merger.
+ * Boolean options for FSMerger.
*
* \ingroup g_repository
* \since 0.26
+ * \since 0.51 called FSMergerOptions instead of MergerOptions
*/
- typedef Options<MergerOption> MergerOptions;
+ typedef Options<FSMergerOption> FSMergerOptions;
/**
* Status flags for Merger.
*
* \ingroup g_repository
* \since 0.26
+ * \since 0.51 called FSMergerStatusFlags instead of MergeStatusFlags
*/
- typedef Options<MergeStatusFlag> MergeStatusFlags;
+ typedef Options<FSMergerStatusFlag> FSMergerStatusFlags;
- class MergerParams;
- class MergerError;
- class Merger;
+ class FSMergerParams;
+ class FSMergerError;
+ class FSMerger;
}
#endif
diff --git a/paludis/merger.cc b/paludis/fs_merger.cc
index 431746d..f3cde6c 100644
--- a/paludis/merger.cc
+++ b/paludis/fs_merger.cc
@@ -18,7 +18,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/merger.hh>
+#include <paludis/fs_merger.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/fd_holder.hh>
@@ -49,22 +49,22 @@
using namespace paludis;
-#include <paludis/merger-se.cc>
+#include <paludis/fs_merger-se.cc>
typedef std::unordered_map<std::pair<dev_t, ino_t>, std::string, Hash<std::pair<dev_t, ino_t> > > MergedMap;
namespace paludis
{
template <>
- struct Imp<Merger>
+ struct Imp<FSMerger>
{
std::set<FSEntry> fixed_entries;
MergedMap merged_ids;
- MergerParams params;
+ FSMergerParams params;
bool result;
bool skip_dir;
- Imp(const MergerParams & p) :
+ Imp(const FSMergerParams & p) :
params(p),
result(true),
skip_dir(false)
@@ -73,22 +73,22 @@ namespace paludis
};
}
-MergerError::MergerError(const std::string & s) throw () :
+FSMergerError::FSMergerError(const std::string & s) throw () :
Exception(s)
{
}
-Merger::Merger(const MergerParams & p) :
- Pimp<Merger>(p)
+FSMerger::FSMerger(const FSMergerParams & p) :
+ Pimp<FSMerger>(p)
{
}
-Merger::~Merger()
+FSMerger::~FSMerger()
{
}
bool
-Merger::check()
+FSMerger::check()
{
Context context("When checking merge from '" + stringify(_imp->params.image()) + "' to '"
+ stringify(_imp->params.root()) + "':");
@@ -111,13 +111,13 @@ Merger::check()
}
void
-Merger::make_check_fail()
+FSMerger::make_check_fail()
{
_imp->result = false;
}
void
-Merger::merge()
+FSMerger::merge()
{
Context context("When performing merge from '" + stringify(_imp->params.image()) + "' to '"
+ stringify(_imp->params.root()) + "':");
@@ -157,10 +157,10 @@ Merger::merge()
if (! d->exists())
{
d->mkdir();
- track_install_under_dir(*d, MergeStatusFlags());
+ track_install_under_dir(*d, FSMergerStatusFlags());
}
else
- track_install_under_dir(*d, MergeStatusFlags() + msi_used_existing);
+ track_install_under_dir(*d, FSMergerStatusFlags() + msi_used_existing);
}
if (! _imp->params.no_chown())
@@ -177,7 +177,7 @@ Merger::merge()
}
EntryType
-Merger::entry_type(const FSEntry & f)
+FSMerger::entry_type(const FSEntry & f)
{
Context context("When checking type of '" + stringify(f) + "':");
@@ -197,15 +197,15 @@ Merger::entry_type(const FSEntry & f)
}
void
-Merger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst)
{
Context context("When " + stringify(is_check ? "checking" : "performing") + " merge from '" +
stringify(src) + "' to '" + stringify(dst) + "':");
if (! src.is_directory())
- throw MergerError("Source directory '" + stringify(src) + "' is not a directory");
+ throw FSMergerError("Source directory '" + stringify(src) + "' is not a directory");
if ((! is_check) && (! dst.is_directory()))
- throw MergerError("Destination directory '" + stringify(dst) + "' is not a directory");
+ throw FSMergerError("Destination directory '" + stringify(dst) + "' is not a directory");
on_enter_dir(is_check, src);
@@ -261,7 +261,7 @@ Merger::do_dir_recursive(bool is_check, const FSEntry & src, const FSEntry & dst
}
void
-Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
{
Context context("When handling file '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -333,7 +333,7 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
{
Context context("When handling dir '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -407,7 +407,7 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
{
Context context("When handling sym '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -484,7 +484,7 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
{
Context context("When handling misc '" + stringify(src) + "' to '" + stringify(dst) + "':");
@@ -493,17 +493,17 @@ Merger::on_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_enter_dir(bool, const FSEntry)
+FSMerger::on_enter_dir(bool, const FSEntry)
{
}
void
-Merger::on_leave_dir(bool, const FSEntry)
+FSMerger::on_leave_dir(bool, const FSEntry)
{
}
void
-Merger::on_file_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -512,7 +512,7 @@ Merger::on_file_over_nothing(bool is_check, const FSEntry & src, const FSEntry &
}
void
-Merger::on_file_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -527,14 +527,14 @@ Merger::on_file_over_file(bool is_check, const FSEntry & src, const FSEntry & ds
}
void
-Merger::on_file_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
{
on_error(is_check, "Cannot overwrite directory '" + stringify(dst / src.basename()) + "' with file '"
+ stringify(src) + "'");
}
void
-Merger::on_file_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -543,7 +543,7 @@ Merger::on_file_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst
}
void
-Merger::on_file_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_file_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -552,7 +552,7 @@ Merger::on_file_over_misc(bool is_check, const FSEntry & src, const FSEntry & ds
}
void
-Merger::on_dir_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -561,23 +561,23 @@ Merger::on_dir_over_nothing(bool is_check, const FSEntry & src, const FSEntry &
}
void
-Merger::on_dir_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
{
on_error(is_check, "Cannot overwrite file '" + stringify(dst / src.basename()) + "' with directory '"
+ stringify(src) + "'");
}
void
-Merger::on_dir_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
- track_install_dir(src, dst, MergeStatusFlags() + msi_used_existing);
+ track_install_dir(src, dst, FSMergerStatusFlags() + msi_used_existing);
}
void
-Merger::on_dir_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
{
EntryType m;
try
@@ -594,7 +594,7 @@ Merger::on_dir_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
on_warn(is_check, "Expected '" + stringify(dst / src.basename()) +
"' to be a directory but found a symlink to a directory");
if (! is_check)
- track_install_dir(src, dst, MergeStatusFlags() + msi_used_existing);
+ track_install_dir(src, dst, FSMergerStatusFlags() + msi_used_existing);
}
else
on_error(is_check, "Expected '" + stringify(dst / src.basename()) +
@@ -602,7 +602,7 @@ Merger::on_dir_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_dir_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_dir_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -612,7 +612,7 @@ Merger::on_dir_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst
}
void
-Merger::on_sym_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_nothing(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -621,7 +621,7 @@ Merger::on_sym_over_nothing(bool is_check, const FSEntry & src, const FSEntry &
}
void
-Merger::on_sym_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_file(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -631,14 +631,14 @@ Merger::on_sym_over_file(bool is_check, const FSEntry & src, const FSEntry & dst
}
void
-Merger::on_sym_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
{
on_error(is_check, "Cannot overwrite directory '" + stringify(dst / src.basename()) + "' with symlink '"
+ stringify(src) + "'");
}
void
-Merger::on_sym_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -648,7 +648,7 @@ Merger::on_sym_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-Merger::on_sym_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
+FSMerger::on_sym_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check)
return;
@@ -658,7 +658,7 @@ Merger::on_sym_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst
}
void
-Merger::do_ownership_fixes_recursive(const FSEntry & dir)
+FSMerger::do_ownership_fixes_recursive(const FSEntry & dir)
{
for (DirIterator d(dir, { dio_include_dotfiles, dio_inode_sort }), d_end ; d != d_end ; ++d)
{
@@ -698,7 +698,7 @@ Merger::do_ownership_fixes_recursive(const FSEntry & dir)
continue;
case et_misc:
- throw MergerError("Unexpected 'et_misc' entry found at: " + stringify(*d));
+ throw FSMergerError("Unexpected 'et_misc' entry found at: " + stringify(*d));
continue;
case et_nothing:
@@ -710,12 +710,12 @@ Merger::do_ownership_fixes_recursive(const FSEntry & dir)
}
}
-MergeStatusFlags
-Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name)
+FSMergerStatusFlags
+FSMerger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name)
{
Context context("When installing file '" + stringify(src) + "' to '" + stringify(dst_dir) + "' with protection '"
+ stringify(dst_name) + "':");
- MergeStatusFlags result;
+ FSMergerStatusFlags result;
FSEntry dst(dst_dir / (stringify(dst_name) + "|paludis-midmerge"));
FSEntry dst_real(dst_dir / dst_name);
@@ -734,7 +734,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
std::shared_ptr<const SecurityContext> secctx(MatchPathCon::get_instance()->match(stringify(dst_real), src.permissions()));
FSCreateCon createcon(secctx);
if (0 != paludis::setfilecon(src, secctx))
- throw MergerError("Could not set SELinux context on '"
+ throw FSMergerError("Could not set SELinux context on '"
+ stringify(src) + "': " + stringify(::strerror(errno)));
mode_t src_perms(src.permissions());
@@ -764,7 +764,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
else
ok = d.utime(Timestamp::now());
if (! ok)
- throw MergerError("utime(" + stringify(dst_real) + ", 0) failed: " + stringify(::strerror(errno)));
+ throw FSMergerError("utime(" + stringify(dst_real) + ", 0) failed: " + stringify(::strerror(errno)));
}
/* set*id bits get partially clobbered on a rename on linux */
@@ -780,7 +780,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
if (0 == ::link(i->second.c_str(), stringify(dst).c_str()))
{
if (0 != std::rename(stringify(dst).c_str(), stringify(dst_real).c_str()))
- throw MergerError("rename(" + stringify(dst) + ", " + stringify(dst_real) + ") failed: " + stringify(::strerror(errno)));
+ throw FSMergerError("rename(" + stringify(dst) + ", " + stringify(dst_real) + ") failed: " + stringify(::strerror(errno)));
do_copy = false;
result += msi_as_hardlink;
break;
@@ -798,28 +798,28 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
FDHolder input_fd(::open(stringify(src).c_str(), O_RDONLY), false);
if (-1 == input_fd)
- throw MergerError("Cannot read '" + stringify(src) + "': " + stringify(::strerror(errno)));
+ throw FSMergerError("Cannot read '" + stringify(src) + "': " + stringify(::strerror(errno)));
FDHolder output_fd(::open(stringify(dst).c_str(), O_WRONLY | O_CREAT, src_perms), false);
if (-1 == output_fd)
- throw MergerError("Cannot write '" + stringify(dst) + "': " + stringify(::strerror(errno)));
+ throw FSMergerError("Cannot write '" + stringify(dst) + "': " + stringify(::strerror(errno)));
if (! _imp->params.no_chown())
if (0 != ::fchown(output_fd, src.owner(), src.group()))
- throw MergerError("Cannot fchown '" + stringify(dst) + "': " + stringify(::strerror(errno)));
+ throw FSMergerError("Cannot fchown '" + stringify(dst) + "': " + stringify(::strerror(errno)));
/* set*id bits */
if (0 != ::fchmod(output_fd, src_perms))
- throw MergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno)));
+ throw FSMergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno)));
try_to_copy_xattrs(src, output_fd, result);
char buf[4096];
ssize_t count;
while ((count = read(input_fd, buf, 4096)) > 0)
if (-1 == write(output_fd, buf, count))
- throw MergerError("write failed: " + stringify(::strerror(errno)));
+ throw FSMergerError("write failed: " + stringify(::strerror(errno)));
if (-1 == count)
- throw MergerError("read failed: " + stringify(::strerror(errno)));
+ throw FSMergerError("read failed: " + stringify(::strerror(errno)));
/* might need to copy mtime */
if (_imp->params.options()[mo_preserve_mtimes])
@@ -831,11 +831,11 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
struct timespec ts[2];
ts[0] = ts[1] = timestamp.as_timespec();
if (0 != ::futimens(output_fd, ts))
- throw MergerError("Cannot futimens '" + stringify(dst) + "': " + stringify(::strerror(errno)));
+ throw FSMergerError("Cannot futimens '" + stringify(dst) + "': " + stringify(::strerror(errno)));
}
if (0 != std::rename(stringify(dst).c_str(), stringify(dst_real).c_str()))
- throw MergerError(
+ throw FSMergerError(
"rename(" + stringify(dst) + ", " + stringify(dst_real) + ") failed: " + stringify(::strerror(errno)));
_imp->merged_ids.insert(make_pair(src.lowlevel_id(), stringify(dst_real)));
@@ -856,7 +856,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
}
bool
-Merger::symlink_needs_rewriting(const FSEntry & sym)
+FSMerger::symlink_needs_rewriting(const FSEntry & sym)
{
std::string target(sym.readlink());
std::string real_image(stringify(_imp->params.image().realpath()));
@@ -865,7 +865,7 @@ Merger::symlink_needs_rewriting(const FSEntry & sym)
}
void
-Merger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
+FSMerger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
{
if (! symlink_needs_rewriting(src))
return;
@@ -885,11 +885,11 @@ Merger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
}
void
-Merger::track_renamed_dir_recursive(const FSEntry & dst)
+FSMerger::track_renamed_dir_recursive(const FSEntry & dst)
{
for (DirIterator d(dst, { dio_include_dotfiles, dio_inode_sort }), d_end ; d != d_end ; ++d)
{
- MergeStatusFlags merged_how;
+ FSMergerStatusFlags merged_how;
if (_imp->fixed_entries.end() != _imp->fixed_entries.find(_imp->params.image() / *d))
merged_how += msi_fixed_ownership;
EntryType m(entry_type(*d));
@@ -917,7 +917,7 @@ Merger::track_renamed_dir_recursive(const FSEntry & dst)
else
ok = FSEntry(*d).utime(Timestamp::now());
if (! ok)
- throw MergerError("utime(" + stringify(*d) + ", 0) failed: " + stringify(::strerror(errno)));
+ throw FSMergerError("utime(" + stringify(*d) + ", 0) failed: " + stringify(::strerror(errno)));
}
track_install_file(*d, dst, stringify(d->basename()), merged_how + msi_parent_rename);
}
@@ -929,7 +929,7 @@ Merger::track_renamed_dir_recursive(const FSEntry & dst)
continue;
case et_misc:
- throw MergerError("Unexpected 'et_misc' entry found at: " + stringify(*d));
+ throw FSMergerError("Unexpected 'et_misc' entry found at: " + stringify(*d));
continue;
case et_nothing:
@@ -942,7 +942,7 @@ Merger::track_renamed_dir_recursive(const FSEntry & dst)
}
void
-Merger::relabel_dir_recursive(const FSEntry & src, const FSEntry & dst)
+FSMerger::relabel_dir_recursive(const FSEntry & src, const FSEntry & dst)
{
for (DirIterator d(src, { dio_include_dotfiles, dio_inode_sort }), d_end ; d != d_end ; ++d)
{
@@ -950,19 +950,19 @@ Merger::relabel_dir_recursive(const FSEntry & src, const FSEntry & dst)
std::shared_ptr<const SecurityContext> secctx(
MatchPathCon::get_instance()->match(stringify(dst / d->basename()), mode));
if (0 != paludis::setfilecon(*d, secctx))
- throw MergerError("Could not set SELinux context on '"
+ throw FSMergerError("Could not set SELinux context on '"
+ stringify(*d) + "' : " + stringify(::strerror(errno)));
if (d->is_directory())
relabel_dir_recursive(*d, dst / d->basename());
}
}
-MergeStatusFlags
-Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
+FSMergerStatusFlags
+FSMerger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
{
Context context("When installing dir '" + stringify(src) + "' to '" + stringify(dst_dir) + "':");
- MergeStatusFlags result;
+ FSMergerStatusFlags result;
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_install_dir_pre")
@@ -979,7 +979,7 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
std::shared_ptr<const SecurityContext> secctx(MatchPathCon::get_instance()->match(stringify(dst), mode));
FSCreateCon createcon(secctx);
if (0 != paludis::setfilecon(src, secctx))
- throw MergerError("Could not set SELinux context on '"
+ throw FSMergerError("Could not set SELinux context on '"
+ stringify(src) + "': " + stringify(::strerror(errno)));
if (is_selinux_enabled())
@@ -1001,16 +1001,16 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
FDHolder dst_fd(::open(stringify(dst).c_str(), O_RDONLY));
struct stat sb;
if (-1 == dst_fd)
- throw MergerError("Could not get an FD for the directory '"
+ throw FSMergerError("Could not get an FD for the directory '"
+ stringify(dst) + "' that we just created: " + stringify(::strerror(errno)));
if (-1 == ::fstat(dst_fd, &sb))
- throw MergerError("Could not fstat the directory '"
+ throw FSMergerError("Could not fstat the directory '"
+ stringify(dst) + "' that we just created: " + stringify(::strerror(errno)));
if ( !S_ISDIR(sb.st_mode))
- throw MergerError("The directory that we just created is not a directory anymore");
+ throw FSMergerError("The directory that we just created is not a directory anymore");
if (! _imp->params.no_chown())
if (-1 == ::fchown(dst_fd, src.owner(), src.group()))
- throw MergerError("Could not fchown the directory '" + stringify(dst) + "' that we just created: "
+ throw FSMergerError("Could not fchown the directory '" + stringify(dst) + "' that we just created: "
+ stringify(::strerror(errno)));
/* pick up set*id bits */
::fchmod(dst_fd, mode);
@@ -1030,12 +1030,12 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
return result;
}
-MergeStatusFlags
-Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
+FSMergerStatusFlags
+FSMerger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
{
Context context("When installing sym '" + stringify(src) + "' to '" + stringify(dst_dir) + "':");
- MergeStatusFlags result;
+ FSMergerStatusFlags result;
FSEntry dst(dst_dir / src.basename());
@@ -1077,7 +1077,7 @@ Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
{
FSCreateCon createcon(MatchPathCon::get_instance()->match(stringify(dst), S_IFLNK));
if (0 != ::symlink(stringify(src.readlink()).c_str(), stringify(dst).c_str()))
- throw MergerError("Couldn't create symlink at '" + stringify(dst) + "': "
+ throw FSMergerError("Couldn't create symlink at '" + stringify(dst) + "': "
+ stringify(::strerror(errno)));
_imp->merged_ids.insert(make_pair(src.lowlevel_id(), stringify(dst)));
}
@@ -1100,7 +1100,7 @@ Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
}
void
-Merger::unlink_file(FSEntry d)
+FSMerger::unlink_file(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_file_pre")
@@ -1119,7 +1119,7 @@ Merger::unlink_file(FSEntry d)
}
void
-Merger::unlink_sym(FSEntry d)
+FSMerger::unlink_sym(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_sym_pre")
@@ -1137,7 +1137,7 @@ Merger::unlink_sym(FSEntry d)
}
void
-Merger::unlink_dir(FSEntry d)
+FSMerger::unlink_dir(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_dir_pre")
@@ -1155,7 +1155,7 @@ Merger::unlink_dir(FSEntry d)
}
void
-Merger::unlink_misc(FSEntry d)
+FSMerger::unlink_misc(FSEntry d)
{
if (0 != _imp->params.environment()->perform_hook(extend_hook(
Hook("merger_unlink_misc_pre")
@@ -1173,7 +1173,7 @@ Merger::unlink_misc(FSEntry d)
}
Hook
-Merger::extend_hook(const Hook & h)
+FSMerger::extend_hook(const Hook & h)
{
return h
("ROOT", stringify(_imp->params.root()))
@@ -1183,7 +1183,7 @@ Merger::extend_hook(const Hook & h)
#ifdef HAVE_XATTRS
void
-Merger::try_to_copy_xattrs(const FSEntry & src, int dst_fd, MergeStatusFlags & flags)
+FSMerger::try_to_copy_xattrs(const FSEntry & src, int dst_fd, FSMergerStatusFlags & flags)
{
FDHolder src_fd(::open(stringify(src).c_str(), O_RDONLY));
@@ -1261,35 +1261,35 @@ Merger::try_to_copy_xattrs(const FSEntry & src, int dst_fd, MergeStatusFlags & f
#else
void
-Merger::try_to_copy_xattrs(const FSEntry &, int, MergeStatusFlags &)
+FSMerger::try_to_copy_xattrs(const FSEntry &, int, FSMergerStatusFlags &)
{
}
#endif
void
-Merger::track_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const MergeStatusFlags & flags)
+FSMerger::track_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst_dir / dst_name);
record_install_file(src, dst_dir, dst_name, flags);
}
void
-Merger::track_install_dir(const FSEntry & src, const FSEntry & dst_dir, const MergeStatusFlags & flags)
+FSMerger::track_install_dir(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst_dir / src.basename());
record_install_dir(src, dst_dir, flags);
}
void
-Merger::track_install_under_dir(const FSEntry & dst, const MergeStatusFlags & flags)
+FSMerger::track_install_under_dir(const FSEntry & dst, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst);
record_install_under_dir(dst, flags);
}
void
-Merger::track_install_sym(const FSEntry & src, const FSEntry & dst_dir, const MergeStatusFlags & flags)
+FSMerger::track_install_sym(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
_imp->params.merged_entries()->insert(dst_dir / src.basename());
record_install_sym(src, dst_dir, flags);
diff --git a/paludis/merger.hh b/paludis/fs_merger.hh
index a0015fe..e17fb3f 100644
--- a/paludis/merger.hh
+++ b/paludis/fs_merger.hh
@@ -17,10 +17,10 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_MERGER_HH
-#define PALUDIS_GUARD_PALUDIS_MERGER_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_FS_MERGER_HH
+#define PALUDIS_GUARD_PALUDIS_FS_MERGER_HH 1
-#include <paludis/merger-fwd.hh>
+#include <paludis/fs_merger-fwd.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/options.hh>
@@ -32,7 +32,7 @@
#include <sys/types.h>
/** \file
- * Declarations for the Merger class, which can be used by Repository
+ * Declarations for the FSMerger class, which can be used by Repository
* implementations to perform to-filesystem merging.
*
* \ingroup g_repository
@@ -61,14 +61,15 @@ namespace paludis
}
/**
- * Parameters for a basic Merger.
+ * Parameters for a basic FSMerger.
*
* \see Merger
* \ingroup g_repository
* \nosubgrouping
* \since 0.30
+ * \since 0.51 called FSMergerParams instead of MergerParams
*/
- struct MergerParams
+ struct FSMergerParams
{
NamedValue<n::environment, Environment *> environment;
@@ -92,25 +93,25 @@ namespace paludis
NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
NamedValue<n::no_chown, bool> no_chown;
- NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::options, FSMergerOptions> options;
NamedValue<n::root, FSEntry> root;
};
/**
- * Thrown if an error occurs during a Merger operation.
+ * Thrown if an error occurs during an FSMerger operation.
*
* \ingroup g_repository
* \ingroup g_exceptions
* \nosubgrouping
*/
- class PALUDIS_VISIBLE MergerError :
+ class PALUDIS_VISIBLE FSMergerError :
public Exception
{
public:
///\name Basic operations
///\{
- MergerError(const std::string & msg) throw ();
+ FSMergerError(const std::string & msg) throw ();
///\}
};
@@ -121,15 +122,16 @@ namespace paludis
* \ingroup g_exceptions
* \ingroup g_repository
* \nosubgrouping
+ * \since 0.51 called FSMerger instead of Merger
*/
- class PALUDIS_VISIBLE Merger :
- private Pimp<Merger>
+ class PALUDIS_VISIBLE FSMerger :
+ private Pimp<FSMerger>
{
private:
void track_renamed_dir_recursive(const FSEntry &);
void relabel_dir_recursive(const FSEntry &, const FSEntry &);
void rewrite_symlink_as_needed(const FSEntry &, const FSEntry &);
- void try_to_copy_xattrs(const FSEntry &, int, MergeStatusFlags &);
+ void try_to_copy_xattrs(const FSEntry &, int, FSMergerStatusFlags &);
bool symlink_needs_rewriting(const FSEntry &);
void do_ownership_fixes_recursive(const FSEntry &);
@@ -137,7 +139,7 @@ namespace paludis
///\name Basic operations
///\{
- Merger(const MergerParams &);
+ FSMerger(const FSMergerParams &);
///\}
@@ -174,10 +176,10 @@ namespace paludis
///\name Track and record merges
///\{
- void track_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &);
- void track_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &);
- void track_install_under_dir(const FSEntry &, const MergeStatusFlags &);
- void track_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &);
+ void track_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &);
+ void track_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
+ void track_install_under_dir(const FSEntry &, const FSMergerStatusFlags &);
+ void track_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
///\}
@@ -191,9 +193,9 @@ namespace paludis
virtual void on_file_over_sym(bool is_check, const FSEntry &, const FSEntry &);
virtual void on_file_over_misc(bool is_check, const FSEntry &, const FSEntry &);
- virtual MergeStatusFlags install_file(const FSEntry &, const FSEntry &, const std::string &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSMergerStatusFlags install_file(const FSEntry &, const FSEntry &, const std::string &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void unlink_file(FSEntry);
- virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &) = 0;
+ virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &) = 0;
virtual void on_dir(bool is_check, const FSEntry &, const FSEntry &);
virtual void on_dir_over_nothing(bool is_check, const FSEntry &, const FSEntry &);
@@ -202,10 +204,10 @@ namespace paludis
virtual void on_dir_over_sym(bool is_check, const FSEntry &, const FSEntry &);
virtual void on_dir_over_misc(bool is_check, const FSEntry &, const FSEntry &);
- virtual MergeStatusFlags install_dir(const FSEntry &, const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSMergerStatusFlags install_dir(const FSEntry &, const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void unlink_dir(FSEntry);
- virtual void record_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &) = 0;
- virtual void record_install_under_dir(const FSEntry &, const MergeStatusFlags &) = 0;
+ virtual void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &) = 0;
+ virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &) = 0;
virtual void on_sym(bool is_check, const FSEntry &, const FSEntry &);
virtual void on_sym_over_nothing(bool is_check, const FSEntry &, const FSEntry &);
@@ -214,9 +216,9 @@ namespace paludis
virtual void on_sym_over_sym(bool is_check, const FSEntry &, const FSEntry &);
virtual void on_sym_over_misc(bool is_check, const FSEntry &, const FSEntry &);
- virtual MergeStatusFlags install_sym(const FSEntry &, const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSMergerStatusFlags install_sym(const FSEntry &, const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void unlink_sym(FSEntry);
- virtual void record_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &) = 0;
+ virtual void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &) = 0;
virtual void unlink_misc(FSEntry);
virtual void on_misc(bool is_check, const FSEntry &, const FSEntry &);
@@ -247,7 +249,10 @@ namespace paludis
///\name Basic operations
///\{
- virtual ~Merger();
+ virtual ~FSMerger();
+
+ FSMerger(const FSMerger &) = delete;
+ FSMerger & operator= (const FSMerger &) = delete;
///\}
diff --git a/paludis/merger.se b/paludis/fs_merger.se
index f4fb6df..75088b5 100644
--- a/paludis/merger.se
+++ b/paludis/fs_merger.se
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et ft=sh :
-make_enum_MergeStatusFlag()
+make_enum_FSMergerStatusFlag()
{
prefix msi
@@ -16,15 +16,16 @@ make_enum_MergeStatusFlag()
doxygen_comment << "END"
/**
- * Status flags for Merger, used by MergeStatusFlags
+ * Status flags for FSMerger, used by FSMergerStatusFlags
*
* \ingroup g_repository
* \since 0.26
+ * \since 0.51 called FSMergerStatusFlag instead of MergeStatusFlag
*/
END
}
-make_enum_MergerOption()
+make_enum_FSMergerOption()
{
prefix mo
want_destringify
diff --git a/paludis/merger_TEST.cc b/paludis/fs_merger_TEST.cc
index 35b08cf..8ccea37 100644
--- a/paludis/merger_TEST.cc
+++ b/paludis/fs_merger_TEST.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "merger.hh"
+#include <paludis/fs_merger.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/hooker.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -100,26 +100,26 @@ namespace paludis
namespace
{
struct TestMerger :
- Merger
+ FSMerger
{
- TestMerger(const MergerParams & p) :
- Merger(p)
+ TestMerger(const FSMergerParams & p) :
+ FSMerger(p)
{
}
- void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &)
+ void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &)
{
}
- void record_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &)
+ void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &)
{
}
- void record_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &)
+ void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &)
{
}
- virtual void record_install_under_dir(const FSEntry &, const MergeStatusFlags &)
+ virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &)
{
}
@@ -128,7 +128,7 @@ namespace
if (is_check)
make_check_fail();
else
- throw MergerError(s);
+ throw FSMergerError(s);
}
void on_warn(bool, const std::string &)
@@ -168,12 +168,12 @@ namespace
MergerTest(EntryType src_type, EntryType dst_type, int n = 0) :
TestCase("merge " + stringify(src_type) + " over " + stringify(dst_type) + (0 == n ? "" : " "
+ stringify(n))),
- image_dir("merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
+ image_dir("fs_merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
+ (0 == n ? "" : "_" + stringify(n)) + "_dir/image"),
- root_dir("merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
+ root_dir("fs_merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
+ (0 == n ? "" : "_" + stringify(n)) + "_dir/root"),
- env(FSEntry("merger_TEST_dir/hooks")),
- merger(make_named_values<MergerParams>(
+ env(FSEntry("fs_merger_TEST_dir/hooks")),
+ merger(make_named_values<FSMergerParams>(
n::environment() = &env,
n::fix_mtimes_before() = Timestamp(0, 0),
n::get_new_ids_or_minus_one() = &get_new_ids_or_minus_one,
@@ -181,22 +181,22 @@ namespace
n::install_under() = FSEntry("/"),
n::merged_entries() = std::make_shared<FSEntrySet>(),
n::no_chown() = true,
- n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
+ n::options() = FSMergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::root() = root_dir
))
{
}
MergerTest(const std::string & custom_test,
- const MergerOptions & o = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
+ const FSMergerOptions & o = FSMergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
const bool fix = false) :
TestCase("merge " + custom_test + " test"),
- image_dir("merger_TEST_dir/" + custom_test + "/image"),
- root_dir("merger_TEST_dir/" + custom_test + "/root"),
- env(FSEntry("merger_TEST_dir/hooks")),
- merger(make_named_values<MergerParams>(
+ image_dir("fs_merger_TEST_dir/" + custom_test + "/image"),
+ root_dir("fs_merger_TEST_dir/" + custom_test + "/root"),
+ env(FSEntry("fs_merger_TEST_dir/hooks")),
+ merger(make_named_values<FSMergerParams>(
n::environment() = &env,
- n::fix_mtimes_before() = fix ? FSEntry("merger_TEST_dir/reference").mtim() : Timestamp(0, 0),
+ n::fix_mtimes_before() = fix ? FSEntry("fs_merger_TEST_dir/reference").mtim() : Timestamp(0, 0),
n::get_new_ids_or_minus_one() = &get_new_ids_or_minus_one,
n::image() = image_dir,
n::install_under() = FSEntry("/"),
@@ -276,7 +276,7 @@ namespace test_cases
TEST_CHECK((root_dir / "sym").is_directory());
TEST_CHECK(! merger.check());
- TEST_CHECK_THROWS(merger.merge(), MergerError);
+ TEST_CHECK_THROWS(merger.merge(), FSMergerError);
TEST_CHECK((root_dir / "sym").is_directory());
}
@@ -321,7 +321,7 @@ namespace test_cases
TEST_CHECK((root_dir / "dir").is_regular_file());
TEST_CHECK(! merger.check());
- TEST_CHECK_THROWS(merger.merge(), MergerError);
+ TEST_CHECK_THROWS(merger.merge(), FSMergerError);
TEST_CHECK((root_dir / "dir").is_regular_file());
}
@@ -356,7 +356,7 @@ namespace test_cases
TEST_CHECK((root_dir / "dir").realpath().is_regular_file());
TEST_CHECK(! merger.check());
- TEST_CHECK_THROWS(merger.merge(), MergerError);
+ TEST_CHECK_THROWS(merger.merge(), FSMergerError);
TEST_CHECK((root_dir / "dir").is_symbolic_link());
TEST_CHECK((root_dir / "dir").realpath().is_regular_file());
@@ -373,7 +373,7 @@ namespace test_cases
TEST_CHECK_THROWS((root_dir / "dir").realpath(), FSError);
TEST_CHECK(! merger.check());
- TEST_CHECK_THROWS(merger.merge(), MergerError);
+ TEST_CHECK_THROWS(merger.merge(), FSMergerError);
TEST_CHECK((root_dir / "dir").is_symbolic_link());
TEST_CHECK_THROWS((root_dir / "dir").realpath(), FSError);
@@ -464,7 +464,7 @@ namespace test_cases
TEST_CHECK((root_dir / "file").is_directory());
TEST_CHECK(! merger.check());
- TEST_CHECK_THROWS(merger.merge(), MergerError);
+ TEST_CHECK_THROWS(merger.merge(), FSMergerError);
TEST_CHECK((root_dir / "file").is_directory());
}
@@ -583,10 +583,10 @@ namespace test_cases
TEST_CHECK(timestamps_nearly_equal((root_dir / "new_file").mtim(), m_new));
TEST_CHECK(timestamps_nearly_equal((root_dir / "existing_file").mtim(), m_existing));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "dodgy_file").mtim(), FSEntry("merger_TEST_dir/reference").mtim()));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "dodgy_file").mtim(), FSEntry("fs_merger_TEST_dir/reference").mtim()));
TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "new_file").mtim(), m_dir_new));
- TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "dodgy_file").mtim(), FSEntry("merger_TEST_dir/reference").mtim()));
+ TEST_CHECK(timestamps_nearly_equal((root_dir / "dir" / "dodgy_file").mtim(), FSEntry("fs_merger_TEST_dir/reference").mtim()));
}
} test_merger_mtimes_fix;
}
diff --git a/paludis/merger_TEST_cleanup.sh b/paludis/fs_merger_TEST_cleanup.sh
index 5acd496..54580a9 100755
--- a/paludis/merger_TEST_cleanup.sh
+++ b/paludis/fs_merger_TEST_cleanup.sh
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# vim: set ft=sh sw=4 sts=4 et :
-if [ -d merger_TEST_dir ] ; then
- rm -fr merger_TEST_dir
+if [ -d fs_merger_TEST_dir ] ; then
+ rm -fr fs_merger_TEST_dir
else
true
fi
diff --git a/paludis/merger_TEST_setup.sh b/paludis/fs_merger_TEST_setup.sh
index d3e7436..738a1e7 100755
--- a/paludis/merger_TEST_setup.sh
+++ b/paludis/fs_merger_TEST_setup.sh
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# vim: set ft=sh sw=4 sts=4 et :
-mkdir merger_TEST_dir || exit 2
-cd merger_TEST_dir || exit 3
+mkdir fs_merger_TEST_dir || exit 2
+cd fs_merger_TEST_dir || exit 3
# must be before anything else, since timestamps before this are treated as
# dodgy
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index 68fa02d..2b5796d 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -68,7 +68,7 @@ namespace paludis
}
NDBAMMerger::NDBAMMerger(const NDBAMMergerParams & p) :
- Merger(make_named_values<MergerParams>(
+ FSMerger(make_named_values<FSMergerParams>(
n::environment() = p.environment(),
n::fix_mtimes_before() = p.fix_mtimes_before(),
n::get_new_ids_or_minus_one() = p.get_new_ids_or_minus_one(),
@@ -101,7 +101,7 @@ NDBAMMerger::extend_hook(const Hook & h)
std::string pv(stringify(_imp->params.package_id()->version().remove_revision()));
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->value()) : "");
- return Merger::extend_hook(h)
+ return FSMerger::extend_hook(h)
("P", pn + "-" + pv)
("PNV", pn + "-" + pv)
("PN", pn)
@@ -117,7 +117,7 @@ NDBAMMerger::extend_hook(const Hook & h)
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
else
- return Merger::extend_hook(h)
+ return FSMerger::extend_hook(h)
("CONFIG_PROTECT", _imp->params.config_protect())
("CONFIG_PROTECT_MASK", _imp->params.config_protect_mask())
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
@@ -149,7 +149,7 @@ namespace
}
void
-NDBAMMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const MergeStatusFlags & flags)
+NDBAMMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / dst_name).strip_leading(_imp->realroot))),
tidy_real(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
@@ -157,7 +157,7 @@ NDBAMMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, c
SafeIFStream infile(FSEntry(dst_dir / dst_name));
if (! infile)
- throw MergerError("Cannot read '" + stringify(FSEntry(dst_dir / dst_name)) + "'");
+ throw FSMergerError("Cannot read '" + stringify(FSEntry(dst_dir / dst_name)) + "'");
MD5 md5(infile);
@@ -174,7 +174,7 @@ NDBAMMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, c
}
void
-NDBAMMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, const MergeStatusFlags & flags)
+NDBAMMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -183,7 +183,7 @@ NDBAMMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, co
}
void
-NDBAMMerger::record_install_under_dir(const FSEntry & dst, const MergeStatusFlags & flags)
+NDBAMMerger::record_install_under_dir(const FSEntry & dst, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify(dst.strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -192,7 +192,7 @@ NDBAMMerger::record_install_under_dir(const FSEntry & dst, const MergeStatusFlag
}
void
-NDBAMMerger::record_install_sym(const FSEntry & src, const FSEntry & dst_dir, const MergeStatusFlags & flags)
+NDBAMMerger::record_install_sym(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
std::string target((dst_dir / src.basename()).readlink());
@@ -213,7 +213,7 @@ NDBAMMerger::on_error(bool is_check, const std::string & s)
if (is_check)
_imp->params.output_manager()->stdout_stream() << "." << std::endl << "!!! " << s << std::endl;
else
- throw MergerError(s);
+ throw FSMergerError(s);
}
void
@@ -256,7 +256,7 @@ NDBAMMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
SafeIFStream our_md5_file(src);
if (! our_md5_file)
- throw MergerError("Could not get md5 for '" + stringify((dst / src.basename()).strip_leading(_imp->realroot)) + "'");
+ throw FSMergerError("Could not get md5 for '" + stringify((dst / src.basename()).strip_leading(_imp->realroot)) + "'");
MD5 our_md5(our_md5_file);
while (true)
@@ -284,10 +284,10 @@ NDBAMMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
}
std::string
-NDBAMMerger::make_arrows(const MergeStatusFlags & flags) const
+NDBAMMerger::make_arrows(const FSMergerStatusFlags & flags) const
{
std::string result(">>>");
- for (EnumIterator<MergeStatusFlag> m, m_end(last_msi) ;
+ for (EnumIterator<FSMergerStatusFlag> m, m_end(last_msi) ;
m != m_end ; ++m)
{
if (! flags[*m])
@@ -342,14 +342,14 @@ NDBAMMerger::merge()
{
display_override(">>> Merging to " + stringify(_imp->params.root()));
_imp->contents_file = std::make_shared<SafeOFStream>(_imp->params.contents_file());
- Merger::merge();
+ FSMerger::merge();
}
bool
NDBAMMerger::check()
{
_imp->params.output_manager()->stdout_stream() << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
- bool result(Merger::check());
+ bool result(FSMerger::check());
_imp->params.output_manager()->stdout_stream() << std::endl;
return result;
}
diff --git a/paludis/ndbam_merger.hh b/paludis/ndbam_merger.hh
index 744832c..4f7b09c 100644
--- a/paludis/ndbam_merger.hh
+++ b/paludis/ndbam_merger.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_MERGER_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_MERGER_HH 1
-#include <paludis/merger.hh>
+#include <paludis/fs_merger.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/named_value.hh>
#include <paludis/output_manager-fwd.hh>
@@ -56,7 +56,7 @@ namespace paludis
NamedValue<n::image, FSEntry> image;
NamedValue<n::install_under, FSEntry> install_under;
NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
- NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::options, FSMergerOptions> options;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
NamedValue<n::root, FSEntry> root;
@@ -69,12 +69,12 @@ namespace paludis
* \since 0.26
*/
class PALUDIS_VISIBLE NDBAMMerger :
- public Merger,
+ public FSMerger,
private Pimp<NDBAMMerger>
{
private:
void display_override(const std::string &) const;
- std::string make_arrows(const MergeStatusFlags &) const;
+ std::string make_arrows(const FSMergerStatusFlags &) const;
Pimp<NDBAMMerger>::ImpPtr & _imp;
@@ -84,10 +84,10 @@ namespace paludis
virtual Hook extend_hook(const Hook &);
- virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &);
- virtual void record_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &);
- virtual void record_install_under_dir(const FSEntry &, const MergeStatusFlags &);
- virtual void record_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &);
+ virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &);
+ virtual void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
+ virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &);
+ virtual void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
virtual void on_error(bool is_check, const std::string &);
virtual void on_warn(bool is_check, const std::string &);
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index baa1120..4bf035e 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -492,7 +492,7 @@ AccountsID::perform_action(Action & action) const
n::environment_file() = FSEntry("/dev/null"),
n::image_dir() = fs_location_key()->value(),
n::merged_entries() = std::make_shared<FSEntrySet>(),
- n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
+ n::options() = FSMergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
n::perform_uninstall() = install_action->options.perform_uninstall(),
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index c15700f..4ae3880 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -2389,7 +2389,7 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
+ "' to destination '" + stringify(install_action.options.destination()->name())
+ "' because destination does not provide destination_interface");
- MergerOptions extra_merger_options;
+ FSMergerOptions extra_merger_options;
if (preserve_work_choice && preserve_work_choice->enabled())
extra_merger_options += mo_nondestructive;
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 777ada9..299cef6 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_EAPI_FWD_HH 1
#include <paludis/repositories/e/dep_parser-fwd.hh>
-#include <paludis/merger-fwd.hh>
+#include <paludis/fs_merger-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/elike_package_dep_spec-fwd.hh>
#include <memory>
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index bcbbdc2..31d4ba6 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -305,14 +305,14 @@ namespace
version_spec_options += destringify<VersionSpecOption>(*t);
}
- MergerOptions merger_options;
+ FSMergerOptions merger_options;
{
std::list<std::string> merger_options_tokens;
tokenise_whitespace(check_get(k, "merger_options"), std::back_inserter(merger_options_tokens));
for (std::list<std::string>::const_iterator t(merger_options_tokens.begin()),
t_end(merger_options_tokens.end()) ;
t != t_end ; ++t)
- merger_options += destringify<MergerOption>(*t);
+ merger_options += destringify<FSMergerOption>(*t);
}
return std::make_shared<SupportedEAPI>(make_named_values<SupportedEAPI>(
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index ffee931..8029fec 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -30,7 +30,7 @@
#include <paludis/util/singleton.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec-fwd.hh>
-#include <paludis/merger-fwd.hh>
+#include <paludis/fs_merger-fwd.hh>
#include <memory>
namespace paludis
@@ -272,7 +272,7 @@ namespace paludis
NamedValue<n::ebuild_options, std::shared_ptr<const EAPIEbuildOptions> > ebuild_options;
NamedValue<n::ebuild_phases, std::shared_ptr<const EAPIEbuildPhases> > ebuild_phases;
NamedValue<n::iuse_flag_parse_options, IUseFlagParseOptions> iuse_flag_parse_options;
- NamedValue<n::merger_options, MergerOptions> merger_options;
+ NamedValue<n::merger_options, FSMergerOptions> merger_options;
NamedValue<n::package_dep_spec_parse_options, ELikePackageDepSpecOptions> package_dep_spec_parse_options;
NamedValue<n::pipe_commands, std::shared_ptr<const EAPIPipeCommands> > pipe_commands;
NamedValue<n::tools_options, std::shared_ptr<const EAPIToolsOptions> > tools_options;
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 479799b..3964206 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -25,7 +25,7 @@
#include <paludis/util/map-fwd.hh>
#include <paludis/package_database.hh>
#include <paludis/action-fwd.hh>
-#include <paludis/merger-fwd.hh>
+#include <paludis/fs_merger-fwd.hh>
#include <string>
/** \file
@@ -303,7 +303,7 @@ namespace paludis
NamedValue<n::environment_file, FSEntry> environment_file;
NamedValue<n::image, FSEntry> image;
NamedValue<n::maybe_output_manager, std::shared_ptr<OutputManager> > maybe_output_manager;
- NamedValue<n::merger_options, MergerOptions> merger_options;
+ NamedValue<n::merger_options, FSMergerOptions> merger_options;
NamedValue<n::package_id, std::shared_ptr<const erepository::ERepositoryID> > package_id;
};
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 4d5ba23..6ec3bbf 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -80,7 +80,7 @@ namespace
}
VDBMerger::VDBMerger(const VDBMergerParams & p) :
- Merger(make_named_values<MergerParams>(
+ FSMerger(make_named_values<FSMergerParams>(
n::environment() = p.environment(),
n::fix_mtimes_before() = p.fix_mtimes_before(),
n::get_new_ids_or_minus_one() = std::bind(&get_new_ids_or_minus_one, p.environment(), std::placeholders::_1),
@@ -113,7 +113,7 @@ VDBMerger::extend_hook(const Hook & h)
std::string pv(stringify(_imp->params.package_id()->version().remove_revision()));
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->value()) : "");
- return Merger::extend_hook(h)
+ return FSMerger::extend_hook(h)
("P", pn + "-" + pv)
("PNV", pn + "-" + pv)
("PN", pn)
@@ -129,14 +129,14 @@ VDBMerger::extend_hook(const Hook & h)
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
else
- return Merger::extend_hook(h)
+ return FSMerger::extend_hook(h)
("CONFIG_PROTECT", _imp->params.config_protect())
("CONFIG_PROTECT_MASK", _imp->params.config_protect_mask())
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
void
-VDBMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const MergeStatusFlags & flags)
+VDBMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / dst_name).strip_leading(_imp->realroot))),
tidy_real(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
@@ -144,7 +144,7 @@ VDBMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, con
SafeIFStream infile(FSEntry(dst_dir / dst_name));
if (! infile)
- throw MergerError("Cannot read '" + stringify(FSEntry(dst_dir / dst_name)) + "'");
+ throw FSMergerError("Cannot read '" + stringify(FSEntry(dst_dir / dst_name)) + "'");
MD5 md5(infile);
@@ -157,7 +157,7 @@ VDBMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, con
}
void
-VDBMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, const MergeStatusFlags & flags)
+VDBMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -166,7 +166,7 @@ VDBMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, cons
}
void
-VDBMerger::record_install_under_dir(const FSEntry & dst_dir, const MergeStatusFlags & flags)
+VDBMerger::record_install_under_dir(const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify(dst_dir.strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -175,7 +175,7 @@ VDBMerger::record_install_under_dir(const FSEntry & dst_dir, const MergeStatusFl
}
void
-VDBMerger::record_install_sym(const FSEntry & src, const FSEntry & dst_dir, const MergeStatusFlags & flags)
+VDBMerger::record_install_sym(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
std::string target((dst_dir / src.basename()).readlink());
@@ -194,7 +194,7 @@ VDBMerger::on_error(bool is_check, const std::string & s)
if (is_check)
_imp->params.output_manager()->stdout_stream() << "." << std::endl << "!!! " << s << std::endl;
else
- throw MergerError(s);
+ throw FSMergerError(s);
}
void
@@ -237,7 +237,7 @@ VDBMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
SafeIFStream our_md5_file(src);
if (! our_md5_file)
- throw MergerError("Could not get md5 for '" + stringify((dst / src.basename()).strip_leading(_imp->realroot)) + "'");
+ throw FSMergerError("Could not get md5 for '" + stringify((dst / src.basename()).strip_leading(_imp->realroot)) + "'");
MD5 our_md5(our_md5_file);
while (true)
@@ -272,14 +272,14 @@ VDBMerger::merge()
{
display_override(">>> Merging to " + stringify(_imp->params.root()));
_imp->contents_file = std::make_shared<SafeOFStream>(_imp->params.contents_file());
- Merger::merge();
+ FSMerger::merge();
}
bool
VDBMerger::check()
{
_imp->params.output_manager()->stdout_stream() << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
- bool result(Merger::check());
+ bool result(FSMerger::check());
_imp->params.output_manager()->stdout_stream() << std::endl;
return result;
}
@@ -297,16 +297,16 @@ void
VDBMerger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check && std::string::npos != src.basename().find('\n'))
- throw MergerError("File '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
- Merger::on_file(is_check, src, dst);
+ throw FSMergerError("File '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
+ FSMerger::on_file(is_check, src, dst);
}
void
VDBMerger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
{
if (is_check && std::string::npos != src.basename().find('\n'))
- throw MergerError("Directory '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
- Merger::on_dir(is_check, src, dst);
+ throw FSMergerError("Directory '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
+ FSMerger::on_dir(is_check, src, dst);
}
void
@@ -315,14 +315,14 @@ VDBMerger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
if (is_check)
{
if (std::string::npos != src.basename().find('\n'))
- throw MergerError("Symlink '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
+ throw FSMergerError("Symlink '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
if (std::string::npos != src.readlink().find('\n'))
- throw MergerError("Symlink '" + stringify(src) + "' contains a newline in its target '" +
+ throw FSMergerError("Symlink '" + stringify(src) + "' contains a newline in its target '" +
src.readlink() + "', which cannot be stored by VDB");
if (std::string::npos != stringify(src).find(" -> "))
- throw MergerError("Symlink '" + stringify(src) + "' contains a ' -> ' in its name, which cannot be stored by VDB");
+ throw FSMergerError("Symlink '" + stringify(src) + "' contains a ' -> ' in its name, which cannot be stored by VDB");
}
- Merger::on_sym(is_check, src, dst);
+ FSMerger::on_sym(is_check, src, dst);
}
void
@@ -332,10 +332,10 @@ VDBMerger::display_override(const std::string & message) const
}
std::string
-VDBMerger::make_arrows(const MergeStatusFlags & flags) const
+VDBMerger::make_arrows(const FSMergerStatusFlags & flags) const
{
std::string result(">>>");
- for (EnumIterator<MergeStatusFlag> m, m_end(last_msi) ;
+ for (EnumIterator<FSMergerStatusFlag> m, m_end(last_msi) ;
m != m_end ; ++m)
{
if (! flags[*m])
diff --git a/paludis/repositories/e/vdb_merger.hh b/paludis/repositories/e/vdb_merger.hh
index 214141a..208a2e8 100644
--- a/paludis/repositories/e/vdb_merger.hh
+++ b/paludis/repositories/e/vdb_merger.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_VDB_MERGER_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_VDB_MERGER_HH 1
-#include <paludis/merger.hh>
+#include <paludis/fs_merger.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/output_manager-fwd.hh>
@@ -61,7 +61,7 @@ namespace paludis
NamedValue<n::fix_mtimes_before, Timestamp> fix_mtimes_before;
NamedValue<n::image, FSEntry> image;
NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
- NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::options, FSMergerOptions> options;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
NamedValue<n::root, FSEntry> root;
@@ -74,12 +74,12 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE VDBMerger :
- public Merger,
+ public FSMerger,
private Pimp<VDBMerger>
{
private:
void display_override(const std::string &) const;
- std::string make_arrows(const MergeStatusFlags &) const;
+ std::string make_arrows(const FSMergerStatusFlags &) const;
Pimp<VDBMerger>::ImpPtr & _imp;
@@ -94,10 +94,10 @@ namespace paludis
virtual Hook extend_hook(const Hook &);
- virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &);
- virtual void record_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &);
- virtual void record_install_under_dir(const FSEntry &, const MergeStatusFlags &);
- virtual void record_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &);
+ virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &);
+ virtual void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
+ virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &);
+ virtual void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
virtual void on_error(bool is_check, const std::string &);
virtual void on_warn(bool is_check, const std::string &);
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index 4718e20..b294587 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -49,7 +49,7 @@ namespace
bool check()
{
- return Merger::check();
+ return FSMerger::check();
}
void on_enter_dir(bool, const FSEntry)
@@ -86,7 +86,7 @@ namespace
n::fix_mtimes_before() = Timestamp(0, 0),
n::image() = FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image",
n::merged_entries() = std::make_shared<FSEntrySet>(),
- n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
+ n::options() = FSMergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::output_manager() = std::make_shared<StandardOutputManager>(),
n::package_id() = std::shared_ptr<PackageID>(),
n::root() = root_dir
@@ -197,7 +197,7 @@ namespace test_cases
void run()
{
- TEST_CHECK_THROWS(merger.check(), MergerError);
+ TEST_CHECK_THROWS(merger.check(), FSMergerError);
}
} test_vdb_merger_file_newline;
@@ -207,7 +207,7 @@ namespace test_cases
void run()
{
- TEST_CHECK_THROWS(merger.check(), MergerError);
+ TEST_CHECK_THROWS(merger.check(), FSMergerError);
}
} test_vdb_merger_dir_newline;
@@ -217,7 +217,7 @@ namespace test_cases
void run()
{
- TEST_CHECK_THROWS(merger.check(), MergerError);
+ TEST_CHECK_THROWS(merger.check(), FSMergerError);
}
} test_vdb_merger_sym_newline;
@@ -227,7 +227,7 @@ namespace test_cases
void run()
{
- TEST_CHECK_THROWS(merger.check(), MergerError);
+ TEST_CHECK_THROWS(merger.check(), FSMergerError);
}
} test_vdb_merger_sym_target_newline;
@@ -237,7 +237,7 @@ namespace test_cases
void run()
{
- TEST_CHECK_THROWS(merger.check(), MergerError);
+ TEST_CHECK_THROWS(merger.check(), FSMergerError);
}
} test_vdb_merger_sym_arrow;
@@ -247,7 +247,7 @@ namespace test_cases
void run()
{
- TEST_CHECK_THROWS(merger.check(), MergerError);
+ TEST_CHECK_THROWS(merger.check(), FSMergerError);
}
} test_vdb_merger_sym_arrow2;
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_id.cc b/paludis/repositories/unavailable/unavailable_repository_id.cc
index 57a93dd..fe967a9 100644
--- a/paludis/repositories/unavailable/unavailable_repository_id.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_id.cc
@@ -208,7 +208,7 @@ UnavailableRepositoryID::perform_action(Action & action) const
n::environment_file() = FSEntry("/dev/null"),
n::image_dir() = FSEntry("/dev/null"),
n::merged_entries() = std::make_shared<FSEntrySet>(),
- n::options() = MergerOptions(),
+ n::options() = FSMergerOptions(),
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
n::perform_uninstall() = install_action->options.perform_uninstall(),
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 4017b2e..a2c4db0 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -403,7 +403,7 @@ UnpackagedID::perform_action(Action & action) const
{
case wp_yes:
{
- MergerOptions extra_merger_options;
+ FSMergerOptions extra_merger_options;
if (preserve_work_choice && preserve_work_choice->enabled())
extra_merger_options += mo_nondestructive;
(*install_action->options.destination()).destination_interface()->merge(
@@ -412,7 +412,7 @@ UnpackagedID::perform_action(Action & action) const
n::environment_file() = FSEntry("/dev/null"),
n::image_dir() = fs_location_key()->value(),
n::merged_entries() = std::make_shared<FSEntrySet>(),
- n::options() = (MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
+ n::options() = (FSMergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
| extra_merger_options,
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
diff --git a/paludis/repository.hh b/paludis/repository.hh
index e5ade90..9e34775 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -38,7 +38,7 @@
#include <paludis/version_spec.hh>
#include <paludis/metadata_key-fwd.hh>
#include <paludis/metadata_key_holder.hh>
-#include <paludis/merger-fwd.hh>
+#include <paludis/fs_merger-fwd.hh>
#include <paludis/hook-fwd.hh>
#include <string>
#include <functional>
@@ -152,7 +152,7 @@ namespace paludis
*/
NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
- NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::options, FSMergerOptions> options;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;