aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/unpackaged
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/unpackaged')
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc87
-rw-r--r--paludis/repositories/unpackaged/installed_id.hh5
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc51
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh8
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc131
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc24
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.hh5
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc14
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh8
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc43
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.cc11
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.hh14
13 files changed, 194 insertions, 208 deletions
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 0df950cf8..73173f8fc 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -23,9 +23,7 @@
#include <paludis/ndbam_unmerger.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
@@ -35,6 +33,8 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -74,19 +74,19 @@ namespace
return f.format(i, format::Plain());
}
- class InstalledUnpackagedFSEntryKey :
- public MetadataValueKey<FSEntry>
+ class InstalledUnpackagedFSPathKey :
+ public MetadataValueKey<FSPath>
{
private:
- const FSEntry _location;
+ const FSPath _location;
public:
- InstalledUnpackagedFSEntryKey(const FSEntry & l) :
+ InstalledUnpackagedFSPathKey(const FSPath & l) :
_location(l)
{
}
- const FSEntry value() const
+ const FSPath value() const
{
return _location;
}
@@ -107,21 +107,6 @@ namespace
}
};
- void create_file(Contents & c, const FSEntry & f)
- {
- c.add(std::make_shared<ContentsFileEntry>(stringify(f)));
- }
-
- void create_dir(Contents & c, const FSEntry & f)
- {
- c.add(std::make_shared<ContentsDirEntry>(stringify(f)));
- }
-
- void create_sym(Contents & c, const FSEntry & f, const FSEntry & t)
- {
- c.add(std::make_shared<ContentsSymEntry>(stringify(f), stringify(t)));
- }
-
class InstalledUnpackagedContentsKey :
public MetadataValueKey<std::shared_ptr<const Contents> >
{
@@ -177,8 +162,8 @@ namespace
const Timestamp _time;
public:
- InstalledUnpackagedTimeKey(const FSEntry & f) :
- _time(f.mtim())
+ InstalledUnpackagedTimeKey(const FSPath & f) :
+ _time(f.stat().mtim())
{
}
@@ -209,14 +194,14 @@ namespace
private:
mutable std::shared_ptr<const std::string> _v;
mutable Mutex _mutex;
- const FSEntry _f;
+ const FSPath _f;
const std::string _raw_name;
const std::string _human_name;
const MetadataKeyType _type;
public:
- InstalledUnpackagedStringKey(const std::string & r, const std::string & h, const FSEntry & f, const MetadataKeyType t) :
+ InstalledUnpackagedStringKey(const std::string & r, const std::string & h, const FSPath & f, const MetadataKeyType t) :
_f(f),
_raw_name(r),
_human_name(h),
@@ -259,7 +244,7 @@ namespace
private:
mutable std::shared_ptr<Set<std::string> > _v;
mutable Mutex _mutex;
- FSEntrySequence _f;
+ FSPathSequence _f;
const std::string _raw_name;
const std::string _human_name;
@@ -273,7 +258,7 @@ namespace
{
}
- void add_source(const FSEntry & f)
+ void add_source(const FSPath & f)
{
_f.push_back(f);
}
@@ -285,7 +270,7 @@ namespace
return _v;
_v = std::make_shared<Set<std::string>>();
- for (FSEntrySequence::ConstIterator a(_f.begin()), a_end(_f.end()) ;
+ for (FSPathSequence::ConstIterator a(_f.begin()), a_end(_f.end()) ;
a != a_end ; ++a)
{
SafeIFStream f(*a);
@@ -324,7 +309,7 @@ namespace
const Environment * const _env;
mutable std::shared_ptr<const DependencySpecTree> _v;
mutable Mutex _mutex;
- const FSEntry _f;
+ const FSPath _f;
const std::shared_ptr<const DependenciesLabelSequence> _labels;
const std::string _raw_name;
@@ -333,7 +318,7 @@ namespace
public:
InstalledUnpackagedDependencyKey(const Environment * const e,
- const std::string & r, const std::string & h, const FSEntry & f,
+ const std::string & r, const std::string & h, const FSPath & f,
const std::shared_ptr<const DependenciesLabelSequence> & l, const MetadataKeyType t) :
_env(e),
_f(f),
@@ -405,14 +390,14 @@ namespace paludis
const QualifiedPackageName name;
const VersionSpec version;
const RepositoryName repository_name;
- const FSEntry root;
+ const FSPath root;
const NDBAM * const ndbam;
std::shared_ptr<DependenciesLabelSequence> build_dependencies_labels;
std::shared_ptr<DependenciesLabelSequence> run_dependencies_labels;
std::shared_ptr<LiteralMetadataValueKey<SlotName> > slot_key;
- std::shared_ptr<InstalledUnpackagedFSEntryKey> fs_location_key;
+ std::shared_ptr<InstalledUnpackagedFSPathKey> fs_location_key;
std::shared_ptr<InstalledUnpackagedContentsKey> contents_key;
std::shared_ptr<InstalledUnpackagedTimeKey> installed_time_key;
std::shared_ptr<InstalledUnpackagedStringSetKey> from_repositories_key;
@@ -428,8 +413,8 @@ namespace paludis
const VersionSpec & v,
const SlotName & s,
const RepositoryName & r,
- const FSEntry & l,
- const FSEntry & ro,
+ const FSPath & l,
+ const FSPath & ro,
const NDBAM * const d) :
env(e),
name(q),
@@ -440,7 +425,7 @@ namespace paludis
build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
slot_key(std::make_shared<LiteralMetadataValueKey<SlotName> >("slot", "Slot", mkt_internal, s)),
- fs_location_key(std::make_shared<InstalledUnpackagedFSEntryKey>(l)),
+ fs_location_key(std::make_shared<InstalledUnpackagedFSPathKey>(l)),
behaviours_key(InstalledUnpackagedIDBehaviours::get_instance()->behaviours_key)
{
build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build_dependencies",
@@ -448,7 +433,7 @@ namespace paludis
run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("run_dependencies",
return_literal_function(true)));
- if ((l / "contents").exists())
+ if ((l / "contents").stat().exists())
{
contents_key = std::make_shared<InstalledUnpackagedContentsKey>(id, d);
installed_time_key = std::make_shared<InstalledUnpackagedTimeKey>(l / "contents");
@@ -456,20 +441,20 @@ namespace paludis
from_repositories_key = std::make_shared<InstalledUnpackagedStringSetKey>("source_repository",
"Source repository", mkt_normal);
- if ((l / "source_repository").exists())
+ if ((l / "source_repository").stat().exists())
from_repositories_key->add_source(l / "source_repository");
- if ((l / "binary_repository").exists())
+ if ((l / "binary_repository").stat().exists())
from_repositories_key->add_source(l / "binary_repository");
- if ((l / "description").exists())
+ if ((l / "description").stat().exists())
description_key = std::make_shared<InstalledUnpackagedStringKey>("description", "Description", l / "description", mkt_significant);
- if ((l / "build_dependencies").exists())
+ if ((l / "build_dependencies").stat().exists())
build_dependencies_key = std::make_shared<InstalledUnpackagedDependencyKey>(env,
"build_dependencies", "Build dependencies", l / "build_dependencies",
build_dependencies_labels, mkt_dependencies);
- if ((l / "run_dependencies").exists())
+ if ((l / "run_dependencies").stat().exists())
run_dependencies_key = std::make_shared<InstalledUnpackagedDependencyKey>(env,
"run_dependencies", "Run dependencies", l / "run_dependencies",
run_dependencies_labels, mkt_dependencies);
@@ -478,8 +463,8 @@ namespace paludis
}
InstalledUnpackagedID::InstalledUnpackagedID(const Environment * const e, const QualifiedPackageName & q,
- const VersionSpec & v, const SlotName & s, const RepositoryName & n, const FSEntry & l,
- const std::string &, const FSEntry & ro, const NDBAM * const d) :
+ const VersionSpec & v, const SlotName & s, const RepositoryName & n, const FSPath & l,
+ const std::string &, const FSPath & ro, const NDBAM * const d) :
Pimp<InstalledUnpackagedID>(e, this, q, v, s, n, l, ro, d),
_imp(Pimp<InstalledUnpackagedID>::_imp)
{
@@ -669,7 +654,7 @@ InstalledUnpackagedID::from_repositories_key() const
return _imp->from_repositories_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
InstalledUnpackagedID::fs_location_key() const
{
return _imp->fs_location_key;
@@ -844,7 +829,7 @@ InstalledUnpackagedID::extra_hash_value() const
namespace
{
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -870,11 +855,11 @@ InstalledUnpackagedID::uninstall(const bool replace,
}
}
- if (! _imp->root.is_directory())
+ if (! _imp->root.stat().is_directory())
throw ActionFailedError("Couldn't uninstall '" + stringify(*this) +
"' because root ('" + stringify(_imp->root) + "') is not a directory");
- FSEntry ver_dir(fs_location_key()->value());
+ FSPath ver_dir(fs_location_key()->value());
NDBAMUnmerger unmerger(
make_named_values<NDBAMUnmergerOptions>(
@@ -891,13 +876,13 @@ InstalledUnpackagedID::uninstall(const bool replace,
unmerger.unmerge();
- for (DirIterator d(ver_dir, { dio_include_dotfiles }), d_end ; d != d_end ; ++d)
- FSEntry(*d).unlink();
+ for (FSIterator d(ver_dir, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
+ d->unlink();
ver_dir.rmdir();
if (last)
{
- FSEntry pkg_dir(fs_location_key()->value().dirname());
+ FSPath pkg_dir(fs_location_key()->value().dirname());
pkg_dir.rmdir();
std::static_pointer_cast<const InstalledUnpackagedRepository>(repository())->deindex(name());
diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh
index afefc9b85..95c5d995a 100644
--- a/paludis/repositories/unpackaged/installed_id.hh
+++ b/paludis/repositories/unpackaged/installed_id.hh
@@ -23,7 +23,6 @@
#include <paludis/package_id.hh>
#include <paludis/name-fwd.hh>
#include <paludis/action-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/ndbam-fwd.hh>
@@ -47,7 +46,7 @@ namespace paludis
public:
InstalledUnpackagedID(const Environment * const, const QualifiedPackageName &, const VersionSpec &,
- const SlotName &, const RepositoryName &, const FSEntry &, const std::string &, const FSEntry &,
+ const SlotName &, const RepositoryName &, const FSPath &, const std::string &, const FSPath &,
const NDBAM * const);
~InstalledUnpackagedID();
@@ -75,7 +74,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > contents_key() const;
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_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;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > choices_key() const;
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 9c91775bb..0343fe3d1 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -26,7 +26,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/cookie.hh>
#include <paludis/util/simple_visitor_cast.hh>
@@ -35,6 +34,8 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/action.hh>
#include <paludis/environment.hh>
@@ -70,16 +71,16 @@ namespace paludis
const InstalledUnpackagedRepositoryParams params;
mutable NDBAM ndbam;
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > root_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
Imp(const InstalledUnpackagedRepositoryParams & p) :
params(p),
ndbam(p.location(), &supported_installed_unpackaged, "installed_unpackaged-1", user_version_spec_options()),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root",
+ 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_unpackaged"))
@@ -230,19 +231,21 @@ InstalledUnpackagedRepository::is_unimportant() const
namespace
{
std::pair<uid_t, gid_t>
- get_new_ids_or_minus_one(const Environment * const env, const int rewrite_ids_over_to_root, const FSEntry & f)
+ get_new_ids_or_minus_one(const Environment * const env, const int rewrite_ids_over_to_root, const FSPath & f)
{
uid_t uid;
gid_t gid;
- if (f.owner() == env->reduced_uid() || (rewrite_ids_over_to_root != -1
- && f.owner() > static_cast<unsigned int>(rewrite_ids_over_to_root)))
+ FSStat f_stat(f);
+
+ if (f_stat.owner() == env->reduced_uid() || (rewrite_ids_over_to_root != -1
+ && f_stat.owner() > static_cast<unsigned int>(rewrite_ids_over_to_root)))
uid = 0;
else
uid = -1;
- if (f.group() == env->reduced_gid() || (rewrite_ids_over_to_root != -1
- && f.group() > static_cast<unsigned int>(rewrite_ids_over_to_root)))
+ if (f_stat.group() == env->reduced_gid() || (rewrite_ids_over_to_root != -1
+ && f_stat.group() > static_cast<unsigned int>(rewrite_ids_over_to_root)))
gid = 0;
else
gid = -1;
@@ -271,14 +274,14 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
if (! is_suitable_destination_for(*m.package_id()))
throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
- FSEntry install_under("/");
+ FSPath install_under("/");
{
Repository::MetadataConstIterator k(m.package_id()->repository()->find_metadata("install_under"));
if (k == m.package_id()->repository()->end_metadata())
throw ActionFailedError("Could not fetch install_under key from owning repository");
- const MetadataValueKey<FSEntry> * kk(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**k));
+ const MetadataValueKey<FSPath> * kk(simple_visitor_cast<const MetadataValueKey<FSPath> >(**k));
if (! kk)
- throw ActionFailedError("Fetched install_under key but did not get an FSEntry key from owning repository");
+ throw ActionFailedError("Fetched install_under key but did not get an FSPath key from owning repository");
install_under = kk->value();
}
@@ -308,25 +311,25 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
}
}
- FSEntry uid_dir(_imp->params.location());
+ FSPath uid_dir(_imp->params.location());
if (if_same_name_id)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
{
std::string uid(stringify(m.package_id()->name().category()) + "---" + stringify(m.package_id()->name().package()));
uid_dir /= "data";
- uid_dir.mkdir();
+ uid_dir.mkdir(0755, { fspmkdo_ok_if_exists });
uid_dir /= uid;
- uid_dir.mkdir();
+ uid_dir.mkdir(0755, { fspmkdo_ok_if_exists });
}
- FSEntry target_ver_dir(uid_dir);
+ FSPath target_ver_dir(uid_dir);
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->value()) + ":" + cookie());
- if (target_ver_dir.exists())
+ if (target_ver_dir.stat().exists())
throw ActionFailedError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
"due to a previous failed install. If it is safe to do so, please remove this directory and try again.");
- target_ver_dir.mkdir();
+ target_ver_dir.mkdir(0755, { });
{
SafeOFStream source_repository_file(target_ver_dir / "source_repository");
@@ -364,7 +367,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
_imp->params.environment(), rewrite_ids_over_to_root, _1),
n::image() = m.image_dir(),
n::install_under() = install_under,
- n::merged_entries() = std::make_shared<FSEntrySet>(),
+ n::merged_entries() = std::make_shared<FSPathSet>(),
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
@@ -373,8 +376,8 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
if (! merger.check())
{
- for (DirIterator d(target_ver_dir, { dio_include_dotfiles }), d_end ; d != d_end ; ++d)
- FSEntry(*d).unlink();
+ for (FSIterator d(target_ver_dir, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
+ d->unlink();
target_ver_dir.rmdir();
throw ActionFailedError("Not proceeding with install due to merge sanity check failing");
}
@@ -438,13 +441,13 @@ InstalledUnpackagedRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
InstalledUnpackagedRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
InstalledUnpackagedRepository::installed_root_key() const
{
return _imp->root_key;
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index 5b50c81a3..478e954da 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -39,8 +39,8 @@ namespace paludis
struct InstalledUnpackagedRepositoryParams
{
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::location, FSEntry> location;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::location, FSPath> location;
+ NamedValue<n::root, FSPath> root;
};
}
@@ -109,8 +109,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/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 5372c6319..a7030c907 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -37,6 +37,7 @@
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <algorithm>
@@ -88,7 +89,7 @@ namespace
return wp_yes;
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -107,8 +108,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo1"),
- n::root() = FSEntry("installed_repository_TEST_dir/root")
+ n::location() = FSPath("installed_repository_TEST_dir/repo1"),
+ n::root() = FSPath("installed_repository_TEST_dir/root")
)));
env.package_database()->add_repository(1, repo);
@@ -130,8 +131,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo1"),
- n::root() = FSEntry("installed_repository_TEST_dir/root")
+ n::location() = FSPath("installed_repository_TEST_dir/repo1"),
+ n::root() = FSPath("installed_repository_TEST_dir/root")
)));
env.package_database()->add_repository(1, repo);
@@ -145,7 +146,7 @@ namespace test_cases
TEST_CHECK_EQUAL(id1->repository()->name(), RepositoryName("installed-unpackaged"));
TEST_CHECK(bool(id1->fs_location_key()));
TEST_CHECK_EQUAL(id1->fs_location_key()->value(),
- FSEntry::cwd() / "installed_repository_TEST_dir/repo1/data/giant-space-weasel/1:0:foo/");
+ FSPath::cwd() / "installed_repository_TEST_dir/repo1/data/giant-space-weasel/1:0:foo/");
TEST_CHECK(bool(id1->contents_key()));
ContentsDumper d1;
@@ -163,7 +164,7 @@ namespace test_cases
TEST_CHECK_EQUAL(id2->repository()->name(), RepositoryName("installed-unpackaged"));
TEST_CHECK(bool(id2->fs_location_key()));
TEST_CHECK_EQUAL(id2->fs_location_key()->value(),
- FSEntry::cwd() / "installed_repository_TEST_dir/repo1/data/giant-space-weasel/2:1:bar/");
+ FSPath::cwd() / "installed_repository_TEST_dir/repo1/data/giant-space-weasel/2:1:bar/");
TEST_CHECK(bool(id2->contents_key()));
ContentsDumper d2;
@@ -184,8 +185,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo1"),
- n::root() = FSEntry("installed_repository_TEST_dir/root")
+ n::location() = FSPath("installed_repository_TEST_dir/repo1"),
+ n::root() = FSPath("installed_repository_TEST_dir/root")
)));
env.package_database()->add_repository(1, repo);
@@ -214,8 +215,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo1"),
- n::root() = FSEntry("installed_repository_TEST_dir/root")
+ n::location() = FSPath("installed_repository_TEST_dir/repo1"),
+ n::root() = FSPath("installed_repository_TEST_dir/root")
)));
env.package_database()->add_repository(1, repo);
@@ -249,8 +250,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo2"),
- n::root() = FSEntry("installed_repository_TEST_dir/root2")
+ n::location() = FSPath("installed_repository_TEST_dir/repo2"),
+ n::root() = FSPath("installed_repository_TEST_dir/root2")
)));
env.package_database()->add_repository(1, repo);
@@ -258,11 +259,11 @@ namespace test_cases
TEST_CHECK_EQUAL(join(indirect_iterator(pre_ids->begin()), indirect_iterator(pre_ids->end()), " "),
"cat-one/foo-1.2.3:fred::installed-unpackaged");
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root2/first").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root2/second").is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root2/first").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root2/second").stat().is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo2/indices/categories/cat-one/foo").is_symbolic_link());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo2/indices/packages/foo/cat-one").is_symbolic_link());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/repo2/indices/categories/cat-one/foo").stat().is_symlink());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/repo2/indices/packages/foo/cat-one").stat().is_symlink());
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::All())]->begin());
@@ -275,11 +276,11 @@ namespace test_cases
));
id->perform_action(action);
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root2/first").exists());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root2/second").is_regular_file());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root2/first").stat().exists());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root2/second").stat().is_regular_file());
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/repo2/indices/categories/cat-one/foo").is_symbolic_link());
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/repo2/indices/packages/foo/cat-one").is_symbolic_link());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/repo2/indices/categories/cat-one/foo").stat().is_symlink());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/repo2/indices/packages/foo/cat-one").stat().is_symlink());
repo->invalidate();
@@ -305,8 +306,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo3"),
- n::root() = FSEntry("installed_repository_TEST_dir/root3")
+ n::location() = FSPath("installed_repository_TEST_dir/repo3"),
+ n::root() = FSPath("installed_repository_TEST_dir/root3")
)));
env.package_database()->add_repository(1, repo);
@@ -314,8 +315,8 @@ namespace test_cases
TEST_CHECK_EQUAL(join(indirect_iterator(pre_ids->begin()), indirect_iterator(pre_ids->end()), " "),
"cat-one/foo-1.2.3:fred::installed-unpackaged cat-one/foo-3.2.1:barney::installed-unpackaged");
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo3/indices/categories/cat-one/foo").is_symbolic_link());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo3/indices/packages/foo/cat-one").is_symbolic_link());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/repo3/indices/categories/cat-one/foo").stat().is_symlink());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/repo3/indices/packages/foo/cat-one").stat().is_symlink());
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:fred",
@@ -330,8 +331,8 @@ namespace test_cases
));
id->perform_action(action);
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo3/indices/categories/cat-one/foo").is_symbolic_link());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/repo3/indices/packages/foo/cat-one").is_symbolic_link());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/repo3/indices/categories/cat-one/foo").stat().is_symlink());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/repo3/indices/packages/foo/cat-one").stat().is_symlink());
repo->invalidate();
@@ -360,15 +361,15 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo4"),
- n::root() = FSEntry("installed_repository_TEST_dir/root4")
+ n::location() = FSPath("installed_repository_TEST_dir/repo4"),
+ n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
env.package_database()->add_repository(1, repo);
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
TEST_CHECK_EQUAL(join(indirect_iterator(pre_ids->begin()), indirect_iterator(pre_ids->end()), " "), "");
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir").exists());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir").stat().exists());
}
{
@@ -379,8 +380,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo4"),
- n::root() = FSEntry("installed_repository_TEST_dir/root4")
+ n::location() = FSPath("installed_repository_TEST_dir/repo4"),
+ n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
env.package_database()->add_repository(0, repo);
@@ -390,8 +391,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("installed_repository_TEST_dir/src4a"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("installed_repository_TEST_dir/src4a"),
n::name() = QualifiedPackageName("cat/pkg4a"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -408,7 +409,7 @@ namespace test_cases
TEST_CHECK_EQUAL(join(indirect_iterator(pre_ids->begin()), indirect_iterator(pre_ids->end()), " "), "");
}
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir").exists());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir").stat().exists());
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = repo,
@@ -419,8 +420,8 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4a").is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4a").stat().is_regular_file());
repo->invalidate();
{
@@ -439,8 +440,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo4"),
- n::root() = FSEntry("installed_repository_TEST_dir/root4")
+ n::location() = FSPath("installed_repository_TEST_dir/repo4"),
+ n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
env.package_database()->add_repository(0, repo);
@@ -450,8 +451,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("installed_repository_TEST_dir/src4b1"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("installed_repository_TEST_dir/src4b1"),
n::name() = QualifiedPackageName("cat/pkg4b"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -478,11 +479,11 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4a").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4b").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4b1").is_regular_file());
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir/4b2").is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4a").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4b").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4b1").stat().is_regular_file());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir/4b2").stat().is_regular_file());
repo->invalidate();
{
@@ -501,8 +502,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo4"),
- n::root() = FSEntry("installed_repository_TEST_dir/root4")
+ n::location() = FSPath("installed_repository_TEST_dir/repo4"),
+ n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
env.package_database()->add_repository(0, repo);
@@ -512,8 +513,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("installed_repository_TEST_dir/src4b2"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("installed_repository_TEST_dir/src4b2"),
n::name() = QualifiedPackageName("cat/pkg4b"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -540,11 +541,11 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4a").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4b").is_regular_file());
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir/4b1").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4b2").is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4a").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4b").stat().is_regular_file());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir/4b1").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4b2").stat().is_regular_file());
repo->invalidate();
{
@@ -563,8 +564,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo4"),
- n::root() = FSEntry("installed_repository_TEST_dir/root4")
+ n::location() = FSPath("installed_repository_TEST_dir/repo4"),
+ n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
env.package_database()->add_repository(0, repo);
@@ -586,11 +587,11 @@ namespace test_cases
parse_user_package_dep_spec("cat/pkg4a",
&env, { }), { }))]->begin())->perform_action(action);
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir/4a").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4b").is_regular_file());
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir/4b1").is_regular_file());
- TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir/4b2").is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir/4a").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4b").stat().is_regular_file());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir/4b1").stat().is_regular_file());
+ TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir/4b2").stat().is_regular_file());
repo->invalidate();
{
@@ -609,8 +610,8 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("installed_repository_TEST_dir/repo4"),
- n::root() = FSEntry("installed_repository_TEST_dir/root4")
+ n::location() = FSPath("installed_repository_TEST_dir/repo4"),
+ n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
env.package_database()->add_repository(0, repo);
@@ -632,7 +633,7 @@ namespace test_cases
parse_user_package_dep_spec("cat/pkg4b",
&env, { }), { }))]->begin())->perform_action(action);
- TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
+ TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
repo->invalidate();
{
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index cb02654df..56665e5f1 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/unpackaged/unpackaged_key.hh>
#include <paludis/repositories/unpackaged/unpackaged_stripper.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/log.hh>
@@ -29,6 +28,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -58,7 +58,7 @@ namespace paludis
std::shared_ptr<DependenciesLabelSequence> run_dependencies_labels;
const std::shared_ptr<LiteralMetadataValueKey<SlotName> > slot_key;
- const std::shared_ptr<LiteralMetadataValueKey<FSEntry> > fs_location_key;
+ const std::shared_ptr<LiteralMetadataValueKey<FSPath> > fs_location_key;
const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > build_dependencies_key;
const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key;
const std::shared_ptr<const MetadataValueKey<std::string> > description_key;
@@ -71,7 +71,7 @@ namespace paludis
const VersionSpec & v,
const SlotName & s,
const RepositoryName & n,
- const FSEntry & l,
+ const FSPath & l,
const std::string & b,
const std::string & r,
const std::string & d,
@@ -85,7 +85,7 @@ namespace paludis
build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
slot_key(std::make_shared<LiteralMetadataValueKey<SlotName> >("slot", "Slot", mkt_internal, s)),
- fs_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "Location", mkt_normal, l)),
+ fs_location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "Location", mkt_normal, l)),
build_dependencies_key(std::make_shared<UnpackagedDependencyKey>(env, "build_dependencies", "Build dependencies", mkt_dependencies,
build_dependencies_labels, b)),
run_dependencies_key(std::make_shared<UnpackagedDependencyKey>(env, "run_dependencies", "Run dependencies", mkt_dependencies,
@@ -106,7 +106,7 @@ namespace paludis
}
UnpackagedID::UnpackagedID(const Environment * const e, const QualifiedPackageName & q,
- const VersionSpec & v, const SlotName & s, const RepositoryName & n, const FSEntry & l,
+ const VersionSpec & v, const SlotName & s, const RepositoryName & n, const FSPath & l,
const std::string & b, const std::string & r, const std::string & d, const Tribool ds, const Tribool dw) :
Pimp<UnpackagedID>(e, q, v, s, n, l, b, r, d, ds, dw, this),
_imp(Pimp<UnpackagedID>::_imp)
@@ -292,7 +292,7 @@ UnpackagedID::from_repositories_key() const
return std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
UnpackagedID::fs_location_key() const
{
return _imp->fs_location_key;
@@ -349,11 +349,11 @@ namespace
return o;
}
- void installed_this(const FSEntry &)
+ void installed_this(const FSPath &)
{
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -376,9 +376,9 @@ UnpackagedID::perform_action(Action & action) const
std::shared_ptr<OutputManager> output_manager(install_action->options.make_output_manager()(*install_action));
std::string libdir("lib");
- FSEntry root(install_action->options.destination()->installed_root_key() ?
+ FSPath root(install_action->options.destination()->installed_root_key() ?
stringify(install_action->options.destination()->installed_root_key()->value()) : "/");
- if ((root / "usr" / "lib").is_symbolic_link())
+ if ((root / "usr" / "lib").stat().is_symlink())
{
libdir = (root / "usr" / "lib").readlink();
if (std::string::npos != libdir.find_first_of("./"))
@@ -433,9 +433,9 @@ UnpackagedID::perform_action(Action & action) const
(*install_action->options.destination()).destination_interface()->merge(
make_named_values<MergeParams>(
n::build_start_time() = build_start_time,
- n::environment_file() = FSEntry("/dev/null"),
+ n::environment_file() = FSPath("/dev/null"),
n::image_dir() = fs_location_key()->value(),
- n::merged_entries() = std::make_shared<FSEntrySet>(),
+ n::merged_entries() = std::make_shared<FSPathSet>(),
n::options() = (MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
| extra_merger_options,
n::output_manager() = output_manager,
diff --git a/paludis/repositories/unpackaged/unpackaged_id.hh b/paludis/repositories/unpackaged/unpackaged_id.hh
index 3d709cfb4..79159f3b8 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.hh
+++ b/paludis/repositories/unpackaged/unpackaged_id.hh
@@ -22,7 +22,6 @@
#include <paludis/package_id.hh>
#include <paludis/name-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/tribool.hh>
#include <memory>
@@ -45,7 +44,7 @@ namespace paludis
public:
UnpackagedID(const Environment * const, const QualifiedPackageName &, const VersionSpec &,
- const SlotName &, const RepositoryName &, const FSEntry &,
+ const SlotName &, const RepositoryName &, const FSPath &,
const std::string &, const std::string &, const std::string &,
const Tribool, const Tribool);
@@ -74,7 +73,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > long_description_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > contents_key() const;
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_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;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > choices_key() const;
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index 6f84a3a79..d66a0a68e 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/unpackaged/unpackaged_key.hh>
#include <paludis/repositories/unpackaged/unpackaged_id.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index b11941609..080ad0865 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -48,8 +48,8 @@ namespace paludis
std::shared_ptr<QualifiedPackageNameSet> package_names;
std::shared_ptr<CategoryNamePartSet> category_names;
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > install_under_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > install_under_key;
std::shared_ptr<const MetadataValueKey<long> > rewrite_ids_over_to_root_key;
std::shared_ptr<const MetadataValueKey<std::string> > name_key;
std::shared_ptr<const MetadataValueKey<std::string> > slot_key;
@@ -66,9 +66,9 @@ namespace paludis
ids(std::make_shared<PackageIDSequence>()),
package_names(std::make_shared<QualifiedPackageNameSet>()),
category_names(std::make_shared<CategoryNamePartSet>()),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- install_under_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("install_under", "install_under",
+ install_under_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("install_under", "install_under",
mkt_significant, params.install_under())),
rewrite_ids_over_to_root_key(std::make_shared<LiteralMetadataValueKey<long> >("rewrite_ids_over_to_root", "rewrite_ids_over_to_root",
mkt_normal, params.rewrite_ids_over_to_root())),
@@ -204,16 +204,16 @@ UnpackagedRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
UnpackagedRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
UnpackagedRepository::installed_root_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
std::shared_ptr<Repository>
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index c619b2ed3..f8a28a52b 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -50,8 +50,8 @@ namespace paludis
NamedValue<n::build_dependencies, std::string> build_dependencies;
NamedValue<n::description, std::string> description;
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::install_under, FSEntry> install_under;
- NamedValue<n::location, FSEntry> location;
+ NamedValue<n::install_under, FSPath> install_under;
+ NamedValue<n::location, FSPath> location;
NamedValue<n::name, QualifiedPackageName> name;
NamedValue<n::preserve_work, Tribool> preserve_work;
NamedValue<n::rewrite_ids_over_to_root, int> rewrite_ids_over_to_root;
@@ -114,8 +114,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/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 35a523078..985e4666e 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -33,6 +33,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -78,8 +79,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("unpackaged_repository_TEST_dir/pkg"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("unpackaged_repository_TEST_dir/pkg"),
n::name() = QualifiedPackageName("cat/pkg"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -110,8 +111,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("unpackaged_repository_TEST_dir/pkg"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("unpackaged_repository_TEST_dir/pkg"),
n::name() = QualifiedPackageName("cat/pkg"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -130,7 +131,7 @@ namespace test_cases
TEST_CHECK_EQUAL(id->name(), QualifiedPackageName("cat/pkg"));
TEST_CHECK_EQUAL(id->repository()->name(), RepositoryName("unpackaged"));
TEST_CHECK(bool(id->fs_location_key()));
- TEST_CHECK_EQUAL(id->fs_location_key()->value(), FSEntry("unpackaged_repository_TEST_dir/pkg"));
+ TEST_CHECK_EQUAL(id->fs_location_key()->value(), FSPath("unpackaged_repository_TEST_dir/pkg"));
}
} test_metadata;
@@ -147,8 +148,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("unpackaged_repository_TEST_dir/pkg"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("unpackaged_repository_TEST_dir/pkg"),
n::name() = QualifiedPackageName("cat/pkg"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -179,8 +180,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("unpackaged_repository_TEST_dir/pkg"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("unpackaged_repository_TEST_dir/pkg"),
n::name() = QualifiedPackageName("cat/pkg"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -222,8 +223,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/"),
- n::location() = FSEntry("unpackaged_repository_TEST_dir/pkg"),
+ n::install_under() = FSPath("/"),
+ n::location() = FSPath("unpackaged_repository_TEST_dir/pkg"),
n::name() = QualifiedPackageName("cat/pkg"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -238,12 +239,12 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("unpackaged_repository_TEST_dir/installed"),
- n::root() = FSEntry("unpackaged_repository_TEST_dir/root")
+ n::location() = FSPath("unpackaged_repository_TEST_dir/installed"),
+ n::root() = FSPath("unpackaged_repository_TEST_dir/root")
)));
env.package_database()->add_repository(0, installed_repo);
- TEST_CHECK(! FSEntry("unpackaged_repository_TEST_dir/root/first").is_regular_file());
+ TEST_CHECK(! FSPath("unpackaged_repository_TEST_dir/root/first").stat().is_regular_file());
const std::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
@@ -257,7 +258,7 @@ namespace test_cases
));
id->perform_action(action);
- TEST_CHECK(FSEntry("unpackaged_repository_TEST_dir/root/first").is_regular_file());
+ TEST_CHECK(FSPath("unpackaged_repository_TEST_dir/root/first").stat().is_regular_file());
}
bool repeatable() const
@@ -280,8 +281,8 @@ namespace test_cases
n::build_dependencies() = "",
n::description() = "",
n::environment() = &env,
- n::install_under() = FSEntry("/magic/pixie"),
- n::location() = FSEntry("unpackaged_repository_TEST_dir/under_pkg"),
+ n::install_under() = FSPath("/magic/pixie"),
+ n::location() = FSPath("unpackaged_repository_TEST_dir/under_pkg"),
n::name() = QualifiedPackageName("cat/pkg"),
n::preserve_work() = indeterminate,
n::rewrite_ids_over_to_root() = -1,
@@ -296,12 +297,12 @@ namespace test_cases
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
- n::location() = FSEntry("unpackaged_repository_TEST_dir/under_installed"),
- n::root() = FSEntry("unpackaged_repository_TEST_dir/under_root")
+ n::location() = FSPath("unpackaged_repository_TEST_dir/under_installed"),
+ n::root() = FSPath("unpackaged_repository_TEST_dir/under_root")
)));
env.package_database()->add_repository(0, installed_repo);
- TEST_CHECK(! FSEntry("unpackaged_repository_TEST_dir/under_root/magic/pixie/first").is_regular_file());
+ TEST_CHECK(! FSPath("unpackaged_repository_TEST_dir/under_root/magic/pixie/first").stat().is_regular_file());
const std::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
@@ -315,7 +316,7 @@ namespace test_cases
));
id->perform_action(action);
- TEST_CHECK(FSEntry("unpackaged_repository_TEST_dir/under_root/magic/pixie/first").is_regular_file());
+ TEST_CHECK(FSPath("unpackaged_repository_TEST_dir/under_root/magic/pixie/first").stat().is_regular_file());
}
bool repeatable() const
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.cc b/paludis/repositories/unpackaged/unpackaged_stripper.cc
index 244357a51..62be8cf46 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.cc
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/repositories/unpackaged/unpackaged_stripper.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/output_manager.hh>
@@ -58,31 +57,31 @@ UnpackagedStripper::~UnpackagedStripper()
}
void
-UnpackagedStripper::on_strip(const FSEntry & f)
+UnpackagedStripper::on_strip(const FSPath & f)
{
_imp->options.output_manager()->stdout_stream() << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
-UnpackagedStripper::on_split(const FSEntry & f, const FSEntry & g)
+UnpackagedStripper::on_split(const FSPath & f, const FSPath & g)
{
_imp->options.output_manager()->stdout_stream() << "spl " << f.strip_leading(_imp->options.image_dir()) <<
" -> " << g.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
-UnpackagedStripper::on_unknown(const FSEntry & f)
+UnpackagedStripper::on_unknown(const FSPath & f)
{
_imp->options.output_manager()->stdout_stream() << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
-UnpackagedStripper::on_enter_dir(const FSEntry &)
+UnpackagedStripper::on_enter_dir(const FSPath &)
{
}
void
-UnpackagedStripper::on_leave_dir(const FSEntry &)
+UnpackagedStripper::on_leave_dir(const FSPath &)
{
}
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.hh b/paludis/repositories/unpackaged/unpackaged_stripper.hh
index 846ba1568..51b1924fe 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.hh
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.hh
@@ -41,8 +41,8 @@ namespace paludis
{
struct UnpackagedStripperOptions
{
- NamedValue<n::debug_dir, FSEntry> debug_dir;
- NamedValue<n::image_dir, FSEntry> image_dir;
+ NamedValue<n::debug_dir, FSPath> debug_dir;
+ NamedValue<n::image_dir, FSPath> image_dir;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
NamedValue<n::split, bool> split;
@@ -57,11 +57,11 @@ namespace paludis
Pimp<UnpackagedStripper>::ImpPtr & _imp;
protected:
- virtual void on_strip(const FSEntry &);
- virtual void on_split(const FSEntry &, const FSEntry &);
- virtual void on_enter_dir(const FSEntry &);
- virtual void on_leave_dir(const FSEntry &);
- virtual void on_unknown(const FSEntry &);
+ virtual void on_strip(const FSPath &);
+ virtual void on_split(const FSPath &, const FSPath &);
+ virtual void on_enter_dir(const FSPath &);
+ virtual void on_leave_dir(const FSPath &);
+ virtual void on_unknown(const FSPath &);
public:
UnpackagedStripper(const UnpackagedStripperOptions &);