aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-29 19:12:54 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-31 11:36:05 +0100
commit064c194b7cd54c9b7a58ffce14896ff5488ff767 (patch)
tree0d751a8c971f6e352d07b17a597c6a99597c38eb
parent0b85ee0343e93b8aff612c6ac3aef50229514613 (diff)
downloadpaludis-064c194b7cd54c9b7a58ffce14896ff5488ff767.tar.gz
paludis-064c194b7cd54c9b7a58ffce14896ff5488ff767.tar.xz
Better tar merging
-rw-r--r--paludis/repositories/e/pbin_merger.cc12
-rw-r--r--paludis/repositories/e/pbin_merger.hh3
-rw-r--r--paludis/tar_merger.cc7
-rw-r--r--paludis/tar_merger.hh3
-rw-r--r--paludis/tar_merger_TEST.cc8
5 files changed, 32 insertions, 1 deletions
diff --git a/paludis/repositories/e/pbin_merger.cc b/paludis/repositories/e/pbin_merger.cc
index 8753ce9..25c55ec 100644
--- a/paludis/repositories/e/pbin_merger.cc
+++ b/paludis/repositories/e/pbin_merger.cc
@@ -167,3 +167,15 @@ PbinMerger::on_done_merge()
add_file(_imp->params.environment_file(), FSEntry("/PBIN/environment"));
}
+void
+PbinMerger::track_install_file(const FSEntry &, const FSEntry & dst)
+{
+ display_override(">>> [obj] " + stringify(dst));
+}
+
+void
+PbinMerger::track_install_sym(const FSEntry &, const FSEntry & dst)
+{
+ display_override(">>> [sym] " + stringify(dst));
+}
+
diff --git a/paludis/repositories/e/pbin_merger.hh b/paludis/repositories/e/pbin_merger.hh
index 4da8c10..e996b73 100644
--- a/paludis/repositories/e/pbin_merger.hh
+++ b/paludis/repositories/e/pbin_merger.hh
@@ -76,6 +76,9 @@ namespace paludis
virtual void on_done_merge();
+ virtual void track_install_file(const FSEntry &, const FSEntry &);
+ virtual void track_install_sym(const FSEntry &, const FSEntry &);
+
public:
PbinMerger(const PbinMergerParams &);
~PbinMerger();
diff --git a/paludis/tar_merger.cc b/paludis/tar_merger.cc
index 7eca0f7..11f5edc 100644
--- a/paludis/tar_merger.cc
+++ b/paludis/tar_merger.cc
@@ -130,6 +130,7 @@ TarMerger::on_file_main(bool is_check, const FSEntry & src, const FSEntry & dst)
void
TarMerger::add_file(const FSEntry & src, const FSEntry & dst)
{
+ track_install_file(src, dst);
(*TarMergerHandle::get_instance()->add_file)(_imp->tar, stringify(src), strip_leading(stringify(dst), "/"));
}
@@ -139,8 +140,12 @@ TarMerger::on_dir_main(bool, const FSEntry &, const FSEntry &)
}
void
-TarMerger::on_sym_main(bool, const FSEntry & src, const FSEntry & dst)
+TarMerger::on_sym_main(bool is_check, const FSEntry & src, const FSEntry & dst)
{
+ if (is_check)
+ return;
+
+ track_install_sym(src, dst / src.basename());
(*TarMergerHandle::get_instance()->add_sym)(_imp->tar, stringify(src), strip_leading(stringify(dst / src.basename()), "/"),
stringify(src.readlink()));
}
diff --git a/paludis/tar_merger.hh b/paludis/tar_merger.hh
index 5f71a46..474abbd 100644
--- a/paludis/tar_merger.hh
+++ b/paludis/tar_merger.hh
@@ -76,6 +76,9 @@ namespace paludis
virtual void add_file(const FSEntry &, const FSEntry &);
+ virtual void track_install_file(const FSEntry &, const FSEntry &) = 0;
+ virtual void track_install_sym(const FSEntry &, const FSEntry &) = 0;
+
public:
TarMerger(const TarMergerParams &);
~TarMerger();
diff --git a/paludis/tar_merger_TEST.cc b/paludis/tar_merger_TEST.cc
index 69dad97..7ea8091 100644
--- a/paludis/tar_merger_TEST.cc
+++ b/paludis/tar_merger_TEST.cc
@@ -67,6 +67,14 @@ namespace
void display_override(const std::string &) const
{
}
+
+ void track_install_file(const FSEntry &, const FSEntry &)
+ {
+ }
+
+ void track_install_sym(const FSEntry &, const FSEntry &)
+ {
+ }
};
}