aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-16 17:49:02 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-10-16 17:49:25 +0100
commit987ee3f9c64be9a429dc478e47bdca405a4579cf (patch)
tree01221cf00ac61fce1e5c611f381b17a52f141442
parent19b92c7f8fe7d146c0c0a0e183382fe3f0564da1 (diff)
downloadpaludis-987ee3f9c64be9a429dc478e47bdca405a4579cf.tar.gz
paludis-987ee3f9c64be9a429dc478e47bdca405a4579cf.tar.xz
mo_preserve_mtimes for EAPI 3
-rw-r--r--paludis/merger.cc95
-rw-r--r--paludis/merger.hh21
-rw-r--r--paludis/merger.se1
-rw-r--r--paludis/merger_TEST.cc17
-rwxr-xr-xpaludis/merger_TEST_setup.sh4
-rw-r--r--paludis/repositories/e/eapis/3.conf2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc13
-rw-r--r--paludis/repositories/e/vdb_repository.cc13
-rw-r--r--paludis/unmerger.cc8
-rwxr-xr-xsrc/clients/paludis/upgrade_TEST16
-rwxr-xr-xsrc/clients/paludis/upgrade_TEST_setup.sh8
11 files changed, 156 insertions, 42 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 4e57d55..63828a6 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -26,6 +26,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/set.hh>
#include <paludis/selinux/security_context.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
@@ -62,10 +63,13 @@ namespace paludis
bool result;
bool skip_dir;
+ std::tr1::shared_ptr<FSEntrySet> merged_entries;
+
Implementation(const MergerParams & p) :
params(p),
result(true),
- skip_dir(false)
+ skip_dir(false),
+ merged_entries(new FSEntrySet)
{
}
};
@@ -155,10 +159,10 @@ Merger::merge()
if (! d->exists())
{
d->mkdir();
- record_install_under_dir(*d, MergeStatusFlags());
+ track_install_under_dir(*d, MergeStatusFlags());
}
else
- record_install_under_dir(*d, MergeStatusFlags() + msi_used_existing);
+ track_install_under_dir(*d, MergeStatusFlags() + msi_used_existing);
}
if (! _imp->params.no_chown())
@@ -506,7 +510,7 @@ Merger::on_file_over_nothing(bool is_check, const FSEntry & src, const FSEntry &
if (is_check)
return;
- record_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()));
+ track_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()));
}
void
@@ -518,10 +522,10 @@ Merger::on_file_over_file(bool is_check, const FSEntry & src, const FSEntry & ds
if (config_protected(src, dst))
{
std::string cfgpro_name(make_config_protect_name(src, dst));
- record_install_file(src, dst, cfgpro_name, install_file(src, dst, cfgpro_name));
+ track_install_file(src, dst, cfgpro_name, install_file(src, dst, cfgpro_name));
}
else
- record_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()) + msi_unlinked_first);
+ track_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()) + msi_unlinked_first);
}
void
@@ -537,7 +541,7 @@ Merger::on_file_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst
if (is_check)
return;
- record_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()) + msi_unlinked_first);
+ track_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()) + msi_unlinked_first);
}
void
@@ -546,7 +550,7 @@ Merger::on_file_over_misc(bool is_check, const FSEntry & src, const FSEntry & ds
if (is_check)
return;
- record_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()) + msi_unlinked_first);
+ track_install_file(src, dst, src.basename(), install_file(src, dst, src.basename()) + msi_unlinked_first);
}
void
@@ -555,7 +559,7 @@ Merger::on_dir_over_nothing(bool is_check, const FSEntry & src, const FSEntry &
if (is_check)
return;
- record_install_dir(src, dst, install_dir(src, dst));
+ track_install_dir(src, dst, install_dir(src, dst));
}
void
@@ -571,7 +575,7 @@ Merger::on_dir_over_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
if (is_check)
return;
- record_install_dir(src, dst, MergeStatusFlags() + msi_used_existing);
+ track_install_dir(src, dst, MergeStatusFlags() + msi_used_existing);
}
void
@@ -592,7 +596,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)
- record_install_dir(src, dst, MergeStatusFlags() + msi_used_existing);
+ track_install_dir(src, dst, MergeStatusFlags() + msi_used_existing);
}
else
on_error(is_check, "Expected '" + stringify(dst / src.basename()) +
@@ -606,7 +610,7 @@ Merger::on_dir_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst
return;
unlink_misc(dst / src.basename());
- record_install_dir(src, dst, install_dir(src, dst) + msi_unlinked_first);
+ track_install_dir(src, dst, install_dir(src, dst) + msi_unlinked_first);
}
void
@@ -615,7 +619,7 @@ Merger::on_sym_over_nothing(bool is_check, const FSEntry & src, const FSEntry &
if (is_check)
return;
- record_install_sym(src, dst, install_sym(src, dst));
+ track_install_sym(src, dst, install_sym(src, dst));
}
void
@@ -625,7 +629,7 @@ Merger::on_sym_over_file(bool is_check, const FSEntry & src, const FSEntry & dst
return;
unlink_file(dst / src.basename());
- record_install_sym(src, dst, install_sym(src, dst) + msi_unlinked_first);
+ track_install_sym(src, dst, install_sym(src, dst) + msi_unlinked_first);
}
void
@@ -642,7 +646,7 @@ Merger::on_sym_over_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
return;
unlink_sym(dst / src.basename());
- record_install_sym(src, dst, install_sym(src, dst) + msi_unlinked_first);
+ track_install_sym(src, dst, install_sym(src, dst) + msi_unlinked_first);
}
void
@@ -652,7 +656,7 @@ Merger::on_sym_over_misc(bool is_check, const FSEntry & src, const FSEntry & dst
return;
unlink_misc(dst / src.basename());
- record_install_sym(src, dst, install_sym(src, dst) + msi_unlinked_first);
+ track_install_sym(src, dst, install_sym(src, dst) + msi_unlinked_first);
}
void
@@ -749,7 +753,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
bool touch(_imp->merged_ids.end() == _imp->merged_ids.find(src.lowlevel_id()));
_imp->merged_ids.insert(make_pair(src.lowlevel_id(), stringify(dst_real)));
- if (touch && ! dst_real.utime())
+ if ((! _imp->params.options()[mo_preserve_mtimes]) && touch && ! dst_real.utime())
throw MergerError("utime(" + stringify(dst_real) + ", 0) failed: " + stringify(::strerror(errno)));
/* set*id bits get partially clobbered on a rename on linux */
@@ -798,6 +802,17 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
throw MergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno)));
try_to_copy_xattrs(src, output_fd, result);
+ /* might need to copy mtime */
+ if (_imp->params.options()[mo_preserve_mtimes])
+ {
+ /* futimens is POSIX, futimes isn't */
+ struct timespec ts;
+ ts.tv_sec = src.mtime();
+ ts.tv_nsec = 0;
+ if (0 != ::futimens(output_fd, &ts))
+ throw MergerError("Cannot futimens '" + stringify(dst) + "': " + stringify(::strerror(errno)));
+ }
+
char buf[4096];
ssize_t count;
while ((count = read(input_fd, buf, 4096)) > 0)
@@ -857,7 +872,7 @@ Merger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
}
void
-Merger::record_renamed_dir_recursive(const FSEntry & dst)
+Merger::track_renamed_dir_recursive(const FSEntry & dst)
{
for (DirIterator d(dst, DirIteratorOptions() + dio_include_dotfiles + dio_inode_sort), d_end ; d != d_end ; ++d)
{
@@ -869,7 +884,7 @@ Merger::record_renamed_dir_recursive(const FSEntry & dst)
{
case et_sym:
rewrite_symlink_as_needed(*d, dst);
- record_install_sym(*d, dst, merged_how + msi_parent_rename);
+ track_install_sym(*d, dst, merged_how + msi_parent_rename);
_imp->merged_ids.insert(make_pair(d->lowlevel_id(), stringify(*d)));
continue;
@@ -879,13 +894,13 @@ Merger::record_renamed_dir_recursive(const FSEntry & dst)
_imp->merged_ids.insert(make_pair(d->lowlevel_id(), stringify(*d)));
if (touch && ! FSEntry(*d).utime())
throw MergerError("utime(" + stringify(*d) + ", 0) failed: " + stringify(::strerror(errno)));
- record_install_file(*d, dst, stringify(d->basename()), merged_how + msi_parent_rename);
+ track_install_file(*d, dst, stringify(d->basename()), merged_how + msi_parent_rename);
}
continue;
case et_dir:
- record_install_dir(*d, d->dirname(), merged_how + msi_parent_rename);
- record_renamed_dir_recursive(*d);
+ track_install_dir(*d, d->dirname(), merged_how + msi_parent_rename);
+ track_renamed_dir_recursive(*d);
continue;
case et_misc:
@@ -948,7 +963,7 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
if (0 == std::rename(stringify(src).c_str(), stringify(dst).c_str()))
{
result += msi_rename;
- record_renamed_dir_recursive(dst);
+ track_renamed_dir_recursive(dst);
_imp->skip_dir = true;
}
else
@@ -1226,3 +1241,37 @@ Merger::try_to_copy_xattrs(const FSEntry &, int, MergeStatusFlags &)
#endif
+void
+Merger::track_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const MergeStatusFlags & flags)
+{
+ _imp->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)
+{
+ _imp->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)
+{
+ _imp->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)
+{
+ _imp->merged_entries->insert(dst_dir / src.basename());
+ record_install_sym(src, dst_dir, flags);
+}
+
+const std::tr1::shared_ptr<const FSEntrySet>
+Merger::merged_entries() const
+{
+ return _imp->merged_entries;
+}
+
diff --git a/paludis/merger.hh b/paludis/merger.hh
index 591f3b9..fb08d66 100644
--- a/paludis/merger.hh
+++ b/paludis/merger.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -106,7 +106,7 @@ namespace paludis
private PrivateImplementationPattern<Merger>
{
private:
- void record_renamed_dir_recursive(const FSEntry &);
+ 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 &);
@@ -151,6 +151,16 @@ namespace paludis
*/
virtual void on_leave_dir(bool is_check, const FSEntry);
+ ///\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 &);
+
+ ///\}
+
///\name Handle filesystem entry things
///\{
@@ -230,6 +240,13 @@ namespace paludis
* Perform the merge.
*/
virtual void merge();
+
+ /**
+ * Every FSEntry (final path) that we merged.
+ *
+ * \since 0.40
+ */
+ const std::tr1::shared_ptr<const FSEntrySet> merged_entries() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/merger.se b/paludis/merger.se
index 2054621..8e150e7 100644
--- a/paludis/merger.se
+++ b/paludis/merger.se
@@ -31,6 +31,7 @@ make_enum_MergerOption()
key mo_rewrite_symlinks "Fix symlinks that point into the image directory (otherwise throw an error)"
key mo_allow_empty_dirs "Allow merging empty directories"
+ key mo_preserve_mtimes "Preserve mtimes \since 0.42"
doxygen_comment << "END"
/**
diff --git a/paludis/merger_TEST.cc b/paludis/merger_TEST.cc
index 8eabf06..96575f8 100644
--- a/paludis/merger_TEST.cc
+++ b/paludis/merger_TEST.cc
@@ -528,5 +528,22 @@ namespace test_cases
TEST_CHECK(! merger.check());
}
} test_merger_empty_root_disallowed;
+
+ struct MergerMtimesTest : MergerTest
+ {
+ MergerMtimesTest() : MergerTest("mtimes", MergerOptions() + mo_preserve_mtimes) { }
+
+ void run()
+ {
+ time_t m_new((image_dir / "new_file").mtime());
+ time_t m_existing((image_dir / "existing_file").mtime());
+
+ TEST_CHECK(merger.check());
+ merger.merge();
+
+ TEST_CHECK_EQUAL((root_dir / "new_file").mtime(), m_new);
+ TEST_CHECK_EQUAL((root_dir / "existing_file").mtime(), m_existing);
+ }
+ } test_merger_mtimes;
}
diff --git a/paludis/merger_TEST_setup.sh b/paludis/merger_TEST_setup.sh
index b716a5d..dc6d087 100755
--- a/paludis/merger_TEST_setup.sh
+++ b/paludis/merger_TEST_setup.sh
@@ -91,6 +91,10 @@ for d in *_dir; do
ln -s ${d} ${d%_dir}
done
+mkdir -p mtimes/{image,root}
+> mtimes/image/new_file
+> mtimes/image/existing_file
+> mtimes/root/existing_file
mkdir hooks
cd hooks
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
index 65a885b..195c3a4 100644
--- a/paludis/repositories/e/eapis/3.conf
+++ b/paludis/repositories/e/eapis/3.conf
@@ -7,6 +7,8 @@ can_be_pbin = true
ebuild_functions = ${ebuild_functions} pkg_pretend
+merger_options = ${merge_options} preserve_mtimes
+
ebuild_install = \
skipname=killold : killold ; \
skipname=init userpriv sandbox : init saveenv ; \
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 2361772..1b13e18 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -313,9 +313,10 @@ namespace
return o;
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_merged(const std::tr1::shared_ptr<const FSEntrySet> & s,
+ const FSEntry & f)
{
- return false;
+ return s->end() != s->find(f);
}
}
@@ -431,7 +432,8 @@ ExndbamRepository::merge(const MergeParams & m)
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
value_for<n::if_for_install_id>(m.package_id()),
- value_for<n::ignore_for_unmerge>(&ignore_nothing),
+ value_for<n::ignore_for_unmerge>(std::tr1::bind(&ignore_merged, merger.merged_entries(),
+ std::tr1::placeholders::_1)),
value_for<n::is_overwrite>(true),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
@@ -451,7 +453,8 @@ ExndbamRepository::merge(const MergeParams & m)
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
value_for<n::if_for_install_id>(m.package_id()),
- value_for<n::ignore_for_unmerge>(&ignore_nothing),
+ value_for<n::ignore_for_unmerge>(std::tr1::bind(&ignore_merged, merger.merged_entries(),
+ std::tr1::placeholders::_1)),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
@@ -532,7 +535,7 @@ ExndbamRepository::perform_uninstall(
value_for<n::config_protect_mask>(config_protect_mask),
value_for<n::contents_file>(ver_dir / "contents"),
value_for<n::environment>(_imp->params.environment()),
- value_for<n::ignore>(&ignore_nothing),
+ value_for<n::ignore>(a.options.ignore_for_unmerge()),
value_for<n::ndbam>(&_imp->ndbam),
value_for<n::output_manager>(output_manager),
value_for<n::package_id>(id),
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 221402a..9df0917 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -389,9 +389,10 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError(
namespace
{
- bool ignore_nothing(const FSEntry &)
+ bool ignore_merged(const std::tr1::shared_ptr<const FSEntrySet> & s,
+ const FSEntry & f)
{
- return false;
+ return s->end() != s->find(f);
}
}
@@ -462,7 +463,7 @@ VDBRepository::perform_uninstall(
value_for<n::config_protect>(final_config_protect),
value_for<n::config_protect_mask>(config_protect_mask),
value_for<n::environment>(_imp->params.environment()),
- value_for<n::ignore>(&ignore_nothing),
+ value_for<n::ignore>(a.options.ignore_for_unmerge()),
value_for<n::output_manager>(output_manager),
value_for<n::package_id>(id),
value_for<n::root>(installed_root_key()->value())
@@ -977,7 +978,8 @@ VDBRepository::merge(const MergeParams & m)
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
value_for<n::if_for_install_id>(m.package_id()),
- value_for<n::ignore_for_unmerge>(&ignore_nothing),
+ value_for<n::ignore_for_unmerge>(std::tr1::bind(&ignore_merged, merger.merged_entries(),
+ std::tr1::placeholders::_1)),
value_for<n::is_overwrite>(true),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
@@ -997,7 +999,8 @@ VDBRepository::merge(const MergeParams & m)
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
value_for<n::if_for_install_id>(m.package_id()),
- value_for<n::ignore_for_unmerge>(&ignore_nothing),
+ value_for<n::ignore_for_unmerge>(std::tr1::bind(&ignore_merged, merger.merged_entries(),
+ std::tr1::placeholders::_1)),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
diff --git a/paludis/unmerger.cc b/paludis/unmerger.cc
index fd1289f..837ee3c 100644
--- a/paludis/unmerger.cc
+++ b/paludis/unmerger.cc
@@ -135,6 +135,8 @@ Unmerger::unmerge_file(const std::tr1::shared_ptr<const ContentsEntry> & e) cons
display("<<< [force] " + stringify(e->location_key()->value()));
unlink_file(f_real, e);
}
+ else if (_imp->options.ignore()(f_real))
+ display("--- [ignor] " + stringify(e->location_key()->value()));
else if (check_file(e))
{
display("<<< " + stringify(e->location_key()->value()));
@@ -161,6 +163,8 @@ Unmerger::unmerge_sym(const std::tr1::shared_ptr<const ContentsEntry> & e) const
display("<<< [force] " + stringify(e->location_key()->value()));
unlink_sym(f_real, e);
}
+ else if (_imp->options.ignore()(f_real))
+ display("--- [ignor] " + stringify(e->location_key()->value()));
else if (check_sym(e))
{
display("<<< " + stringify(e->location_key()->value()));
@@ -182,6 +186,8 @@ Unmerger::unmerge_dir(const std::tr1::shared_ptr<const ContentsEntry> & e) const
throw UnmergerError("Unmerge of '" + stringify(e->location_key()->value()) + "' aborted by hook");
else if (hr.output() == "skip")
display("--- [skip ] " + stringify(e->location_key()->value()));
+ else if (_imp->options.ignore()(f_real))
+ display("--- [ignor] " + stringify(e->location_key()->value()));
else if (check_dir(e))
{
display("<<< " + stringify(e->location_key()->value()));
@@ -208,6 +214,8 @@ Unmerger::unmerge_misc(const std::tr1::shared_ptr<const ContentsEntry> & e) cons
display("<<< [force] " + stringify(e->location_key()->value()));
unlink_misc(f_real, e);
}
+ else if (_imp->options.ignore()(f_real))
+ display("--- [ignor] " + stringify(e->location_key()->value()));
else if (check_misc(e))
{
display("<<< " + stringify(e->location_key()->value()));
diff --git a/src/clients/paludis/upgrade_TEST b/src/clients/paludis/upgrade_TEST
index 9054cf3..e0d962b 100755
--- a/src/clients/paludis/upgrade_TEST
+++ b/src/clients/paludis/upgrade_TEST
@@ -15,15 +15,17 @@ for c in vdb_config exndbam_config ; do
./upgrade_TEST_dir/root/usr/bin/testbin1 | grep testbin1 >/dev/null || exit 3
./upgrade_TEST_dir/root/usr/bin/testbin2 && exit 4
- PALUDIS_HOME=./upgrade_TEST_dir/$c/ REPEAT=yes \
- ./paludis -E :upgrade-test --install =test-category/target-1 || exit 5
+ for a in 1 2 ; do
+ PALUDIS_HOME=./upgrade_TEST_dir/$c/ REPEAT=yes \
+ ./paludis -E :upgrade-test --install =test-category/target-1 || exit 5
- PALUDIS_HOME=./upgrade_TEST_dir/$c/ REPEAT= \
- ./paludis -E :upgrade-test --query -M =test-category/target-1 || exit 15
+ PALUDIS_HOME=./upgrade_TEST_dir/$c/ REPEAT= \
+ ./paludis -E :upgrade-test --query -M =test-category/target-1 || exit 15
- ./upgrade_TEST_dir/root/usr/bin/testbin | grep testbin-1 >/dev/null || exit 6
- ./upgrade_TEST_dir/root/usr/bin/testbin1 | grep repeatbin1 >/dev/null || exit 7
- ./upgrade_TEST_dir/root/usr/bin/testbin2 && exit 8
+ ./upgrade_TEST_dir/root/usr/bin/testbin | grep testbin-1 >/dev/null || exit 6
+ ./upgrade_TEST_dir/root/usr/bin/testbin1 | grep repeatbin1 >/dev/null || exit 7
+ ./upgrade_TEST_dir/root/usr/bin/testbin2 && exit 8
+ done
PALUDIS_HOME=./upgrade_TEST_dir/$c/ \
./paludis -E :upgrade-test --install target || exit 9
diff --git a/src/clients/paludis/upgrade_TEST_setup.sh b/src/clients/paludis/upgrade_TEST_setup.sh
index 8270362..ef0e4c8 100755
--- a/src/clients/paludis/upgrade_TEST_setup.sh
+++ b/src/clients/paludis/upgrade_TEST_setup.sh
@@ -123,6 +123,8 @@ the_eclass_works()
END
cat <<"END" > test-category/target/target-1.ebuild || exit 1
+EAPI="3"
+
inherit myeclass
DESCRIPTION="Test target"
@@ -153,6 +155,8 @@ src_install() {
dobin testbin
dobin testbin${PV}
+
+ touch -d "1 April 2000" -m ${D}/usr/bin/testbin
}
pkg_preinst() {
@@ -177,6 +181,8 @@ pkg_prerm() {
END
cat <<"END" > test-category/target/target-2.ebuild || exit 1
+EAPI="3"
+
DESCRIPTION="Test target"
HOMEPAGE="http://paludis.pioto.org/"
SRC_URI="http://invalid.domain/${P}.tar.gz"
@@ -188,6 +194,8 @@ KEYWORDS="test"
src_install() {
dobin testbin
dobin testbin${PV}
+
+ touch -d "1 April 2000" -m ${D}/usr/bin/testbin
}
END
cd ..