aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/cran
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/cran')
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc24
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh9
-rw-r--r--paludis/repositories/cran/cran_package_id.cc13
-rw-r--r--paludis/repositories/cran/cran_package_id.hh5
-rw-r--r--paludis/repositories/cran/cran_repository.cc35
-rw-r--r--paludis/repositories/cran/cran_repository.hh13
-rw-r--r--paludis/repositories/cran/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/cran/keys.hh1
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc2
9 files changed, 48 insertions, 55 deletions
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 646df755a..fdaac6d03 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -37,8 +37,6 @@
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
#include <paludis/repositories/cran/package_dep_spec.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/system.hh>
#include <paludis/util/log.hh>
@@ -75,8 +73,8 @@ namespace paludis
Imp(const CRANInstalledRepositoryParams &);
~Imp();
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
};
}
@@ -84,8 +82,8 @@ namespace paludis
Imp<CRANInstalledRepository>::Imp(const CRANInstalledRepositoryParams & p) :
params(p),
has_ids(false),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location", mkt_significant, params.location())),
- installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root", mkt_normal, params.root())),
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location", mkt_significant, params.location())),
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("root", "root", mkt_normal, params.root())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "installed_cran"))
{
}
@@ -109,7 +107,7 @@ Imp<CRANInstalledRepository>::need_ids() const
if (! d->is_directory())
continue;
- FSEntry f(FSEntry(stringify(*d)) / "DESCRIPTION");
+ FSPath f(FSPath(stringify(*d)) / "DESCRIPTION");
if (! f.is_regular_file())
continue;
@@ -123,7 +121,7 @@ Imp<CRANInstalledRepository>::need_ids() const
metadata.insert(std::make_pair(std::make_pair(q, VersionSpec(desc.version)), desc.metadata));
}
- if (! FSEntry(location / "paludis" / "bundles").is_directory())
+ if (! FSPath(location / "paludis" / "bundles").is_directory())
return;
// Load Bundle Metadata
@@ -274,7 +272,7 @@ CRANInstalledRepository::do_contents(const Package ID & id) const
std::string pn = stringify(q.package());
CRANDescription::normalise_name(pn);
- FSEntry f(_imp->location / "paludis" / pn / "CONTENTS");
+ FSPath f(_imp->location / "paludis" / pn / "CONTENTS");
if (! f.is_regular_file())
{
Log::get_instance()->message(ll_warning, lc_no_context, "CONTENTS lookup failed for request for' " +
@@ -357,7 +355,7 @@ CRANInstalledRepository::do_installed_time(const QualifiedPackageName & q,
{
std::string pn(stringify(q.package()));
CRANDescription::normalise_name(pn);
- FSEntry f(_imp->location / "paludis" / pn / "CONTENTS");
+ FSPath f(_imp->location / "paludis" / pn / "CONTENTS");
try
{
r->installed_time = f.mtime();
@@ -435,7 +433,7 @@ CRANInstalledRepository::do_uninstall(const QualifiedPackageName & q, const Vers
stringify(v) + "' because its location ('" + stringify(_imp->location) + "') is not a directory");
std::shared_ptr<const VersionMetadata> vm(do_version_metadata(q, v));
- std::shared_ptr<const FSEntryCollection> bashrc_files(_imp->env->bashrc_files());
+ std::shared_ptr<const FSPath> bashrc_files(_imp->env->bashrc_files());
Command cmd(Command(LIBEXECDIR "/paludis/cran.bash unmerge")
.with_setenv("PN", vm->cran_interface->package())
@@ -560,13 +558,13 @@ CRANInstalledRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANInstalledRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANInstalledRepository::installed_root_key() const
{
return _imp->installed_root_key;
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 74865edcb..e2f2544cc 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -24,7 +24,6 @@
#include <paludis/repository.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/map-fwd.hh>
/** \file
@@ -52,8 +51,8 @@ namespace paludis
struct CRANInstalledRepositoryParams
{
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::location, FSEntry> location;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::location, FSPath> location;
+ NamedValue<n::root, FSPath> root;
};
/**
@@ -153,8 +152,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index 3cb2a37a5..2047ca78e 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -34,6 +34,7 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -63,7 +64,7 @@ namespace paludis
QualifiedPackageName name;
VersionSpec version;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > fs_location_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > fs_location_key;
std::shared_ptr<LiteralMetadataValueKey<std::string> > url_key;
std::shared_ptr<LiteralMetadataValueKey<std::string> > short_description_key;
std::shared_ptr<LiteralMetadataValueKey<std::string> > long_description_key;
@@ -77,7 +78,7 @@ namespace paludis
std::shared_ptr<DependenciesLabelSequence> depends_labels;
Imp(const Environment * const e,
- const std::shared_ptr<const CRANRepository> & r, const FSEntry & f) :
+ const std::shared_ptr<const CRANRepository> & r, const FSPath & f) :
env(e),
repository(r),
cran_repository(r),
@@ -107,20 +108,20 @@ namespace paludis
};
}
-CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_ptr<const CRANRepository> & r, const FSEntry & f) :
+CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_ptr<const CRANRepository> & r, const FSPath & f) :
Pimp<CRANPackageID>(env, r, f),
_imp(Pimp<CRANPackageID>::_imp)
{
Context context("When parsing file '" + stringify(f) + "' to create a CRAN Package ID:");
- if (! f.is_regular_file())
+ if (! f.stat().is_regular_file())
{
add_mask(std::make_shared<BrokenMask>('B', "Broken", "DESCRIPTION file not a file"));
Log::get_instance()->message("cran.id.not_a_file", ll_warning, lc_context) << "Unexpected irregular file: '" << stringify(f) << "'";
return;
}
- _imp->fs_location_key = std::make_shared<LiteralMetadataValueKey<FSEntry> >("DescriptionFileLocation", "Description File Location",
+ _imp->fs_location_key = std::make_shared<LiteralMetadataValueKey<FSPath> >("DescriptionFileLocation", "Description File Location",
mkt_internal, f);
add_metadata_key(_imp->fs_location_key);
@@ -540,7 +541,7 @@ CRANPackageID::contained_in_key() const
return _imp->contained_in_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANPackageID::fs_location_key() const
{
return _imp->fs_location_key;
diff --git a/paludis/repositories/cran/cran_package_id.hh b/paludis/repositories/cran/cran_package_id.hh
index 6d32ce51d..af8acb369 100644
--- a/paludis/repositories/cran/cran_package_id.hh
+++ b/paludis/repositories/cran/cran_package_id.hh
@@ -22,7 +22,6 @@
#define PALUDIS_GUARD_PALUDIS_CRAN_PACKAGE_ID_HH 1
#include <paludis/package_id.hh>
-#include <paludis/util/fs_entry.hh>
namespace paludis
{
@@ -45,7 +44,7 @@ namespace paludis
public:
CRANPackageID(const Environment * const, const std::shared_ptr<const CRANRepository> &,
- const FSEntry &);
+ const FSPath &);
CRANPackageID(const Environment * const, const std::shared_ptr<const CRANRepository> &,
const CRANPackageID * const, const std::string &);
~CRANPackageID();
@@ -75,7 +74,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > contained_in_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > behaviours_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 776f2e17e..6df82a440 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -26,11 +26,9 @@
#include <paludis/literal_metadata_key.hh>
#include <paludis/repositories/cran/cran_package_id.hh>
#include <paludis/repositories/cran/cran_repository.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/map.hh>
@@ -48,6 +46,7 @@
#include <paludis/util/extract_host_from_url.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/syncer.hh>
#include <paludis/hook.hh>
@@ -77,11 +76,11 @@ namespace paludis
Imp(const CRANRepositoryParams &, const std::shared_ptr<Mutex> &);
~Imp();
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > distdir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > distdir_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > library_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > library_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key;
};
@@ -91,11 +90,11 @@ Imp<CRANRepository>::Imp(const CRANRepositoryParams & p, const std::shared_ptr<M
params(p),
big_nasty_mutex(m),
has_ids(false),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location", mkt_significant, params.location())),
- distdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("distdir", "distdir", mkt_normal, params.distdir())),
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location", mkt_significant, params.location())),
+ distdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("distdir", "distdir", mkt_normal, params.distdir())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "cran")),
- builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir", mkt_normal, params.builddir())),
- library_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("library", "library", mkt_normal, params.library())),
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("builddir", "builddir", mkt_normal, params.builddir())),
+ library_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("library", "library", mkt_normal, params.library())),
sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync", "sync", mkt_normal, params.sync())),
sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync())))
{
@@ -220,7 +219,7 @@ CRANRepository::need_ids() const
Context context("When loading IDs for " + stringify(name()) + ":");
- for (DirIterator d(_imp->params.location()), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->params.location(), { fsio_inode_sort }), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".DESCRIPTION", { }))
{
std::shared_ptr<cranrepository::CRANPackageID> id(std::make_shared<cranrepository::CRANPackageID>(_imp->params.environment(),
@@ -244,7 +243,7 @@ CRANRepository::need_ids() const
RepositoryName
CRANRepository::fetch_repo_name(const std::string & location)
{
- std::string modified_location(FSEntry(location).basename());
+ std::string modified_location(FSPath(location).basename());
std::replace(modified_location.begin(), modified_location.end(), '/', '-');
if (modified_location == "cran")
return RepositoryName("cran");
@@ -283,8 +282,8 @@ CRANRepository::do_install(const std::shared_ptr<const PackageID> & id_uncasted,
if (o.fetch_only)
return;
- FSEntry image(_imp->params.buildroot / stringify(id->native_package()) / "image");
- FSEntry workdir(_imp->params.buildroot / stringify(id->native_package()) / "work");
+ FSPath image(_imp->params.buildroot / stringify(id->native_package()) / "image");
+ FSPath workdir(_imp->params.buildroot / stringify(id->native_package()) / "work");
if (! o.destination)
throw PackageInstallActionError("Can't merge '" + stringify(*id) + "' because no destination was provided.");
@@ -310,7 +309,7 @@ CRANRepository::do_install(const std::shared_ptr<const PackageID> & id_uncasted,
throw PackageInstallActionError("Couldn't install '" + stringify(*id) + "' to '" +
stringify(image) + "'");
- MergeOptions m(id, image, FSEntry("/dev/null"));
+ MergeOptions m(id, image, FSPath("/dev/null"));
if (! o.destination->destination_interface)
throw PackageInstallActionError("Couldn't install '" + stringify(*id) + "' to '" +
@@ -543,16 +542,16 @@ CRANRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
CRANRepository::installed_root_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
const std::shared_ptr<const MetadataValueKey<std::string> >
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 0355e563a..1e0d946d5 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -22,7 +22,6 @@
#define PALUDIS_GUARD_PALUDIS_CRAN_REPOSITORY_HH 1
#include <paludis/repository.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/environment-fwd.hh>
#include <memory>
@@ -58,11 +57,11 @@ namespace paludis
*/
struct CRANRepositoryParams
{
- NamedValue<n::builddir, FSEntry> builddir;
- NamedValue<n::distdir, FSEntry> distdir;
+ NamedValue<n::builddir, FSPath> builddir;
+ NamedValue<n::distdir, FSPath> distdir;
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::library, FSEntry> library;
- NamedValue<n::location, FSEntry> location;
+ NamedValue<n::library, FSPath> library;
+ NamedValue<n::location, FSPath> location;
NamedValue<n::mirror, std::string> mirror;
NamedValue<n::sync, std::string> sync;
};
@@ -156,8 +155,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/cran/dep_spec_pretty_printer.cc b/paludis/repositories/cran/dep_spec_pretty_printer.cc
index 1a365fa51..5d93d8617 100644
--- a/paludis/repositories/cran/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/cran/dep_spec_pretty_printer.cc
@@ -21,7 +21,6 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
diff --git a/paludis/repositories/cran/keys.hh b/paludis/repositories/cran/keys.hh
index bb10301af..1a0eca58e 100644
--- a/paludis/repositories/cran/keys.hh
+++ b/paludis/repositories/cran/keys.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_CRAN_KEYS_HH 1
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/sequence.hh>
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index 8928b5e8b..6c8e5550e 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -143,7 +143,7 @@ namespace
return make_null_shared_ptr();
}
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const
+ virtual std::shared_ptr<const FSPath> installed_at_path_ptr() const
{
return make_null_shared_ptr();
}