aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-11 02:50:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-11 02:50:13 +0000
commitdb2031e30ae841d229ed510edc7b53584be4f829 (patch)
tree2f9d8e3a94e7cf726925a951a7f950fa5a5774b7
parent8d8da1b3e919fe05871046cecef6bcaf1da2e68b (diff)
downloadpaludis-db2031e30ae841d229ed510edc7b53584be4f829.tar.gz
paludis-db2031e30ae841d229ed510edc7b53584be4f829.tar.xz
Add support for multiple eclass directories and multiple profile directories in Portage repositores. The 'eclassdir' and 'profiledir' keys are now deprecated in favour of 'eclassdirs' and 'profiledirs'.
-rw-r--r--ebuild/builtin_merge.bash12
-rwxr-xr-xebuild/ebuild.bash6
-rw-r--r--ebuild/eclass_functions.bash7
-rw-r--r--paludis/ebuild.cc12
-rw-r--r--paludis/ebuild.hh12
-rw-r--r--paludis/portage_repository.cc190
-rw-r--r--paludis/portage_repository.hh8
-rw-r--r--paludis/util/fs_entry.cc2
-rw-r--r--paludis/util/fs_entry.hh16
-rw-r--r--paludis/vdb_repository.cc7
-rwxr-xr-xsrc/install_TEST_setup.sh28
11 files changed, 183 insertions, 117 deletions
diff --git a/ebuild/builtin_merge.bash b/ebuild/builtin_merge.bash
index ff2ac5d..d9e5b07 100644
--- a/ebuild/builtin_merge.bash
+++ b/ebuild/builtin_merge.bash
@@ -46,9 +46,17 @@ builtin_merge()
fi
[[ -f "${EBUILD}" ]] && cp "${EBUILD}" ${dbdir}/
- local x
+ local x e ee=
+ for e in ${ECLASSDIRS:-${ECLASSDIR}} ; do
+ ee="${e} ${ee}"
+ done
for i in ${INHERITED} ; do
- cp "${ECLASSDIR}/${i}".eclass "${dbdir}/" || die "save eclass ${i} failed"
+ for e in ${ee} ; do
+ if [[ -f "${e}/${i}".eclass ]] ; then
+ cp "${e}/${i}".eclass "${dbdir}/" || die "save eclass ${i} failed"
+ break
+ fi
+ done
done
local reinstall=
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 51728db..b65af51 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -99,7 +99,11 @@ for var in ${save_vars} ; do
eval "export save_var_${var}='${!var}'"
done
-if [[ -n "${PALUDIS_PROFILE_DIR}" ]] ; then
+if [[ -n "${PALUDIS_PROFILE_DIRS}" ]] ; then
+ for var in ${PALUDIS_PROFILE_DIRS} ; do
+ ebuild_source_profile $(canonicalise "${var}")
+ done
+elif [[ -n "${PALUDIS_PROFILE_DIR}" ]] ; then
ebuild_source_profile $(canonicalise "${PALUDIS_PROFILE_DIR}")
fi
diff --git a/ebuild/eclass_functions.bash b/ebuild/eclass_functions.bash
index 5c9bffc..e4f3c92 100644
--- a/ebuild/eclass_functions.bash
+++ b/ebuild/eclass_functions.bash
@@ -46,9 +46,11 @@ EXPORT_FUNCTIONS()
inherit()
{
- local e
+ local e ee location=
for e in "$@" ; do
- local location="${ECLASSDIR}/${e}.eclass"
+ for ee in ${ECLASSDIRS:-${ECLASSDIR}} ; do
+ [[ -f "${ee}/${e}.eclass" ]] && location="${ECLASSDIR}/${e}.eclass"
+ done
local old_ECLASS="${ECLASS}"
export ECLASS="${e}"
@@ -58,6 +60,7 @@ inherit()
unset IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+ [[ -z "${location}" ]] && die "Error finding eclass ${e}"
source "${location}" || die "Error sourcing eclass ${e}"
hasq "${ECLASS}" ${INHERITED} || export INHERITED="${INHERITED} ${ECLASS}"
diff --git a/paludis/ebuild.cc b/paludis/ebuild.cc
index 10091aa..f231233 100644
--- a/paludis/ebuild.cc
+++ b/paludis/ebuild.cc
@@ -87,7 +87,9 @@ EbuildCommand::operator() ()
stringify(params.get<ecpk_db_entry>()->get<pde_version>()))
("CATEGORY", stringify(params.get<ecpk_db_entry>()->get<pde_name>().get<qpn_category>()))
("FILESDIR", stringify(params.get<ecpk_files_dir>()))
- ("ECLASSDIR", stringify(params.get<ecpk_eclass_dir>()))
+ ("ECLASSDIR", stringify(*params.get<ecpk_eclassdirs>()->begin()))
+ ("ECLASSDIRS", join(params.get<ecpk_eclassdirs>()->begin(),
+ params.get<ecpk_eclassdirs>()->end(), " "))
("PORTDIR", stringify(params.get<ecpk_portdir>()))
("DISTDIR", stringify(params.get<ecpk_distdir>()))
("PALUDIS_TMPDIR", stringify(params.get<ecpk_buildroot>()))
@@ -226,7 +228,9 @@ EbuildFetchCommand::extend_command(const MakeEnvCommand & cmd)
("USE_EXPAND", fetch_params.get<ecfpk_use_expand>())
("FLAT_SRC_URI", fetch_params.get<ecfpk_flat_src_uri>())
("ROOT", fetch_params.get<ecfpk_root>())
- ("PALUDIS_PROFILE_DIR", fetch_params.get<ecfpk_profile>()));
+ ("PALUDIS_PROFILE_DIR", stringify(*fetch_params.get<ecfpk_profiles>()->begin()))
+ ("PALUDIS_PROFILE_DIRS", join(fetch_params.get<ecfpk_profiles>()->begin(),
+ fetch_params.get<ecfpk_profiles>()->end(), " ")));
for (std::map<std::string, std::string>::const_iterator
i(fetch_params.get<ecfpk_expand_vars>().begin()),
@@ -270,7 +274,9 @@ EbuildInstallCommand::extend_command(const MakeEnvCommand & cmd)
("ROOT", install_params.get<ecipk_root>())
("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK",
install_params.get<ecipk_disable_cfgpro>() ? "/" : "")
- ("PALUDIS_PROFILE_DIR", install_params.get<ecipk_profile>())
+ ("PALUDIS_PROFILE_DIR", stringify(*install_params.get<ecipk_profiles>()->begin()))
+ ("PALUDIS_PROFILE_DIRS", join(install_params.get<ecipk_profiles>()->begin(),
+ install_params.get<ecipk_profiles>()->end(), " "))
("SLOT", stringify(install_params.get<ecipk_slot>())));
for (std::map<std::string, std::string>::const_iterator
diff --git a/paludis/ebuild.hh b/paludis/ebuild.hh
index 9299fbe..6a5326a 100644
--- a/paludis/ebuild.hh
+++ b/paludis/ebuild.hh
@@ -49,7 +49,7 @@ namespace paludis
ecpk_db_entry,
ecpk_ebuild_dir,
ecpk_files_dir,
- ecpk_eclass_dir,
+ ecpk_eclassdirs,
ecpk_portdir,
ecpk_distdir,
ecpk_buildroot,
@@ -73,7 +73,7 @@ namespace paludis
SmartRecordKey<ecpk_db_entry, const PackageDatabaseEntry *>,
SmartRecordKey<ecpk_ebuild_dir, const FSEntry>,
SmartRecordKey<ecpk_files_dir, const FSEntry>,
- SmartRecordKey<ecpk_eclass_dir, const FSEntry>,
+ SmartRecordKey<ecpk_eclassdirs, FSEntryCollection::ConstPointer>,
SmartRecordKey<ecpk_portdir, const FSEntry>,
SmartRecordKey<ecpk_distdir, const FSEntry>,
SmartRecordKey<ecpk_buildroot, const FSEntry>
@@ -216,7 +216,7 @@ namespace paludis
ecfpk_use_expand,
ecfpk_flat_src_uri,
ecfpk_root,
- ecfpk_profile,
+ ecfpk_profiles,
ecfpk_expand_vars,
ecfpk_no_fetch,
last_ecfpk
@@ -237,7 +237,7 @@ namespace paludis
SmartRecordKey<ecfpk_use_expand, std::string>,
SmartRecordKey<ecfpk_flat_src_uri, std::string>,
SmartRecordKey<ecfpk_root, std::string>,
- SmartRecordKey<ecfpk_profile, std::string>,
+ SmartRecordKey<ecfpk_profiles, FSEntryCollection::ConstPointer>,
SmartRecordKey<ecfpk_expand_vars, std::map<std::string, std::string> >,
SmartRecordKey<ecfpk_no_fetch, bool>
{
@@ -289,7 +289,7 @@ namespace paludis
ecipk_use,
ecipk_use_expand,
ecipk_root,
- ecipk_profile,
+ ecipk_profiles,
ecipk_expand_vars,
ecipk_disable_cfgpro,
ecipk_merge_only,
@@ -311,7 +311,7 @@ namespace paludis
SmartRecordKey<ecipk_use, std::string>,
SmartRecordKey<ecipk_use_expand, std::string>,
SmartRecordKey<ecipk_root, std::string>,
- SmartRecordKey<ecipk_profile, std::string>,
+ SmartRecordKey<ecipk_profiles, FSEntryCollection::ConstPointer>,
SmartRecordKey<ecipk_expand_vars, std::map<std::string, std::string> >,
SmartRecordKey<ecipk_disable_cfgpro, bool>,
SmartRecordKey<ecipk_merge_only, bool>,
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 4426922..b7323a7 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -121,14 +121,14 @@ namespace paludis
/// Our base location.
FSEntry location;
- /// Our profile.
- FSEntry profile;
+ /// Our profiles.
+ FSEntryCollection::Pointer profiles;
/// Our cache.
FSEntry cache;
/// Eclass dir
- FSEntry eclassdir;
+ FSEntryCollection::Pointer eclassdirs;
/// Distfiles dir
FSEntry distdir;
@@ -198,9 +198,6 @@ namespace paludis
/// Old style virtuals name mapping.
mutable VirtualsMap virtuals_map;
- /// Have we loaded our profile yet?
- mutable bool has_profile;
-
/// Arch flags
mutable UseFlagSet arch_list;
@@ -231,16 +228,20 @@ namespace paludis
/// Destructor.
~Implementation();
- /// Add a profile directory.
- void add_profile(const FSEntry & f) const;
-
/// Invalidate our cache.
void invalidate() const;
/// (Empty) provides map.
const std::map<QualifiedPackageName, QualifiedPackageName> provide_map;
+ /// Load profiles, if we haven't already.
+ inline void need_profiles() const;
+
private:
+ mutable bool has_profile;
+
+ void add_profile(const FSEntry & f) const;
+
void add_profile_r(const FSEntry & f) const;
/// Raw system lines.
@@ -252,9 +253,9 @@ Implementation<PortageRepository>::Implementation(const PortageRepositoryParams
db(p.get<prpk_package_database>()),
env(p.get<prpk_environment>()),
location(p.get<prpk_location>()),
- profile(p.get<prpk_profile>()),
+ profiles(p.get<prpk_profiles>()),
cache(p.get<prpk_cache>()),
- eclassdir(p.get<prpk_eclassdir>()),
+ eclassdirs(p.get<prpk_eclassdirs>()),
distdir(p.get<prpk_distdir>()),
setsdir(p.get<prpk_setsdir>()),
securitydir(p.get<prpk_securitydir>()),
@@ -266,11 +267,11 @@ Implementation<PortageRepository>::Implementation(const PortageRepositoryParams
has_category_names(false),
has_repo_mask(false),
has_virtuals(false),
- has_profile(false),
has_arch_list(false),
has_mirrors(false),
system_packages(new AllDepAtom),
- system_tag(new GeneralSetDepTag("system"))
+ system_tag(new GeneralSetDepTag("system")),
+ has_profile(false)
{
}
@@ -503,6 +504,20 @@ Implementation<PortageRepository>::add_profile_r(const FSEntry & f) const
}
void
+Implementation<PortageRepository>::need_profiles() const
+{
+ if (has_profile)
+ return;
+
+ Context context("When loading profiles:");
+ for (FSEntryCollection::Iterator p(profiles->begin()), p_end(profiles->end()) ;
+ p != p_end ; ++p)
+ add_profile(*p);
+
+ has_profile = true;
+}
+
+void
Implementation<PortageRepository>::invalidate() const
{
has_category_names = false;
@@ -542,9 +557,11 @@ PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
PrivateImplementationPattern<PortageRepository>(new Implementation<PortageRepository>(p))
{
_info.insert(std::make_pair(std::string("location"), stringify(_imp->location)));
- _info.insert(std::make_pair(std::string("profile"), stringify(_imp->profile)));
+ _info.insert(std::make_pair(std::string("profiles"), join(_imp->profiles->begin(),
+ _imp->profiles->end(), " ")));
+ _info.insert(std::make_pair(std::string("eclassdirs"), join(_imp->eclassdirs->begin(),
+ _imp->eclassdirs->end(), " ")));
_info.insert(std::make_pair(std::string("cache"), stringify(_imp->cache)));
- _info.insert(std::make_pair(std::string("eclassdir"), stringify(_imp->eclassdir)));
_info.insert(std::make_pair(std::string("distdir"), stringify(_imp->distdir)));
_info.insert(std::make_pair(std::string("securitydir"), stringify(_imp->securitydir)));
_info.insert(std::make_pair(std::string("setsdir"), stringify(_imp->setsdir)));
@@ -911,10 +928,15 @@ PortageRepository::do_version_metadata(
WhitespaceTokeniser::get_instance()->tokenise(
stringify(result->get_ebuild_interface()->get<evm_inherited>()),
std::back_inserter(inherits));
- for (std::list<std::string>::const_iterator i(inherits.begin()),
- i_end(inherits.end()) ; i != i_end ; ++i)
- if ((_imp->eclassdir / (*i + ".eclass")).mtime() > cache_time)
- ok = false;
+ for (FSEntryCollection::Iterator e(_imp->eclassdirs->begin()),
+ e_end(_imp->eclassdirs->end()) ; e != e_end ; ++e)
+ for (std::list<std::string>::const_iterator i(inherits.begin()),
+ i_end(inherits.end()) ; i != i_end ; ++i)
+ {
+ if ((*e / (*i + ".eclass")).exists())
+ if (((*e / (*i + ".eclass"))).mtime() > cache_time)
+ ok = false;
+ }
}
if (! ok)
@@ -951,7 +973,7 @@ PortageRepository::do_version_metadata(
stringify(q.get<qpn_package>())),
param<ecpk_files_dir>(_imp->location / stringify(q.get<qpn_category>()) /
stringify(q.get<qpn_package>()) / "files"),
- param<ecpk_eclass_dir>(_imp->eclassdir),
+ param<ecpk_eclassdirs>(_imp->eclassdirs),
param<ecpk_portdir>(_imp->location),
param<ecpk_distdir>(_imp->distdir),
param<ecpk_buildroot>(_imp->buildroot)
@@ -1020,12 +1042,7 @@ PortageRepository::do_query_profile_masks(const QualifiedPackageName &,
UseFlagState
PortageRepository::do_query_use(const UseFlagName & f, const PackageDatabaseEntry * e) const
{
- if (! _imp->has_profile)
- {
- Context context("When checking USE state for '" + stringify(f) + "':");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ _imp->need_profiles();
UseMap::iterator p(_imp->use.end());
@@ -1040,12 +1057,7 @@ PortageRepository::do_query_use(const UseFlagName & f, const PackageDatabaseEntr
bool
PortageRepository::do_query_use_mask(const UseFlagName & u, const PackageDatabaseEntry *e) const
{
- if (! _imp->has_profile)
- {
- Context context("When checking USE mask for '" + stringify(u) + "':");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ _imp->need_profiles();
if (_imp->use_mask.end() != _imp->use_mask.find(u))
return true;
@@ -1082,12 +1094,7 @@ PortageRepository::do_query_use_mask(const UseFlagName & u, const PackageDatabas
bool
PortageRepository::do_query_use_force(const UseFlagName & u, const PackageDatabaseEntry *e) const
{
- if (! _imp->has_profile)
- {
- Context context("When checking USE force for '" + stringify(u) + "':");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ _imp->need_profiles();
if (_imp->use_force.end() != _imp->use_force.find(u))
return true;
@@ -1132,13 +1139,7 @@ PortageRepository::need_virtual_names() const
try
{
- if (! _imp->has_profile)
- {
- Context context("When loading virtual names:");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
-
+ _imp->need_profiles();
need_category_names();
for (Environment::ProvideMapIterator p(_imp->env->begin_provide_map()),
@@ -1177,13 +1178,37 @@ PortageRepository::make_portage_repository(
if (m.end() == m.find("location") || ((location = m.find("location")->second)).empty())
throw PortageRepositoryConfigurationError("Key 'location' not specified or empty");
- std::string profile;
- if (m.end() == m.find("profile") || ((profile = m.find("profile")->second)).empty())
- throw PortageRepositoryConfigurationError("Key 'profile' not specified or empty");
-
- std::string eclassdir;
- if (m.end() == m.find("eclassdir") || ((eclassdir = m.find("eclassdir")->second)).empty())
- eclassdir = location + "/eclass";
+ FSEntryCollection::Pointer profiles(new FSEntryCollection);
+ if (m.end() != m.find("profiles"))
+ WhitespaceTokeniser::get_instance()->tokenise(m.find("profiles")->second,
+ create_inserter<FSEntry>(std::back_inserter(*profiles)));
+ if (m.end() != m.find("profile") && ! m.find("profile")->second.empty())
+ {
+ Log::get_instance()->message(ll_warning, "Key 'profile' in '" + location + "' is deprecated, "
+ "use 'profiles = " + m.find("profile")->second + "' instead");
+ if (profiles->empty())
+ profiles->append(m.find("profile")->second);
+ else
+ throw PortageRepositoryConfigurationError("Both 'profile' and 'profiles' keys are present");
+ }
+ if (profiles->empty())
+ throw PortageRepositoryConfigurationError("No profiles have been specified");
+
+ FSEntryCollection::Pointer eclassdirs(new FSEntryCollection);
+ if (m.end() != m.find("eclassdirs"))
+ WhitespaceTokeniser::get_instance()->tokenise(m.find("eclassdirs")->second,
+ create_inserter<FSEntry>(std::back_inserter(*eclassdirs)));
+ if (m.end() != m.find("eclassdir") && ! m.find("eclassdir")->second.empty())
+ {
+ Log::get_instance()->message(ll_warning, "Key 'eclassdir' in '" + location + "' is deprecated, "
+ "use 'eclassdirs = " + m.find("eclassdir")->second + "' instead");
+ if (eclassdirs->empty())
+ eclassdirs->append(m.find("eclassdir")->second);
+ else
+ throw PortageRepositoryConfigurationError("Both 'eclassdir' and 'eclassdirs' keys are present");
+ }
+ if (eclassdirs->empty())
+ eclassdirs->append(location + "/eclass");
std::string distdir;
if (m.end() == m.find("distdir") || ((distdir = m.find("distdir")->second)).empty())
@@ -1225,9 +1250,9 @@ PortageRepository::make_portage_repository(
param<prpk_environment>(env),
param<prpk_package_database>(db),
param<prpk_location>(location),
- param<prpk_profile>(profile),
+ param<prpk_profiles>(profiles),
param<prpk_cache>(cache),
- param<prpk_eclassdir>(eclassdir),
+ param<prpk_eclassdirs>(eclassdirs),
param<prpk_distdir>(distdir),
param<prpk_securitydir>(securitydir),
param<prpk_setsdir>(setsdir),
@@ -1264,12 +1289,7 @@ PortageRepository::do_is_arch_flag(const UseFlagName & u) const
bool
PortageRepository::do_is_expand_flag(const UseFlagName & u) const
{
- if (! _imp->has_profile)
- {
- Context context("When checking USE_EXPAND list for '" + stringify(u) + "':");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ _imp->need_profiles();
for (UseFlagSet::const_iterator i(_imp->expand_list.begin()),
i_end(_imp->expand_list.end()) ; i != i_end ; ++i)
@@ -1335,11 +1355,7 @@ void
PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec & v,
const InstallOptions & o) const
{
- if (! _imp->has_profile)
- {
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ _imp->need_profiles();
if (! _imp->root.is_directory())
throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
@@ -1512,7 +1528,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
stringify(q.get<qpn_package>())),
param<ecpk_files_dir>(_imp->location / stringify(q.get<qpn_category>()) /
stringify(q.get<qpn_package>()) / "files"),
- param<ecpk_eclass_dir>(_imp->eclassdir),
+ param<ecpk_eclassdirs>(_imp->eclassdirs),
param<ecpk_portdir>(_imp->location),
param<ecpk_distdir>(_imp->distdir),
param<ecpk_buildroot>(_imp->buildroot)
@@ -1525,7 +1541,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
param<ecfpk_expand_vars>(expand_vars),
param<ecfpk_flat_src_uri>(flat_src_uri),
param<ecfpk_root>(stringify(_imp->root) + "/"),
- param<ecfpk_profile>(stringify(_imp->profile)),
+ param<ecfpk_profiles>(_imp->profiles),
param<ecfpk_no_fetch>(fetch_restrict)
)));
@@ -1542,7 +1558,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
stringify(q.get<qpn_package>())),
param<ecpk_files_dir>(_imp->location / stringify(q.get<qpn_category>()) /
stringify(q.get<qpn_package>()) / "files"),
- param<ecpk_eclass_dir>(_imp->eclassdir),
+ param<ecpk_eclassdirs>(_imp->eclassdirs),
param<ecpk_portdir>(_imp->location),
param<ecpk_distdir>(_imp->distdir),
param<ecpk_buildroot>(_imp->buildroot)
@@ -1554,7 +1570,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
_imp->expand_list.end(), " ")),
param<ecipk_expand_vars>(expand_vars),
param<ecipk_root>(stringify(_imp->root) + "/"),
- param<ecipk_profile>(stringify(_imp->profile)),
+ param<ecipk_profiles>(_imp->profiles),
param<ecipk_disable_cfgpro>(o.get<io_noconfigprotect>()),
param<ecipk_merge_only>(! metadata->get_ebuild_interface()->get<evm_virtual>().empty()),
param<ecipk_slot>(SlotName(metadata->get<vm_slot>()))
@@ -1725,19 +1741,11 @@ PortageRepository::do_package_set(const std::string & s) const
{
if ("system" == s)
{
- if (! _imp->has_profile)
- {
- Context c("When loading system packages list:");
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
-
+ _imp->need_profiles();
return _imp->system_packages;
}
else if ("security" == s)
- {
return do_security_set();
- }
else if ((_imp->setsdir / (s + ".conf")).exists())
{
GeneralSetDepTag::Pointer tag(new GeneralSetDepTag(s));
@@ -1883,11 +1891,7 @@ PortageRepository::update_news() const
if (news.begin_display_if_keyword() != news.end_display_if_keyword())
{
- if (! _imp->has_profile)
- {
- _imp->add_profile(_imp->profile.realpath());
- _imp->has_profile = true;
- }
+ _imp->need_profiles();
bool local_show(false);
for (NewsFile::DisplayIfKeywordIterator i(news.begin_display_if_keyword()),
@@ -1900,14 +1904,18 @@ PortageRepository::update_news() const
if (news.begin_display_if_profile() != news.end_display_if_profile())
{
bool local_show(false);
- std::string profile(strip_leading_string(strip_trailing_string(
- strip_leading_string(stringify(_imp->profile.realpath()),
- stringify(_imp->location.realpath())), "/"), "/"));
- Log::get_instance()->message(ll_debug, "Profile path is '" + profile + "'");
- for (NewsFile::DisplayIfProfileIterator i(news.begin_display_if_profile()),
- i_end(news.end_display_if_profile()) ; i != i_end ; ++i)
- if (profile == *i)
- local_show = true;
+ for (FSEntryCollection::Iterator p(_imp->profiles->begin()),
+ p_end(_imp->profiles->end()) ; p != p_end ; ++p)
+ {
+ std::string profile(strip_leading_string(strip_trailing_string(
+ strip_leading_string(stringify(p->realpath()),
+ stringify(p->realpath())), "/"), "/"));
+ Log::get_instance()->message(ll_debug, "Profile path is '" + profile + "'");
+ for (NewsFile::DisplayIfProfileIterator i(news.begin_display_if_profile()),
+ i_end(news.end_display_if_profile()) ; i != i_end ; ++i)
+ if (profile == *i)
+ local_show = true;
+ }
show &= local_show;
}
diff --git a/paludis/portage_repository.hh b/paludis/portage_repository.hh
index 8e1d41f..9700426 100644
--- a/paludis/portage_repository.hh
+++ b/paludis/portage_repository.hh
@@ -48,10 +48,10 @@ namespace paludis
prpk_environment,
prpk_package_database,
prpk_location,
- prpk_profile,
+ prpk_profiles,
prpk_cache,
prpk_distdir,
- prpk_eclassdir,
+ prpk_eclassdirs,
prpk_setsdir,
prpk_securitydir,
prpk_newsdir,
@@ -74,10 +74,10 @@ namespace paludis
SmartRecordKey<prpk_environment, const Environment *>,
SmartRecordKey<prpk_package_database, const PackageDatabase *>,
SmartRecordKey<prpk_location, const FSEntry>,
- SmartRecordKey<prpk_profile, const FSEntry>,
+ SmartRecordKey<prpk_profiles, FSEntryCollection::Pointer>,
SmartRecordKey<prpk_cache, const FSEntry>,
SmartRecordKey<prpk_distdir, const FSEntry>,
- SmartRecordKey<prpk_eclassdir, const FSEntry>,
+ SmartRecordKey<prpk_eclassdirs, FSEntryCollection::Pointer>,
SmartRecordKey<prpk_setsdir, const FSEntry>,
SmartRecordKey<prpk_securitydir, const FSEntry>,
SmartRecordKey<prpk_newsdir, const FSEntry>,
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index 3f83163..ae6d16f 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -98,7 +98,7 @@ FSEntry::operator/= (const FSEntry & rhs)
_checked = false;
_exists = false;
- _stat_info = CountedPtr<struct stat, count_policy::ExternalCountTag>(0);
+ _stat_info = CountedPtr<struct ::stat, count_policy::ExternalCountTag>(0);
return *this;
}
diff --git a/paludis/util/fs_entry.hh b/paludis/util/fs_entry.hh
index b0e55bd..9d97dbf 100644
--- a/paludis/util/fs_entry.hh
+++ b/paludis/util/fs_entry.hh
@@ -21,12 +21,11 @@
#ifndef PALUDIS_GUARD_PALUDIS_FS_ENTRY_HH
#define PALUDIS_GUARD_PALUDIS_FS_ENTRY_HH 1
-#include <ostream>
#include <paludis/util/comparison_policy.hh>
#include <paludis/util/counted_ptr.hh>
#include <paludis/util/exception.hh>
#include <string>
-#include <sys/stat.h>
+#include <iosfwd>
/** \file
* Declarations for paludis::Filesystem.
@@ -34,6 +33,8 @@
* \ingroup grpfilesystem
*/
+struct stat;
+
namespace paludis
{
/**
@@ -90,7 +91,7 @@ namespace paludis
private:
std::string _path;
- mutable CountedPtr<struct stat, count_policy::ExternalCountTag> _stat_info;
+ mutable CountedPtr<struct ::stat, count_policy::ExternalCountTag> _stat_info;
mutable bool _exists;
@@ -238,6 +239,15 @@ namespace paludis
* \ingroup grpfilesystem
*/
std::ostream & operator<< (std::ostream & s, const FSEntry & f);
+
+ template <typename T_> class SequentialCollection;
+
+ /**
+ * An ordered group of FSEntry instances.
+ *
+ * \ingroup grpfilesystem
+ */
+ typedef SequentialCollection<FSEntry> FSEntryCollection;
}
#endif
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index a56e8a6..42666d5 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -717,6 +717,10 @@ VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec &
PackageDatabaseEntry e(q, v, name());
+ FSEntryCollection::Pointer eclassdirs(new FSEntryCollection);
+ eclassdirs->append(FSEntry(_imp->location / stringify(q.get<qpn_category>()) /
+ (stringify(q.get<qpn_package>()) + "-" + stringify(v))));
+
EbuildUninstallCommand uninstall_cmd(EbuildCommandParams::create((
param<ecpk_environment>(_imp->env),
param<ecpk_db_entry>(&e),
@@ -724,8 +728,7 @@ VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec &
(stringify(q.get<qpn_package>()) + "-" + stringify(v))),
param<ecpk_files_dir>(_imp->location / stringify(q.get<qpn_category>()) /
(stringify(q.get<qpn_package>()) + "-" + stringify(v))),
- param<ecpk_eclass_dir>(_imp->location / stringify(q.get<qpn_category>()) /
- (stringify(q.get<qpn_package>()) + "-" + stringify(v))),
+ param<ecpk_eclassdirs>(eclassdirs),
param<ecpk_portdir>(_imp->location),
param<ecpk_distdir>(_imp->location / stringify(q.get<qpn_category>()) /
(stringify(q.get<qpn_package>()) + "-" + stringify(v))),
diff --git a/src/install_TEST_setup.sh b/src/install_TEST_setup.sh
index 20416cb..3cbc573 100755
--- a/src/install_TEST_setup.sh
+++ b/src/install_TEST_setup.sh
@@ -32,14 +32,14 @@ cat <<END > root/${SYSCONFDIR}/paludis/repositories/repo1.conf
location = `pwd`/repo1
cache = /var/empty
format = portage
-profile = \${location}/profiles/testprofile
+profiles = \${location}/profiles/testprofile \${location}/profiles/anothertestprofile
buildroot = `pwd`/build
END
mkdir -p root/tmp
touch root/${SYSCONFDIR}/ld.so.conf
-mkdir -p repo1/{eclass,distfiles,profiles/testprofile,test-category/target/files} || exit 1
+mkdir -p repo1/{eclass,distfiles,profiles/{testprofile,anothertestprofile},test-category/target/files} || exit 1
mkdir -p src/target-2
cat <<"END" > src/target-2/testbin
@@ -62,9 +62,26 @@ cat <<END > profiles/testprofile/make.defaults
ARCH=test
USERLAND=test
KERNEL=test
+TESTPROFILE_WAS_SOURCED=yes
+PROFILE_ORDERING=1
+END
+cat <<END > profiles/anothertestprofile/make.defaults
+ARCH=test
+USERLAND=test
+KERNEL=test
+ANOTHERTESTPROFILE_WAS_SOURCED=yes
+PROFILE_ORDERING=2
+END
+
+cat <<"END" > eclass/foo.eclass
+inherit_was_ok() {
+ true
+}
END
cat <<"END" > test-category/target/target-2.ebuild || exit 1
+inherit foo
+
DESCRIPTION="Test target"
HOMEPAGE="http://paludis.berlios.de/"
SRC_URI="http://invalid.domain/${P}.tar.gz"
@@ -75,6 +92,13 @@ KEYWORDS="test"
pkg_setup() {
[[ -z "${USER_BASHRC_WAS_USED}" ]] && die "bad env"
+ [[ -z "${TESTPROFILE_WAS_SOURCED}" ]] && die "testprofile not sourced"
+ [[ -z "${ANOTHERTESTPROFILE_WAS_SOURCED}" ]] && die "anothertestprofile not sourced"
+ [[ ${PROFILE_ORDERING:-0} != 2 ]] && die "bad profile source ordering"
+}
+
+src_compile() {
+ inherit_was_ok || die "inherit didn't work"
}
src_test() {