aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-01-07 01:30:16 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-01-07 01:30:16 +0000
commitcaa183f581cdec6b4c9b53842dc445a94ad928b6 (patch)
tree90e9ad7fb73fdecb6cbdc4a8be119b3eadc7a763
parent6ccbb59a86acef238e1aa173fdb6b585bbc488d3 (diff)
downloadpaludis-caa183f581cdec6b4c9b53842dc445a94ad928b6.tar.gz
paludis-caa183f581cdec6b4c9b53842dc445a94ad928b6.tar.xz
Finish tidy up and bugfixing for bundles.
-rw-r--r--paludis/repositories/cran/cran_description.hh1
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc39
-rw-r--r--paludis/repositories/cran/cran_repository.cc4
3 files changed, 21 insertions, 23 deletions
diff --git a/paludis/repositories/cran/cran_description.hh b/paludis/repositories/cran/cran_description.hh
index f1d2cdb..5da542f 100644
--- a/paludis/repositories/cran/cran_description.hh
+++ b/paludis/repositories/cran/cran_description.hh
@@ -22,6 +22,7 @@
#include <paludis/version_metadata.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/log.hh>
namespace paludis
{
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 519a6dd..d3705d6 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -141,13 +141,11 @@ Implementation<CRANInstalledRepository>::load_entries() const
return;
// Load Bundle Metadata
- Log::get_instance()->message(ll_warning, lc_no_context, "Bundles start now REMOVE");
for (DirIterator f(location / "paludis" / "bundles"), f_end ; f != f_end ; ++f)
{
Context local_context("When parsing file '" + stringify(*f) + "'.");
- Log::get_instance()->message(ll_warning, lc_no_context, "REMOVE Bundle: " + strinfify(*f));
- if (! f.is_regular_file())
+ if (! f->is_regular_file())
{
continue;
}
@@ -158,7 +156,7 @@ Implementation<CRANInstalledRepository>::load_entries() const
n.erase(pos);
CRANDescription::normalise_name(n);
- CRANDescription desc(n, f);
+ CRANDescription desc(n, *f);
entries.push_back(desc);
QualifiedPackageName q("cran/" + n);
@@ -280,12 +278,10 @@ CRANInstalledRepository::do_version_specs(const QualifiedPackageName & n) const
if (! _imp->entries_valid)
_imp->load_entries();
- std::pair<std::vector<CRANDescription>::const_iterator, std::vector<CRANDescription>::const_iterator>
- r(std::equal_range(_imp->entries.begin(), _imp->entries.end(), n,
- CRANDescription::ComparePackage()));
-
- for ( ; r.first != r.second ; ++(r.first))
- result->insert(r.first->version);
+ for (std::vector<CRANDescription>::const_iterator e(_imp->entries.begin()), e_end(_imp->entries.end()) ;
+ e != e_end ; ++e)
+ if (n == e->name)
+ result->insert(e->version);
return result;
}
@@ -457,32 +453,35 @@ CRANInstalledRepository::do_installed_time(const QualifiedPackageName & q,
if (! _imp->entries_valid)
_imp->load_entries();
- std::pair<std::vector<CRANDescription>::iterator, std::vector<CRANDescription>::iterator>
- r(std::equal_range(_imp->entries.begin(), _imp->entries.end(), std::make_pair(
- q, v), CRANDescription::CompareVersion()));
- std::string pn = stringify(q.package);
- CRANDescription::normalise_name(pn);
+ std::vector<CRANDescription>::iterator r(_imp->entries.begin()), r_end(_imp->entries.end());
+ for ( ; r != r_end ; ++r)
+ {
+ if (q == r->name)
+ break;
+ }
- if (r.first == r.second)
+ if (r == r_end)
throw NoSuchPackageError(stringify(PackageDatabaseEntry(q, v, name())));
else
{
- if (0 == r.first->installed_time)
+ if (0 == r->installed_time)
{
+ std::string pn(stringify(q.package));
+ CRANDescription::normalise_name(pn);
FSEntry f(_imp->location / "paludis" / pn / "CONTENTS");
try
{
- r.first->installed_time = f.ctime();
+ r->installed_time = f.ctime();
}
catch (const FSError & e)
{
Log::get_instance()->message(ll_warning, lc_no_context, "Can't get ctime of '"
+ stringify(f) + "' due to exception '" + e.message() + "' (" + e.what()
+ ")");
- r.first->installed_time = 1;
+ r->installed_time = 1;
}
}
- return r.first->installed_time;
+ return r->installed_time;
}
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index ccaa95f..487ccdb 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -365,7 +365,6 @@ CRANRepository::need_packages() const
for ( ; i != i_end ; ++i)
{
Context c("When processing 'Contains:' line: '" + stringify(*i) + "':");
- Log::get_instance()->message(ll_warning, lc_no_context, "Contains: " + stringify(*i));
if (*i == last_package_name)
continue;
@@ -422,7 +421,6 @@ CRANRepository::do_version_metadata(
if (d.is_regular_file())
{
- Log::get_instance()->message(ll_warning, lc_no_context, "do_version_metadata: " + stringify(p));
CRANDescription desc(stringify(p), d);
result = desc.metadata;
}
@@ -546,7 +544,7 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
cmd = cmd("DISTDIR", stringify(_imp->distdir));
cmd = cmd("DISTFILE", std::string(p + "_" + v + ".tar.gz"));
cmd = cmd("IMAGE", image);
- cmd = cmd("IS_BUNDLE", (vm->get_cran_interface()->is_bundle() ? "yes" : ""));
+ cmd = cmd("IS_BUNDLE", (vm->get_cran_interface()->is_bundle ? "yes" : ""));
cmd = cmd("LOCATION", stringify(_imp->location));
cmd = cmd("PN", stringify(pn));
cmd = cmd("PV", stringify(vn));