aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-06-05 08:19:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-06-05 08:19:38 +0000
commiteb5e4287cbce8cc37b302259530e249881769f11 (patch)
treed32279847ba27696277542d8b43de4a6a8400ee3
parent1daabfc5420d0b1fb0ffb817dcb2a7926704451c (diff)
downloadpaludis-eb5e4287cbce8cc37b302259530e249881769f11.tar.gz
paludis-eb5e4287cbce8cc37b302259530e249881769f11.tar.xz
r3293@snowflake: ciaranm | 2007-06-05 09:18:06 +0100
Allow environments, environment.conf to define distribution
-rw-r--r--paludis/dep_list/dep_list.cc3
-rw-r--r--paludis/distribution.cc13
-rw-r--r--paludis/distribution.hh5
-rw-r--r--paludis/environment-fwd.hh55
-rw-r--r--paludis/environment.hh30
-rw-r--r--paludis/environment_implementation.cc7
-rw-r--r--paludis/environment_implementation.hh3
-rw-r--r--paludis/environments/adapted/adapted_environment.cc6
-rw-r--r--paludis/environments/adapted/adapted_environment.hh3
-rw-r--r--paludis/environments/environment_maker.cc5
-rw-r--r--paludis/environments/no_config/no_config_environment.cc4
-rw-r--r--paludis/environments/paludis/paludis_config.cc21
-rw-r--r--paludis/environments/paludis/paludis_config.hh5
-rw-r--r--paludis/environments/paludis/paludis_environment.cc6
-rw-r--r--paludis/environments/paludis/paludis_environment.hh3
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/repositories/fake/fake_repository.cc4
-rw-r--r--paludis/repositories/gems/registration.cc5
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc3
-rw-r--r--paludis/repositories/gentoo/make_ebuild_repository.cc15
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc5
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.cc5
-rw-r--r--paludis/repositories/virtuals/registration.cc8
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/options-fwd.hh31
-rw-r--r--paludis/util/options.hh1
-rw-r--r--vim/syntax/paludis-environment-conf.vim2
27 files changed, 184 insertions, 68 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 341c1bc..5de4820 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -1024,7 +1024,8 @@ DepList::add_package(const PackageDatabaseEntry & p, tr1::shared_ptr<const DepTa
DepSpecFlattener f(_imp->env, _imp->current_pde());
metadata->ebuild_interface->provide()->accept(f);
- if (f.begin() != f.end() && ! DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (f.begin() != f.end() && ! DistributionData::get_instance()->distribution_from_string(
+ _imp->env->default_distribution())->support_old_style_virtuals)
throw DistributionConfigurationError("Package '" + stringify(p) + "' has PROVIDEs, but this distribution "
"does not support old style virtuals");
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index a8488ee..832d0b0 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -29,7 +29,6 @@
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include "config.h"
using namespace paludis;
@@ -101,15 +100,3 @@ DistributionData::distribution_from_string(const std::string & s) const
return i->second;
}
-tr1::shared_ptr<const Distribution>
-DistributionData::default_distribution() const
-{
- if (_imp->default_distribution)
- return _imp->default_distribution;
-
- _imp->default_distribution = distribution_from_string(getenv_with_default("PALUDIS_DISTRIBUTION", DEFAULT_DISTRIBUTION));
- if (! _imp->default_distribution)
- throw DistributionConfigurationError("No default distribution configuration available");
- return _imp->default_distribution;
-}
-
diff --git a/paludis/distribution.hh b/paludis/distribution.hh
index 1cfa957..f33584a 100644
--- a/paludis/distribution.hh
+++ b/paludis/distribution.hh
@@ -72,11 +72,6 @@ namespace paludis
* Fetch a distribution from a named string.
*/
tr1::shared_ptr<const Distribution> distribution_from_string(const std::string &) const;
-
- /**
- * Fetch the default distribution.
- */
- tr1::shared_ptr<const Distribution> default_distribution() const;
};
}
diff --git a/paludis/environment-fwd.hh b/paludis/environment-fwd.hh
new file mode 100644
index 0000000..a57c727
--- /dev/null
+++ b/paludis/environment-fwd.hh
@@ -0,0 +1,55 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENT_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_FWD_HH 1
+
+#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/options-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <iosfwd>
+
+namespace paludis
+{
+ class PackageDatabase;
+ class PackageDatabaseEntry;
+
+#include <paludis/environment-se.hh>
+
+ /**
+ * Options for Environment::mask_reasons().
+ *
+ * \see Environment
+ * \see MaskReasonsOption
+ * \ingroup grpenvironment
+ */
+ typedef Options<MaskReasonsOption> MaskReasonsOptions;
+
+ /**
+ * A collection of mirror prefixes.
+ *
+ * \see Environment
+ * \ingroup grpenvironment
+ */
+ typedef SequentialCollection<std::string> MirrorsCollection;
+
+ class Environment;
+}
+
+#endif
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 49b9e7d..328937d 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -20,6 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENT_HH
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_HH 1
+#include <paludis/environment-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/options.hh>
#include <paludis/util/collection.hh>
@@ -38,27 +39,6 @@
namespace paludis
{
- class PackageDatabase;
- class PackageDatabaseEntry;
-
-#include <paludis/environment-se.hh>
-
- /**
- * Options for Environment::mask_reasons().
- *
- * \see Environment
- * \see MaskReasonsOption
- * \ingroup grpenvironment
- */
- typedef Options<MaskReasonsOption> MaskReasonsOptions;
-
- /**
- * A collection of mirror prefixes.
- *
- * \see Environment
- * \ingroup grpenvironment
- */
- typedef SequentialCollection<std::string> MirrorsCollection;
/**
* Represents a working environment, which contains an available packages
@@ -263,6 +243,14 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
+
+ ///\name Distribution information
+ ///\{
+
+ virtual std::string default_distribution() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ ///\}
};
}
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 1e41d2a..da5c577 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -27,6 +27,7 @@
#include <paludis/util/save.hh>
#include <paludis/eapi.hh>
#include <algorithm>
+#include "config.h"
using namespace paludis;
@@ -421,3 +422,9 @@ EnvironmentImplementation::local_set(const SetName &) const
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
+std::string
+EnvironmentImplementation::default_distribution() const
+{
+ return DEFAULT_DISTRIBUTION;
+}
+
diff --git a/paludis/environment_implementation.hh b/paludis/environment_implementation.hh
index 942d94a..8384a3e 100644
--- a/paludis/environment_implementation.hh
+++ b/paludis/environment_implementation.hh
@@ -157,6 +157,9 @@ namespace paludis
virtual HookResult perform_hook(const Hook &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string default_distribution() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/environments/adapted/adapted_environment.cc b/paludis/environments/adapted/adapted_environment.cc
index 8b67c62..fa12207 100644
--- a/paludis/environments/adapted/adapted_environment.cc
+++ b/paludis/environments/adapted/adapted_environment.cc
@@ -212,3 +212,9 @@ AdaptedEnvironment::perform_hook(const Hook & h) const
return _imp->env->perform_hook(h);
}
+std::string
+AdaptedEnvironment::default_distribution() const
+{
+ return _imp->env->default_distribution();
+}
+
diff --git a/paludis/environments/adapted/adapted_environment.hh b/paludis/environments/adapted/adapted_environment.hh
index ca6f1f0..0de2aa9 100644
--- a/paludis/environments/adapted/adapted_environment.hh
+++ b/paludis/environments/adapted/adapted_environment.hh
@@ -116,6 +116,9 @@ namespace paludis
virtual HookResult perform_hook(const Hook &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string default_distribution() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/environments/environment_maker.cc b/paludis/environments/environment_maker.cc
index 0b6c1bd..f4b9bd9 100644
--- a/paludis/environments/environment_maker.cc
+++ b/paludis/environments/environment_maker.cc
@@ -31,6 +31,7 @@
#include <set>
#include <dlfcn.h>
#include <stdint.h>
+#include "config.h"
using namespace paludis;
@@ -150,7 +151,7 @@ EnvironmentMaker::make_from_spec(const std::string & s) const
}
if (key.empty())
- key = DistributionData::get_instance()->default_distribution()->default_environment;
+ key = DistributionData::get_instance()->distribution_from_string(DEFAULT_DISTRIBUTION)->default_environment;
try
{
@@ -158,7 +159,7 @@ EnvironmentMaker::make_from_spec(const std::string & s) const
}
catch (const FallBackToAnotherMakerError &)
{
- std::string f(DistributionData::get_instance()->default_distribution()->fallback_environment);
+ std::string f(DistributionData::get_instance()->distribution_from_string(DEFAULT_DISTRIBUTION)->fallback_environment);
if (s.empty() && ! f.empty())
{
std::set<std::string> keys;
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 17bf1b2..9926be8 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -164,7 +164,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
package_database->add_repository(2, ((main_repo =
RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys))));
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (DistributionData::get_instance()->distribution_from_string(env->default_distribution())->support_old_style_virtuals)
package_database->add_repository(-2, RepositoryMaker::get_instance()->find_maker("virtuals")(env,
tr1::shared_ptr<AssociativeCollection<std::string, std::string> >()));
}
@@ -186,7 +186,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
new AssociativeCollection<std::string, std::string>::Concrete);
iv_keys->insert("root", "/");
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (DistributionData::get_instance()->distribution_from_string(env->default_distribution())->support_old_style_virtuals)
package_database->add_repository(-2, RepositoryMaker::get_instance()->find_maker("installed_virtuals")(env,
iv_keys));
}
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index c34fd87..8119b84 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -53,6 +53,8 @@
#include <sys/types.h>
#include <pwd.h>
+#include "config.h"
+
/** \file
* Implementation of paludis_config.hh classes.
*
@@ -80,6 +82,7 @@ namespace paludis
std::string paludis_command;
std::string root;
std::string config_dir;
+ mutable std::string distribution;
tr1::shared_ptr<FSEntryCollection> bashrc_files;
std::list<RepositoryConfigEntry> repos;
@@ -165,6 +168,7 @@ namespace paludis
"Key 'reduced_username' is unset, using '" + reduced_username + "'");
accept_breaks_portage = kv->get("portage_compatible").empty();
+ distribution = kv->get("distribution");
}
has_environment_conf = true;
@@ -230,7 +234,6 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
_imp->root = root_prefix;
_imp->config_dir = stringify(local_config_dir);
-
/* check that we can safely use userpriv */
{
Command cmd(Command("ls -ld '" + stringify(local_config_dir) + "'/* >/dev/null 2>/dev/null")
@@ -256,7 +259,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
{
/* add virtuals repositories */
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (DistributionData::get_instance()->distribution_from_string(e->default_distribution())->support_old_style_virtuals)
{
tr1::shared_ptr<AssociativeCollection<std::string, std::string> > iv_keys(
new AssociativeCollection<std::string, std::string>::Concrete);
@@ -669,3 +672,17 @@ PaludisConfig::mirrors_conf() const
return _imp->mirrors_conf;
}
+std::string
+PaludisConfig::distribution() const
+{
+ if (! _imp->distribution.empty())
+ return _imp->distribution;
+
+ _imp->need_environment_conf();
+
+ if (_imp->distribution.empty())
+ _imp->distribution = DEFAULT_DISTRIBUTION;
+
+ return _imp->distribution;
+}
+
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index eb534c7..a417dac 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -159,6 +159,11 @@ namespace paludis
* The config directory.
*/
std::string config_dir() const;
+
+ /**
+ * The distribution.
+ */
+ std::string distribution() const;
};
}
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index f9674e2..e98fd5f 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -436,3 +436,9 @@ PaludisEnvironment::package_database() const
return _imp->package_database;
}
+std::string
+PaludisEnvironment::default_distribution() const
+{
+ return _imp->config->distribution();
+}
+
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index d043d02..326d98e 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -132,6 +132,9 @@ namespace paludis
virtual tr1::shared_ptr<const PackageDatabase> package_database() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string default_distribution() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
#endif
diff --git a/paludis/files.m4 b/paludis/files.m4
index 6e57906..3fe5fce 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -17,7 +17,7 @@ add(`dep_spec_pretty_printer', `hh', `cc', `test')
add(`dep_tag', `hh', `cc', `fwd', `sr')
add(`distribution', `hh', `cc', `fwd', `sr')
add(`eapi', `hh', `cc', `fwd', `sr')
-add(`environment', `hh', `cc', `se')
+add(`environment', `hh', `fwd', `cc', `se')
add(`environment_implementation', `hh', `cc', `test')
add(`hashed_containers', `hh', `cc', `test')
add(`hook', `hh', `cc', `se', `sr')
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 11551fd..d9f9abf 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -22,6 +22,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/distribution.hh>
+#include <paludis/environment.hh>
using namespace paludis;
@@ -39,7 +40,8 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName
.mirrors_interface(0)
.environment_variable_interface(0)
.provides_interface(0)
- .virtuals_interface(DistributionData::get_instance()->default_distribution()->support_old_style_virtuals ? this : 0)
+ .virtuals_interface(DistributionData::get_instance()->distribution_from_string(
+ e->default_distribution())->support_old_style_virtuals ? this : 0)
.config_interface(0)
.destination_interface(0)
.licenses_interface(0)
diff --git a/paludis/repositories/gems/registration.cc b/paludis/repositories/gems/registration.cc
index 18f1a32..67002ad 100644
--- a/paludis/repositories/gems/registration.cc
+++ b/paludis/repositories/gems/registration.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/gems/exceptions.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/distribution.hh>
+#include <paludis/environment.hh>
using namespace paludis;
@@ -48,7 +49,7 @@ namespace
std::string buildroot;
if (m->end() == m->find("buildroot") || ((buildroot = m->find("buildroot")->second)).empty())
- buildroot = DistributionData::get_instance()->default_distribution()->default_ebuild_build_root;
+ buildroot = DistributionData::get_instance()->distribution_from_string(env->default_distribution())->default_ebuild_build_root;
return make_shared_ptr(new GemsRepository(gems::RepositoryParams::create()
.location(location)
@@ -69,7 +70,7 @@ namespace
std::string buildroot;
if (m->end() == m->find("buildroot") || ((buildroot = m->find("buildroot")->second)).empty())
- buildroot = DistributionData::get_instance()->default_distribution()->default_ebuild_build_root;
+ buildroot = DistributionData::get_instance()->distribution_from_string(env->default_distribution())->default_ebuild_build_root;
return make_shared_ptr(new InstalledGemsRepository(gems::InstalledRepositoryParams::create()
.location(location)
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index 29455b7..cd68e3d 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -149,7 +149,8 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
"-" + stringify(v) + "' in '" + stringify(_imp->portage_repository->name()) + "'");
tr1::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
- DistributionData::get_instance()->default_distribution()->eapi_when_unknown));
+ DistributionData::get_instance()->distribution_from_string(
+ _imp->environment->default_distribution())->eapi_when_unknown));
EAPIPhases phases(eapi->supported->ebuild_phases->ebuild_metadata);
int c(std::distance(phases.begin_phases(), phases.end_phases()));
diff --git a/paludis/repositories/gentoo/make_ebuild_repository.cc b/paludis/repositories/gentoo/make_ebuild_repository.cc
index 1e41c18..2ca32b4 100644
--- a/paludis/repositories/gentoo/make_ebuild_repository.cc
+++ b/paludis/repositories/gentoo/make_ebuild_repository.cc
@@ -101,7 +101,8 @@ paludis::make_ebuild_repository(
distdir = stringify(master_repository->params().distdir);
else
{
- distdir = DistributionData::get_instance()->default_distribution()->default_ebuild_distdir;
+ distdir = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_distdir;
if (distdir.empty())
distdir = location + "/distfiles";
else if ('/' != distdir.at(0))
@@ -140,12 +141,14 @@ paludis::make_ebuild_repository(
std::string write_cache;
if (m->end() == m->find("write_cache") || ((write_cache = m->find("write_cache")->second)).empty())
- write_cache = DistributionData::get_instance()->default_distribution()->default_ebuild_write_cache;
+ write_cache = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_write_cache;
std::string names_cache;
if (m->end() == m->find("names_cache") || ((names_cache = m->find("names_cache")->second)).empty())
{
- names_cache = DistributionData::get_instance()->default_distribution()->default_ebuild_names_cache;
+ names_cache = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_names_cache;
if (names_cache.empty())
{
Log::get_instance()->message(ll_warning, lc_no_context, "The names_cache key is not set in '"
@@ -174,11 +177,13 @@ paludis::make_ebuild_repository(
std::string buildroot;
if (m->end() == m->find("buildroot") || ((buildroot = m->find("buildroot")->second)).empty())
- buildroot = DistributionData::get_instance()->default_distribution()->default_ebuild_build_root;
+ buildroot = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_build_root;
std::string layout;
if (m->end() == m->find("layout") || ((layout = m->find("layout")->second)).empty())
- layout = DistributionData::get_instance()->default_distribution()->default_ebuild_layout;
+ layout = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_layout;
return tr1::shared_ptr<PortageRepository>(new PortageRepository(PortageRepositoryParams::create()
.entry_format("ebuild")
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index 18b7ceb..81da75a 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -260,7 +260,8 @@ PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
.world_interface(0)
.environment_variable_interface(this)
.mirrors_interface(this)
- .virtuals_interface(DistributionData::get_instance()->default_distribution()->support_old_style_virtuals ? this : 0)
+ .virtuals_interface(DistributionData::get_instance()->distribution_from_string(
+ p.environment->default_distribution())->support_old_style_virtuals ? this : 0)
.provides_interface(0)
.contents_interface(0)
.config_interface(0)
@@ -924,7 +925,7 @@ PortageRepository::set_profile(const ProfilesIterator & iter)
_imp->profile_ptr = iter->profile;
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (DistributionData::get_instance()->distribution_from_string(_imp->params.environment->default_distribution())->support_old_style_virtuals)
if (_imp->params.environment->package_database()->has_repository_named(RepositoryName("virtuals")))
_imp->params.environment->package_database()->fetch_repository(
RepositoryName("virtuals"))->invalidate();
diff --git a/paludis/repositories/gentoo/portage_repository_profile.cc b/paludis/repositories/gentoo/portage_repository_profile.cc
index 6e6f2c4..ec770ea 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.cc
+++ b/paludis/repositories/gentoo/portage_repository_profile.cc
@@ -218,7 +218,7 @@ Implementation<PortageRepositoryProfile>::load_profile_directory_recursively(con
load_spec_use_file(dir / "package.use.force", stacked_values_list.back().package_use_force);
packages_file.add_file(dir / "packages");
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (DistributionData::get_instance()->distribution_from_string(env->default_distribution())->support_old_style_virtuals)
virtuals_file.add_file(dir / "virtuals");
package_mask_file.add_file(dir / "package.mask");
}
@@ -400,7 +400,8 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
" failed due to exception: " + e.message() + " (" + e.what() + ")");
}
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
+ if (DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->support_old_style_virtuals)
try
{
for (ProfileFile::Iterator line(virtuals_file.begin()), line_end(virtuals_file.end()) ;
diff --git a/paludis/repositories/virtuals/registration.cc b/paludis/repositories/virtuals/registration.cc
index 4012108..67d0f0e 100644
--- a/paludis/repositories/virtuals/registration.cc
+++ b/paludis/repositories/virtuals/registration.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/repository_maker.hh>
#include <paludis/repositories/virtuals/installed_virtuals_repository.hh>
#include <paludis/repositories/virtuals/virtuals_repository.hh>
-#include <paludis/distribution.hh>
#include "config.h"
using namespace paludis;
@@ -34,11 +33,8 @@ extern "C"
void register_repositories(RepositoryMaker * maker)
{
- if (DistributionData::get_instance()->default_distribution()->support_old_style_virtuals)
- {
- maker->register_maker("virtuals", &VirtualsRepository::make_virtuals_repository);
- maker->register_maker("installed_virtuals", &InstalledVirtualsRepository::make_installed_virtuals_repository);
- }
+ maker->register_maker("virtuals", &VirtualsRepository::make_virtuals_repository);
+ maker->register_maker("installed_virtuals", &InstalledVirtualsRepository::make_installed_virtuals_repository);
}
#endif
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 5f41759..492ec49 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -27,7 +27,7 @@ add(`join', `hh', `test')
add(`log', `hh', `cc', `se', `test')
add(`make_shared_ptr', `hh', `fwd')
add(`operators', `hh')
-add(`options', `hh', `cc', `test')
+add(`options', `hh', `fwd', `cc', `test')
add(`output_wrapper', `test', `testscript')
add(`pipe', `hh', `cc')
add(`private_implementation_pattern', `hh', `impl')
diff --git a/paludis/util/options-fwd.hh b/paludis/util/options-fwd.hh
new file mode 100644
index 0000000..84ecb86
--- /dev/null
+++ b/paludis/util/options-fwd.hh
@@ -0,0 +1,31 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_OPTIONS_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_OPTIONS_FWD_HH 1
+
+namespace paludis
+{
+ class OptionsStore;
+
+ template <typename E_>
+ class Options;
+}
+
+#endif
diff --git a/paludis/util/options.hh b/paludis/util/options.hh
index 04ed849..54b8d16 100644
--- a/paludis/util/options.hh
+++ b/paludis/util/options.hh
@@ -20,6 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_UTIL_OPTIONS_HH
#define PALUDIS_GUARD_PALUDIS_UTIL_OPTIONS_HH 1
+#include <paludis/util/options-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
namespace paludis
diff --git a/vim/syntax/paludis-environment-conf.vim b/vim/syntax/paludis-environment-conf.vim
index 0dd7452..12804a0 100644
--- a/vim/syntax/paludis-environment-conf.vim
+++ b/vim/syntax/paludis-environment-conf.vim
@@ -38,7 +38,7 @@ syn region PaludisEnvironmentConfString contained start=/"/ end=/"/
\ skipwhite
syn keyword PaludisEnvironmentConfKnownKey contained
- \ reduced_username portage_compatible
+ \ reduced_username portage_compatible distribution
syn match PaludisEnvironmentConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite