aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 20:43:51 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 20:43:51 +0000
commitd6c5459b86ebd17951b3e9ddfb728c457c2e43c1 (patch)
tree6043b2bb8c5f4dc6bd3a3e3b16f12c46803246f7
parent903ff5be1f3b164db5a8c66714831c9687d1c1c2 (diff)
downloadpaludis-d6c5459b86ebd17951b3e9ddfb728c457c2e43c1.tar.gz
paludis-d6c5459b86ebd17951b3e9ddfb728c457c2e43c1.tar.xz
kill more sr
-rw-r--r--paludis/repositories/unpackaged/Makefile.am15
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc29
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh15
-rw-r--r--paludis/repositories/unpackaged/installed_repository.sr14
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc120
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc20
6 files changed, 98 insertions, 115 deletions
diff --git a/paludis/repositories/unpackaged/Makefile.am b/paludis/repositories/unpackaged/Makefile.am
index 8aca0d6..8d0be18 100644
--- a/paludis/repositories/unpackaged/Makefile.am
+++ b/paludis/repositories/unpackaged/Makefile.am
@@ -1,7 +1,5 @@
SUBDIRS = .
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.loT *.epicfail
-DISTCLEANFILES = \
- installed_repository-sr.hh installed_repository-sr.cc
MAINTAINERCLEANFILES = Makefile.in
@@ -27,7 +25,6 @@ paludis_repositories_unpackaged_include_HEADERS = \
unpackaged_key.hh \
unpackaged_stripper.hh \
installed_repository.hh \
- installed_repository-sr.hh \
installed_id.hh
libpaludisunpackagedrepository_@PALUDIS_PC_SLOT@_la_SOURCES = \
@@ -88,15 +85,9 @@ EXTRA_DIST = \
installed_repository_TEST.cc \
installed_repository_TEST_setup.sh \
installed_repository_TEST_cleanup.sh \
- installed_repository.sr \
- installed_repository-sr.hh \
- installed_repository-sr.cc \
installed_id.cc \
dep_parser_TEST.cc
-BUILT_SOURCES = \
- installed_repository-sr.hh installed_repository-sr.cc
-
check_SCRIPTS = \
unpackaged_repository_TEST_setup.sh \
unpackaged_repository_TEST_cleanup.sh \
@@ -128,12 +119,6 @@ check_PROGRAMS = $(TESTS)
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-installed_repository-sr.hh : installed_repository.sr $(top_srcdir)/misc/make_sr.bash
- if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/installed_repository.sr > $@ ; then rm -f $@ ; exit 1 ; fi
-
-installed_repository-sr.cc : installed_repository.sr $(top_srcdir)/misc/make_sr.bash
- if ! $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/installed_repository.sr > $@ ; then rm -f $@ ; exit 1 ; fi
-
distcheck-deps-local : $(DISTCHECK_DEPS)
distcheck-deps : distcheck-deps-subdirs
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 94ae92b..8177658 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -46,8 +46,6 @@
using namespace paludis;
using namespace paludis::unpackaged_repositories;
-#include <paludis/repositories/unpackaged/installed_repository-sr.cc>
-
namespace
{
bool supported_installed_unpackaged(const std::string & s)
@@ -70,11 +68,11 @@ namespace paludis
Implementation(const InstalledUnpackagedRepositoryParams & p) :
params(p),
- ndbam(p.location, &supported_installed_unpackaged, "installed_unpackaged-1"),
+ ndbam(p.location(), &supported_installed_unpackaged, "installed_unpackaged-1"),
location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
- mkt_significant, params.location)),
+ mkt_significant, params.location())),
root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
- mkt_normal, params.root)),
+ mkt_normal, params.root())),
format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "installed_unpackaged"))
{
@@ -85,7 +83,7 @@ namespace paludis
InstalledUnpackagedRepository::InstalledUnpackagedRepository(
const RepositoryName & n, const InstalledUnpackagedRepositoryParams & p) :
PrivateImplementationPattern<InstalledUnpackagedRepository>(new Implementation<InstalledUnpackagedRepository>(p)),
- Repository(p.environment, n, make_named_values<RepositoryCapabilities>(
+ Repository(p.environment(), n, make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
@@ -128,7 +126,7 @@ InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q) const
{
Lock l(*(*e).mutex());
if (! (*e).package_id())
- (*e).package_id().reset(new InstalledUnpackagedID(_imp->params.environment, (*e).name(), (*e).version(),
+ (*e).package_id().reset(new InstalledUnpackagedID(_imp->params.environment(), (*e).name(), (*e).version(),
(*e).slot(), name(), (*e).fs_location(), (*e).magic(), installed_root_key()->value(), &_imp->ndbam));
result->push_back((*e).package_id());
}
@@ -296,7 +294,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
}
}
- FSEntry uid_dir(_imp->params.location);
+ FSEntry uid_dir(_imp->params.location());
if (if_same_name_id)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
@@ -354,9 +352,9 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
value_for<n::config_protect>(getenv_with_default("CONFIG_PROTECT", "")),
value_for<n::config_protect_mask>(getenv_with_default("CONFIG_PROTECT_MASK", "")),
value_for<n::contents_file>(target_ver_dir / "contents"),
- value_for<n::environment>(_imp->params.environment),
+ value_for<n::environment>(_imp->params.environment()),
value_for<n::get_new_ids_or_minus_one>(std::tr1::bind(&get_new_ids_or_minus_one,
- _imp->params.environment, rewrite_ids_over_to_root, _1)),
+ _imp->params.environment(), rewrite_ids_over_to_root, _1)),
value_for<n::image>(m.image_dir()),
value_for<n::install_under>(install_under),
value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
@@ -392,7 +390,7 @@ InstalledUnpackagedRepository::is_suitable_destination_for(const PackageID & e)
bool
InstalledUnpackagedRepository::is_default_destination() const
{
- return _imp->params.environment->root() == installed_root_key()->value();
+ return _imp->params.environment()->root() == installed_root_key()->value();
}
bool
@@ -502,10 +500,11 @@ InstalledUnpackagedRepository::repository_factory_create(
throw unpackaged_repositories::RepositoryConfigurationError("Key 'root' not specified or empty");
return make_shared_ptr(new InstalledUnpackagedRepository(RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(env)
- .location(location)
- .root(root)));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(env),
+ value_for<n::location>(location),
+ value_for<n::root>(root)
+ )));
}
RepositoryName
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index af44040..70dca38 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -23,12 +23,25 @@
#include <paludis/repository.hh>
#include <paludis/util/map.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/named_value.hh>
namespace paludis
{
+ namespace n
+ {
+ struct environment;
+ struct location;
+ struct root;
+ }
+
namespace unpackaged_repositories
{
-#include <paludis/repositories/unpackaged/installed_repository-sr.hh>
+ struct InstalledUnpackagedRepositoryParams
+ {
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::location, FSEntry> location;
+ NamedValue<n::root, FSEntry> root;
+ };
}
class PALUDIS_VISIBLE InstalledUnpackagedRepository :
diff --git a/paludis/repositories/unpackaged/installed_repository.sr b/paludis/repositories/unpackaged/installed_repository.sr
deleted file mode 100644
index 83ffdf7..0000000
--- a/paludis/repositories/unpackaged/installed_repository.sr
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-make_class_InstalledUnpackagedRepositoryParams()
-{
- visible
-
- key environment "Environment *"
- key location FSEntry
- key root FSEntry
-
- allow_named_args
-}
-
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index c6d7e94..1c1e892 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -96,11 +96,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo1"))
- .root(FSEntry("installed_repository_TEST_dir/root"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo1")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageIDSequence> ids(
@@ -119,11 +119,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo1"))
- .root(FSEntry("installed_repository_TEST_dir/root"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo1")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
@@ -173,11 +173,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo1"))
- .root(FSEntry("installed_repository_TEST_dir/root"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo1")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
@@ -203,11 +203,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo1"))
- .root(FSEntry("installed_repository_TEST_dir/root"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo1")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root"))
+ )));
env.package_database()->add_repository(1, repo);
TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<InstallAction>()));
@@ -240,11 +240,11 @@ namespace test_cases
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo2"))
- .root(FSEntry("installed_repository_TEST_dir/root2"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo2")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root2"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
@@ -292,11 +292,11 @@ namespace test_cases
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo3"))
- .root(FSEntry("installed_repository_TEST_dir/root3"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo3")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root3"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
@@ -343,11 +343,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo4"))
- .root(FSEntry("installed_repository_TEST_dir/root4"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo4")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root4"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
@@ -362,11 +362,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo4"))
- .root(FSEntry("installed_repository_TEST_dir/root4"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo4")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root4"))
+ )));
env.package_database()->add_repository(0, repo);
std::tr1::shared_ptr<Repository> source_repo(new UnpackagedRepository(
@@ -417,11 +417,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo4"))
- .root(FSEntry("installed_repository_TEST_dir/root4"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo4")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root4"))
+ )));
env.package_database()->add_repository(0, repo);
std::tr1::shared_ptr<Repository> source_repo(new UnpackagedRepository(
@@ -474,11 +474,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo4"))
- .root(FSEntry("installed_repository_TEST_dir/root4"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo4")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root4"))
+ )));
env.package_database()->add_repository(0, repo);
std::tr1::shared_ptr<Repository> source_repo(new UnpackagedRepository(
@@ -531,11 +531,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo4"))
- .root(FSEntry("installed_repository_TEST_dir/root4"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo4")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root4"))
+ )));
env.package_database()->add_repository(0, repo);
{
@@ -573,11 +573,11 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("installed_repository_TEST_dir/repo4"))
- .root(FSEntry("installed_repository_TEST_dir/root4"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/repo4")),
+ value_for<n::root>(FSEntry("installed_repository_TEST_dir/root4"))
+ )));
env.package_database()->add_repository(0, repo);
{
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 069ea9d..cce5e24 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -212,11 +212,11 @@ namespace test_cases
std::tr1::shared_ptr<Repository> installed_repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("unpackaged_repository_TEST_dir/installed"))
- .root(FSEntry("unpackaged_repository_TEST_dir/root"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/installed")),
+ value_for<n::root>(FSEntry("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());
@@ -265,11 +265,11 @@ namespace test_cases
std::tr1::shared_ptr<Repository> installed_repo(new InstalledUnpackagedRepository(
RepositoryName("installed-unpackaged"),
- unpackaged_repositories::InstalledUnpackagedRepositoryParams::create()
- .environment(&env)
- .location(FSEntry("unpackaged_repository_TEST_dir/under_installed"))
- .root(FSEntry("unpackaged_repository_TEST_dir/under_root"))
- ));
+ make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/under_installed")),
+ value_for<n::root>(FSEntry("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());