aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-03-29 01:35:09 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-03-29 01:35:09 +0000
commita0c5e7245f803e4c8a93eae0db772daabbc220ed (patch)
treee6579fa40ed44d7bcccd0528d470d9b07ba9d85c
parenta3103e76a18b827854e5668df9fe5066879a0dc3 (diff)
downloadpaludis-a0c5e7245f803e4c8a93eae0db772daabbc220ed.tar.gz
paludis-a0c5e7245f803e4c8a93eae0db772daabbc220ed.tar.xz
Use mtime rather than ctime to determine a package's installation time.
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc4
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc2
-rw-r--r--paludis/repositories/e/e_key.cc16
-rw-r--r--paludis/repositories/e/e_key.hh10
4 files changed, 16 insertions, 16 deletions
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 1f1dc34..9ea9e49 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -352,11 +352,11 @@ CRANInstalledRepository::do_installed_time(const QualifiedPackageName & q,
FSEntry f(_imp->location / "paludis" / pn / "CONTENTS");
try
{
- r->installed_time = f.ctime();
+ r->installed_time = f.mtime();
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_no_context, "Can't get ctime of '"
+ Log::get_instance()->message(ll_warning, lc_no_context, "Can't get mtime of '"
+ stringify(f) + "' due to exception '" + e.message() + "' (" + e.what()
+ ")");
r->installed_time = 1;
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 08a884c..b158b45 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -297,7 +297,7 @@ EInstalledRepositoryID::need_keys_added() const
_imp->contents = make_contents_key();
add_metadata_key(_imp->contents);
- _imp->installed_time.reset(new ECTimeKey(shared_from_this(), "INSTALLED_TIME", "Installed time",
+ _imp->installed_time.reset(new EMTimeKey(shared_from_this(), "INSTALLED_TIME", "Installed time",
_imp->dir / contents_filename(), mkt_normal));
add_metadata_key(_imp->installed_time);
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 4b4a284..fec8432 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -1040,7 +1040,7 @@ EContentsKey::value() const
namespace paludis
{
template <>
- struct Implementation<ECTimeKey>
+ struct Implementation<EMTimeKey>
{
const tr1::shared_ptr<const ERepositoryID> id;
const FSEntry filename;
@@ -1055,20 +1055,20 @@ namespace paludis
};
}
-ECTimeKey::ECTimeKey(const tr1::shared_ptr<const ERepositoryID> & id,
+EMTimeKey::EMTimeKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
MetadataTimeKey(r, h, t),
- PrivateImplementationPattern<ECTimeKey>(new Implementation<ECTimeKey>(id, v)),
- _imp(PrivateImplementationPattern<ECTimeKey>::_imp)
+ PrivateImplementationPattern<EMTimeKey>(new Implementation<EMTimeKey>(id, v)),
+ _imp(PrivateImplementationPattern<EMTimeKey>::_imp)
{
}
-ECTimeKey::~ECTimeKey()
+EMTimeKey::~EMTimeKey()
{
}
time_t
-ECTimeKey::value() const
+EMTimeKey::value() const
{
Lock l(_imp->value_mutex);
@@ -1079,11 +1079,11 @@ ECTimeKey::value() const
try
{
- *_imp->value = _imp->filename.ctime();
+ *_imp->value = _imp->filename.mtime();
}
catch (const FSError & e)
{
- Log::get_instance()->message(ll_warning, lc_context) << "Couldn't get ctime for '"
+ Log::get_instance()->message(ll_warning, lc_context) << "Couldn't get mtime for '"
<< _imp->filename << "' for ID '" << *_imp->id << "' due to exception '" << e.message()
<< "' (" << e.what() << ")";
}
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index d72cf74..419a2db 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -303,17 +303,17 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
};
- class ECTimeKey :
+ class EMTimeKey :
public MetadataTimeKey,
- private PrivateImplementationPattern<ECTimeKey>
+ private PrivateImplementationPattern<EMTimeKey>
{
private:
- PrivateImplementationPattern<ECTimeKey>::ImpPtr & _imp;
+ PrivateImplementationPattern<EMTimeKey>::ImpPtr & _imp;
public:
- ECTimeKey(const tr1::shared_ptr<const ERepositoryID> &,
+ EMTimeKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
- ~ECTimeKey();
+ ~EMTimeKey();
time_t value() const
PALUDIS_ATTRIBUTE((warn_unused_result));