aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-19 09:14:21 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-19 09:14:21 +0000
commit6a52d0f19f9e35338990411e9374b19cc1be37a9 (patch)
tree3c25e29a78beb9effdc7fd9c6bbd3538606eecca
parent84a20c706b382622a26138287a964acc17aeb2fa (diff)
downloadpaludis-6a52d0f19f9e35338990411e9374b19cc1be37a9.tar.gz
paludis-6a52d0f19f9e35338990411e9374b19cc1be37a9.tar.xz
kdebuild-1 support. Fixes: ticket:500, ticket:523, ticket:524, ticket:526, ticket:528, ticket:530, ticket:531, ticket:532, ticket:533, ticket:534, ticket:535, ticket:536, ticket:537, ticket:538, ticket:539
-rw-r--r--configure.ac2
-rw-r--r--paludis/dep_list.cc158
-rw-r--r--paludis/dep_list.hh10
-rw-r--r--paludis/environments/paludis/Makefile.am1
-rw-r--r--paludis/environments/portage/Makefile.am1
-rw-r--r--paludis/repositories/e/Makefile.am3
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc21
-rw-r--r--paludis/repositories/e/e_installed_repository.cc1
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc162
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh123
-rw-r--r--paludis/repositories/e/e_repository_entries.hh3
-rw-r--r--paludis/repositories/e/eapi.cc2
-rw-r--r--paludis/repositories/e/eapi.sr1
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/Makefile.am1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/kdebuild-1.conf58
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebuild.cc19
-rw-r--r--paludis/repositories/e/ebuild.hh13
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am2
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash1
-rw-r--r--paludis/repositories/e/ebuild/kdebuild-1/Makefile.am38
-rw-r--r--paludis/repositories/e/ebuild/kdebuild-1/output_functions.bash31
-rw-r--r--paludis/repositories/e/ebuild/utils/Makefile.am2
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/dosym10
-rw-r--r--paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/utils/kdebuild-1/Makefile.am64
-rw-r--r--paludis/repositories/e/ebuild/utils/kdebuild-1/banned_in_eapi_kdebuild-129
-rw-r--r--paludis/repositories/e/ebuild_entries.cc118
-rw-r--r--paludis/repositories/e/ebuild_entries.hh6
-rw-r--r--paludis/repositories/e/ebuild_entries_suffixes.conf11
-rw-r--r--paludis/repositories/e/exheres_layout.cc26
-rw-r--r--paludis/repositories/e/exheres_layout.hh6
-rw-r--r--paludis/repositories/e/layout.hh6
-rw-r--r--paludis/repositories/e/qa/Makefile.am14
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc8
-rw-r--r--paludis/repositories/e/qa/test_extras.cc26
-rw-r--r--paludis/repositories/e/traditional_layout.cc26
-rw-r--r--paludis/repositories/e/traditional_layout.hh6
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc6
-rwxr-xr-xpaludis/repositories/e/vdb_repository_TEST_setup.sh68
-rw-r--r--paludis/show_suggest_visitor.cc96
-rw-r--r--paludis/show_suggest_visitor.hh8
-rw-r--r--paludis/util/echo_functions.bash.in1
-rw-r--r--paludis/util/keys.hh1
-rw-r--r--python/Makefile.am1
-rw-r--r--ruby/Makefile.am1
-rw-r--r--src/clients/adjutrix/Makefile.am1
-rw-r--r--src/clients/paludis/Makefile.am1
50 files changed, 985 insertions, 212 deletions
diff --git a/configure.ac b/configure.ac
index 03dfb06..495276b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1369,10 +1369,12 @@ AC_OUTPUT(
paludis/repositories/e/ebuild/1/Makefile
paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/exheres-0/Makefile
+ paludis/repositories/e/ebuild/kdebuild-1/Makefile
paludis/repositories/e/ebuild/paludis-1/Makefile
paludis/repositories/e/ebuild/pbin-1/Makefile
paludis/repositories/e/ebuild/utils/Makefile
paludis/repositories/e/ebuild/utils/exheres-0/Makefile
+ paludis/repositories/e/ebuild/utils/kdebuild-1/Makefile
paludis/repositories/e/qa/Makefile
paludis/repositories/fake/Makefile
paludis/repositories/gems/Makefile
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 037294e..ed7f1cc 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -61,6 +61,8 @@
using namespace paludis;
+typedef std::list<tr1::shared_ptr<ActiveDependencyLabels> > LabelsStack;
+
template class Sequence<tr1::function<bool (const PackageID &, const Mask &)> >;
template class WrappedForwardIterator<DepList::IteratorTag, DepListEntry>;
template class WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>;
@@ -113,6 +115,8 @@ namespace paludis
bool throw_on_blocker;
+ LabelsStack labels;
+
const tr1::shared_ptr<const PackageID> current_package_id() const
{
if (current_merge_list_entry != merge_list.end())
@@ -129,6 +133,7 @@ namespace paludis
current_top_level_target(0),
throw_on_blocker(o.blocks == dl_blocks_error)
{
+ labels.push_front(make_shared_ptr(new ActiveDependencyLabels(*make_shared_ptr(new DependencyLabelSequence))));
}
};
}
@@ -282,26 +287,29 @@ namespace
}
struct DepList::AddVisitor :
- ConstVisitor<DependencySpecTree>,
- ConstVisitor<DependencySpecTree>::VisitConstSequence<AddVisitor, AllDepSpec>
+ ConstVisitor<DependencySpecTree>
{
DepList * const d;
tr1::shared_ptr<const DestinationsSet> destinations;
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions;
std::set<SetName> recursing_sets;
+ const bool only_if_not_suggested_label;
- AddVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsSet> ddd,
+ AddVisitor(DepList * const dd, bool l, tr1::shared_ptr<const DestinationsSet> ddd,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > c =
(tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> >(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec))))) :
d(dd),
destinations(ddd),
- conditions(c)
+ conditions(c),
+ only_if_not_suggested_label(l)
{
}
- using ConstVisitor<DependencySpecTree>::VisitConstSequence<AddVisitor, AllDepSpec>::visit_sequence;
+ void visit_sequence(const AllDepSpec &,
+ DependencySpecTree::ConstSequenceIterator,
+ DependencySpecTree::ConstSequenceIterator);
void visit_sequence(const AnyDepSpec &,
DependencySpecTree::ConstSequenceIterator,
@@ -320,11 +328,55 @@ struct DepList::AddVisitor :
void visit_leaf(const NamedSetDepSpec &);
};
+namespace
+{
+ struct SuggestActiveVisitor :
+ ConstVisitor<DependencySuggestLabelVisitorTypes>
+ {
+ bool result;
+
+ SuggestActiveVisitor() :
+ result(false)
+ {
+ }
+
+ void visit(const DependencyRecommendedLabel &)
+ {
+ }
+
+ void visit(const DependencySuggestedLabel &)
+ {
+ result = true;
+ }
+
+ void visit(const DependencyRequiredLabel &)
+ {
+ }
+ };
+}
+
void
DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
{
Context context("When adding PackageDepSpec '" + stringify(a) + "':");
+ if (only_if_not_suggested_label)
+ {
+ SuggestActiveVisitor v;
+ for (DependencySuggestLabelSequence::ConstIterator
+ i((*d->_imp->labels.begin())->suggest_labels()->begin()),
+ i_end((*d->_imp->labels.begin())->suggest_labels()->end()) ;
+ i != i_end ; ++i)
+ (*i)->accept(v);
+
+ if (v.result)
+ {
+ Log::get_instance()->message(ll_debug, lc_context) << "Skipping dep '"
+ << a << "' because suggested label is active";
+ return;
+ }
+ }
+
Save<tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > > save_c(
&conditions, d->_imp->opts->dependency_tags ? ConditionTracker(conditions).add_condition(a) : conditions);
@@ -608,6 +660,17 @@ DepList::AddVisitor::visit_leaf(const NamedSetDepSpec & a)
}
void
+DepList::AddVisitor::visit_sequence(const AllDepSpec &,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+{
+ d->_imp->labels.push_front(make_shared_ptr(new ActiveDependencyLabels(**d->_imp->labels.begin())));
+ RunOnDestruction restore_labels(tr1::bind(tr1::mem_fn(&LabelsStack::pop_front), &d->_imp->labels));
+
+ std::for_each(cur, end, accept_visitor(*this));
+}
+
+void
DepList::AddVisitor::visit_sequence(const ConditionalDepSpec & a,
DependencySpecTree::ConstSequenceIterator cur,
DependencySpecTree::ConstSequenceIterator end)
@@ -617,6 +680,9 @@ DepList::AddVisitor::visit_sequence(const ConditionalDepSpec & a,
if (d->_imp->opts->use == dl_use_deps_standard)
{
+ d->_imp->labels.push_front(make_shared_ptr(new ActiveDependencyLabels(**d->_imp->labels.begin())));
+ RunOnDestruction restore_labels(tr1::bind(tr1::mem_fn(&LabelsStack::pop_front), &d->_imp->labels));
+
if (a.condition_met())
std::for_each(cur, end, accept_visitor(*this));
}
@@ -634,6 +700,9 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
{
using namespace tr1::placeholders;
+ d->_imp->labels.push_front(make_shared_ptr(new ActiveDependencyLabels(**d->_imp->labels.begin())));
+ RunOnDestruction restore_labels(tr1::bind(tr1::mem_fn(&LabelsStack::pop_front), &d->_imp->labels));
+
/* annoying requirement: || ( foo? ( ... ) ) resolves to empty if !foo. */
if (end == std::find_if(cur, end, &is_viable_any_child))
return;
@@ -645,7 +714,7 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
if (rewritten_spec)
{
TreeLeaf<DependencySpecTree, PackageDepSpec> rr(r.spec());
- d->add_not_top_level(rr, destinations, conditions);
+ d->add_not_top_level(only_if_not_suggested_label, rr, destinations, conditions);
return;
}
}
@@ -663,7 +732,7 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
if (d->already_installed(*c, destinations))
{
Context context("When using already installed group to resolve dependencies:");
- d->add_not_top_level(*c, destinations, conditions);
+ d->add_not_top_level(only_if_not_suggested_label, *c, destinations, conditions);
return;
}
}
@@ -685,7 +754,7 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
dl_blocks_discard_completely != d->_imp->opts->blocks);
Save<tr1::shared_ptr<DepListOverrideMasksFunctions> > save_o(&d->_imp->opts->override_masks,
tr1::shared_ptr<DepListOverrideMasksFunctions>());
- d->add_not_top_level(*c, destinations, conditions);
+ d->add_not_top_level(only_if_not_suggested_label, *c, destinations, conditions);
return;
}
catch (const DepListError &)
@@ -707,7 +776,7 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
dl_blocks_discard_completely != d->_imp->opts->blocks);
Save<tr1::shared_ptr<DepListOverrideMasksFunctions> > save_o(&d->_imp->opts->override_masks,
tr1::shared_ptr<DepListOverrideMasksFunctions>());
- d->add_not_top_level(*c, destinations, conditions);
+ d->add_not_top_level(only_if_not_suggested_label, *c, destinations, conditions);
return;
}
catch (const DepListError &)
@@ -724,7 +793,7 @@ DepList::AddVisitor::visit_sequence(const AnyDepSpec & a,
if (! is_viable_any_child(*c))
continue;
- d->add_not_top_level(*c, destinations, conditions);
+ d->add_not_top_level(only_if_not_suggested_label, *c, destinations, conditions);
return;
}
}
@@ -895,9 +964,9 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
}
void
-DepList::AddVisitor::visit_leaf(const DependencyLabelsDepSpec &)
+DepList::AddVisitor::visit_leaf(const DependencyLabelsDepSpec & spec)
{
- // XXX implement
+ d->_imp->labels.begin()->reset(new ActiveDependencyLabels(**d->_imp->labels.begin(), spec));
}
DepList::DepList(const Environment * const e, const DepListOptions & o) :
@@ -929,22 +998,23 @@ DepList::clear()
}
void
-DepList::add_in_role(DependencySpecTree::ConstItem & spec, const std::string & role,
+DepList::add_in_role(const bool only_if_not_suggested_label, DependencySpecTree::ConstItem & spec, const std::string & role,
tr1::shared_ptr<const DestinationsSet> destinations)
{
- Context context("When adding " + role + ":");
- add_not_top_level(spec, destinations,
+ Context context("When adding " + role + (only_if_not_suggested_label ? " unless under a suggested label" : "") + ":");
+ add_not_top_level(only_if_not_suggested_label, spec, destinations,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> >(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec))));
}
void
-DepList::add_not_top_level(DependencySpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsSet> destinations,
+DepList::add_not_top_level(const bool only_if_not_suggested_label,
+ DependencySpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsSet> destinations,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions)
{
DepListTransaction transaction(_imp->merge_list, _imp->merge_list_index, _imp->merge_list_generation);
- AddVisitor visitor(this, destinations, conditions);
+ AddVisitor visitor(this, only_if_not_suggested_label, destinations, conditions);
spec.accept(visitor);
transaction.commit();
}
@@ -957,7 +1027,7 @@ DepList::add(SetSpecTree::ConstItem & spec, tr1::shared_ptr<const DestinationsSe
Save<SetSpecTree::ConstItem *> save_current_top_level_target(&_imp->current_top_level_target,
_imp->current_top_level_target ? _imp->current_top_level_target : &spec);
- AddVisitor visitor(this, destinations);
+ AddVisitor visitor(this, false, destinations);
spec.accept(visitor);
transaction.commit();
}
@@ -1064,33 +1134,45 @@ DepList::add_package(const tr1::shared_ptr<const PackageID> & p, tr1::shared_ptr
Context c("When showing suggestions:");
Save<MergeList::iterator> suggest_save_merge_list_insert_position(&_imp->merge_list_insert_position,
next(our_merge_entry_position));
- ShowSuggestVisitor visitor(this, destinations, _imp->env, _imp->current_package_id(), _imp->opts->dependency_tags);
+ ShowSuggestVisitor visitor(this, destinations, _imp->env, _imp->current_package_id(), _imp->opts->dependency_tags, false);
p->suggested_dependencies_key()->value()->accept(visitor);
}
+ /* add suggests in post depend too */
+ if (_imp->opts->suggested == dl_suggested_show && p->post_dependencies_key())
+ {
+ Context c("When showing suggestions in post dependencies key:");
+ Save<MergeList::iterator> suggest_save_merge_list_insert_position(&_imp->merge_list_insert_position,
+ next(our_merge_entry_position));
+ ShowSuggestVisitor visitor(this, destinations, _imp->env, _imp->current_package_id(), _imp->opts->dependency_tags, true);
+ p->post_dependencies_key()->value()->accept(visitor);
+ }
+
/* add pre dependencies */
if (p->build_dependencies_key())
- add_predeps(*p->build_dependencies_key()->value(), _imp->opts->uninstalled_deps_pre, "build", destinations);
+ add_predeps(*p->build_dependencies_key()->value(), _imp->opts->uninstalled_deps_pre, "build", destinations, false);
if (p->run_dependencies_key())
- add_predeps(*p->run_dependencies_key()->value(), _imp->opts->uninstalled_deps_runtime, "run", destinations);
+ add_predeps(*p->run_dependencies_key()->value(), _imp->opts->uninstalled_deps_runtime, "run", destinations, false);
if (p->post_dependencies_key())
- add_predeps(*p->post_dependencies_key()->value(), _imp->opts->uninstalled_deps_post, "post", destinations);
+ add_predeps(*p->post_dependencies_key()->value(), _imp->opts->uninstalled_deps_post, "post", destinations,
+ (_imp->opts->suggested == dl_suggested_install) ? false : true);
if (_imp->opts->suggested == dl_suggested_install && p->suggested_dependencies_key())
- add_predeps(*p->suggested_dependencies_key()->value(), _imp->opts->uninstalled_deps_suggested, "suggest", destinations);
+ add_predeps(*p->suggested_dependencies_key()->value(), _imp->opts->uninstalled_deps_suggested, "suggest", destinations, false);
our_merge_entry_position->state = dle_has_pre_deps;
_imp->merge_list_insert_position = next(our_merge_entry_post_position);
/* add post dependencies */
if (p->build_dependencies_key())
- add_postdeps(*p->build_dependencies_key()->value(), _imp->opts->uninstalled_deps_pre, "build", destinations);
+ add_postdeps(*p->build_dependencies_key()->value(), _imp->opts->uninstalled_deps_pre, "build", destinations, false);
if (p->run_dependencies_key())
- add_postdeps(*p->run_dependencies_key()->value(), _imp->opts->uninstalled_deps_runtime, "run", destinations);
+ add_postdeps(*p->run_dependencies_key()->value(), _imp->opts->uninstalled_deps_runtime, "run", destinations, false);
if (p->post_dependencies_key())
- add_postdeps(*p->post_dependencies_key()->value(), _imp->opts->uninstalled_deps_post, "post", destinations);
+ add_postdeps(*p->post_dependencies_key()->value(), _imp->opts->uninstalled_deps_post, "post", destinations,
+ (_imp->opts->suggested == dl_suggested_install) ? false : true);
if (_imp->opts->suggested == dl_suggested_install && p->suggested_dependencies_key())
- add_postdeps(*p->suggested_dependencies_key()->value(), _imp->opts->uninstalled_deps_suggested, "suggest", destinations);
+ add_postdeps(*p->suggested_dependencies_key()->value(), _imp->opts->uninstalled_deps_suggested, "suggest", destinations, false);
our_merge_entry_position->state = dle_has_all_deps;
}
@@ -1172,13 +1254,13 @@ DepList::add_suggested_package(const tr1::shared_ptr<const PackageID> & p,
void
DepList::add_predeps(DependencySpecTree::ConstItem & d, const DepListDepsOption opt, const std::string & s,
- tr1::shared_ptr<const DestinationsSet> destinations)
+ tr1::shared_ptr<const DestinationsSet> destinations, const bool only_if_not_suggested_label)
{
if (dl_deps_pre == opt || dl_deps_pre_or_post == opt)
{
try
{
- add_in_role(d, s + " dependencies as pre dependencies", destinations);
+ add_in_role(only_if_not_suggested_label, d, s + " dependencies as pre dependencies", destinations);
}
catch (const DepListError & e)
{
@@ -1193,7 +1275,7 @@ DepList::add_predeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
void
DepList::add_postdeps(DependencySpecTree::ConstItem & d, const DepListDepsOption opt, const std::string & s,
- tr1::shared_ptr<const DestinationsSet> destinations)
+ tr1::shared_ptr<const DestinationsSet> destinations, const bool only_if_not_suggested_label)
{
if (dl_deps_pre_or_post == opt || dl_deps_post == opt || dl_deps_try_post == opt)
{
@@ -1201,7 +1283,7 @@ DepList::add_postdeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
{
try
{
- add_in_role(d, s + " dependencies as post dependencies", destinations);
+ add_in_role(only_if_not_suggested_label, d, s + " dependencies as post dependencies", destinations);
}
catch (const CircularDependencyError &)
{
@@ -1210,7 +1292,7 @@ DepList::add_postdeps(DependencySpecTree::ConstItem & d, const DepListDepsOption
dl_circular_discard_silently : dl_circular_discard);
Save<MergeList::iterator> save_merge_list_insert_position(&_imp->merge_list_insert_position,
_imp->merge_list.end());
- add_in_role(d, s + " dependencies as post dependencies with cycle breaking", destinations);
+ add_in_role(only_if_not_suggested_label, d, s + " dependencies as post dependencies with cycle breaking", destinations);
}
}
catch (const DepListError & e)
@@ -1259,21 +1341,21 @@ DepList::add_already_installed_package(const tr1::shared_ptr<const PackageID> &
our_merge_entry);
if (p->build_dependencies_key())
- add_predeps(*p->build_dependencies_key()->value(), _imp->opts->installed_deps_pre, "build", destinations);
+ add_predeps(*p->build_dependencies_key()->value(), _imp->opts->installed_deps_pre, "build", destinations, false);
if (p->run_dependencies_key())
- add_predeps(*p->run_dependencies_key()->value(), _imp->opts->installed_deps_runtime, "run", destinations);
+ add_predeps(*p->run_dependencies_key()->value(), _imp->opts->installed_deps_runtime, "run", destinations, false);
if (p->post_dependencies_key())
- add_predeps(*p->post_dependencies_key()->value(), _imp->opts->installed_deps_post, "post", destinations);
+ add_predeps(*p->post_dependencies_key()->value(), _imp->opts->installed_deps_post, "post", destinations, true);
our_merge_entry->state = dle_has_pre_deps;
_imp->merge_list_insert_position = next(our_merge_entry);
if (p->build_dependencies_key())
- add_postdeps(*p->build_dependencies_key()->value(), _imp->opts->installed_deps_pre, "build", destinations);
+ add_postdeps(*p->build_dependencies_key()->value(), _imp->opts->installed_deps_pre, "build", destinations, false);
if (p->run_dependencies_key())
- add_postdeps(*p->run_dependencies_key()->value(), _imp->opts->installed_deps_runtime, "run", destinations);
+ add_postdeps(*p->run_dependencies_key()->value(), _imp->opts->installed_deps_runtime, "run", destinations, false);
if (p->post_dependencies_key())
- add_postdeps(*p->post_dependencies_key()->value(), _imp->opts->installed_deps_post, "post", destinations);
+ add_postdeps(*p->post_dependencies_key()->value(), _imp->opts->installed_deps_post, "post", destinations, true);
}
namespace
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index f02d80b..c7e537a 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -80,7 +80,7 @@ namespace paludis
/**
* Add a DepSpec with role context.
*/
- void add_in_role(DependencySpecTree::ConstItem &, const std::string & role,
+ void add_in_role(const bool only_if_not_suggested_label, DependencySpecTree::ConstItem &, const std::string & role,
tr1::shared_ptr<const DestinationsSet>);
/**
@@ -114,13 +114,13 @@ namespace paludis
* Add predependencies.
*/
void add_predeps(DependencySpecTree::ConstItem &, const DepListDepsOption, const std::string &,
- tr1::shared_ptr<const DestinationsSet> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations, const bool only_if_not_suggested_label);
/**
* Add postdependencies.
*/
void add_postdeps(DependencySpecTree::ConstItem &, const DepListDepsOption, const std::string &,
- tr1::shared_ptr<const DestinationsSet> destinations);
+ tr1::shared_ptr<const DestinationsSet> destinations, const bool only_if_not_suggested_label);
/**
* Return whether the specified PackageID is matched by
@@ -128,7 +128,9 @@ namespace paludis
*/
bool is_top_level_target(const PackageID &) const;
- void add_not_top_level(DependencySpecTree::ConstItem &,
+ void add_not_top_level(
+ const bool only_if_not_suggested_label,
+ DependencySpecTree::ConstItem &,
tr1::shared_ptr<const DestinationsSet> target_destinations,
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions);
diff --git a/paludis/environments/paludis/Makefile.am b/paludis/environments/paludis/Makefile.am
index 3c059b4..8ee323a 100644
--- a/paludis/environments/paludis/Makefile.am
+++ b/paludis/environments/paludis/Makefile.am
@@ -72,6 +72,7 @@ TESTS = paludis_environment_TEST
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_SKIP_CONFIG="yes" \
diff --git a/paludis/environments/portage/Makefile.am b/paludis/environments/portage/Makefile.am
index 62852c0..c7f290b 100644
--- a/paludis/environments/portage/Makefile.am
+++ b/paludis/environments/portage/Makefile.am
@@ -43,6 +43,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
PALUDIS_SKIP_CONFIG="yes" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_REPOSITORY_SO_DIR="$(top_builddir)/paludis/repositories" \
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index d33dbd3..2dfa808 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -412,6 +412,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_FETCHERS_DIR="$(top_srcdir)/paludis/fetchers/" \
@@ -509,7 +510,7 @@ endif
paludis_datadir = $(datadir)/paludis
-dist_paludis_data_DATA = traditional.exclude
+dist_paludis_data_DATA = traditional.exclude ebuild_entries_suffixes.conf
TESTS = \
dep_lexer_TEST \
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index f46897c..b6c1fa1 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -412,5 +412,26 @@ namespace test_cases
&env, id, *EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringParseError);
}
} test_dep_spec_parser_labels;
+
+ struct DepParserKDEBuildURILabelsTest : TestCase
+ {
+ DepParserKDEBuildURILabelsTest() : TestCase("kdebuild uri label handling") { }
+
+ void run()
+ {
+ StringifyFormatter ff;
+ TestEnvironment env;
+ tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
+ env.package_database()->add_repository(1, repo);
+ tr1::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
+
+ DepSpecPrettyPrinter d(0, tr1::shared_ptr<const PackageID>(), ff, 0, false);
+ parse_fetchable_uri("http://foo/bar manual: two",
+ &env, id, *EAPIData::get_instance()->eapi_from_string("kdebuild-1"))->accept(d);
+ TEST_CHECK_EQUAL(stringify(d), "http://foo/bar manual: two");
+ TEST_CHECK_THROWS(parse_fetchable_uri("http://foo/bar monkey: two",
+ &env, id, *EAPIData::get_instance()->eapi_from_string("kdebuild-1"))->accept(d), DepStringParseError);
+ }
+ } test_dep_spec_parser_kdebuild_uri_labels;
}
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index a7cec5c..1ce7a1b 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -457,6 +457,7 @@ EInstalledRepository::perform_info(const tr1::shared_ptr<const ERepositoryID> &
(k::expand_vars(), make_shared_ptr(new Map<std::string, std::string>))
(k::profiles(), make_shared_ptr(new FSEntrySequence))
(k::info_vars(), i)
+ (k::use_ebuild_file(), false)
(k::load_environment(), load_env.get()));
info_cmd();
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 5cde664..d21520d 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1310,9 +1310,171 @@ namespace test_cases
TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("dosym success 1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-success-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_1;
+ struct ERepositoryInstallEAPIKdebuild1Test : TestCase
+ {
+ ERepositoryInstallEAPIKdebuild1Test() : TestCase("install_eapi_kdebuild_1") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", "e_repository_TEST_dir/repo13");
+ keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
+ env.package_database()->add_repository(1, repo);
+
+ tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InstallAction action(InstallActionOptions::named_create()
+ (k::debug_build(), iado_none)
+ (k::checks(), iaco_default)
+ (k::no_config_protect(), false)
+ (k::destination(), installed_repo)
+ );
+
+ {
+ TestMessageSuffix suffix("econf source kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("banned functions kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
+
+ {
+ TestMessageSuffix suffix("banned vars kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/banned-vars-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "UNKNOWN");
+ }
+
+ {
+ TestMessageSuffix suffix("dosym success kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-success-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("dosym fail kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-fail-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
+ }
+ } test_e_repository_install_eapi_kdebuild_1;
+
+ struct ERepositoryInfoEAPIKdebuild1Test : TestCase
+ {
+ ERepositoryInfoEAPIKdebuild1Test() : TestCase("info_eapi_kdebuild_1") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", "e_repository_TEST_dir/repo13");
+ keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
+ env.package_database()->add_repository(1, repo);
+
+ tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InfoAction action;
+
+ {
+ TestMessageSuffix suffix("info success kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/info-success-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("info fail kdebuild-1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/info-fail-kdebuild-1",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ TEST_CHECK_THROWS(id->perform_action(action), InfoActionError);
+ }
+ }
+ } test_e_repository_info_eapi_kdebuild_1;
+
struct ERepositoryInstallExheres0Test : TestCase
{
ERepositoryInstallExheres0Test() : TestCase("install_exheres_0") { }
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index ffdbc1a..6eb0caf 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -612,6 +612,22 @@ src_install() {
}
END
cp cat/econf-source/econf-source-{0,1}.ebuild || exit 1
+mkdir -p "cat/dosym-success"
+cat <<'END' > cat/dosym-success/dosym-success-1.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dosym foo /usr/bin/bar
+ [[ "$(readlink ${D}/usr/bin/bar )" == "foo" ]] || die
+}
+END
mkdir -p "cat/best-version"
cat <<'END' > cat/best-version/best-version-0.ebuild || exit 1
DESCRIPTION="The Description"
@@ -727,6 +743,113 @@ pkg_preinst() {
[[ -d "${T}" ]] || die "T not a dir"
}
END
+mkdir -p "cat/econf-source-kdebuild"
+cat <<END > cat/econf-source-kdebuild/econf-source-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ ECONF_SOURCE=subdir
+ mkdir \${S}
+ cd \${S}
+ mkdir subdir
+ echo 'touch monkey' > subdir/configure
+ chmod +x subdir/configure
+}
+
+src_install() {
+ insinto /usr/bin
+ doins monkey || die "no monkey"
+}
+END
+mkdir -p "cat/info-success-kdebuild"
+cat <<END > cat/info-success-kdebuild/info-success-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_info() {
+ einfo "This is my pkg_info. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/info-fail-kdebuild"
+cat <<END > cat/info-fail-kdebuild/info-fail-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_info() {
+ die "This is my pkg_info. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/banned-functions-kdebuild"
+cat <<END > cat/banned-functions-kdebuild/banned-functions-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ prepall
+}
+END
+mkdir -p "cat/banned-vars-kdebuild"
+cat <<END > cat/banned-vars-kdebuild/banned-vars-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+PROVIDE="virtual/monkey"
+END
+mkdir -p "cat/dosym-success-kdebuild"
+cat <<'END' > cat/dosym-success-kdebuild/dosym-success-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dodir /usr/bin
+ dosym foo /usr/bin/bar
+ [[ "$(readlink ${D}/usr/bin/bar )" == "foo" ]] || die
+}
+END
+mkdir -p "cat/dosym-fail-kdebuild"
+cat <<END > cat/dosym-fail-kdebuild/dosym-fail-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dosym foo /usr/bin/bar
+}
+END
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
diff --git a/paludis/repositories/e/e_repository_entries.hh b/paludis/repositories/e/e_repository_entries.hh
index d006b27..1c5e9fb 100644
--- a/paludis/repositories/e/e_repository_entries.hh
+++ b/paludis/repositories/e/e_repository_entries.hh
@@ -71,8 +71,7 @@ namespace paludis
/**
* Create an ERepositoryID.
*/
- virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &, const std::string &) const
+ virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 7383f76..d001e1b 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -252,6 +252,8 @@ namespace paludis
k.get("unpack_unrecognised_is_fatal")))
.unpack_fix_permissions(destringify<bool>(
k.get("unpack_fix_permissions")))
+ .dosym_mkdir(destringify<bool>(
+ k.get("dosym_mkdir")))
))
))));
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index 2f53b71..5e13c7d 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -105,6 +105,7 @@ make_class_EAPIToolsOptions()
key unpack_unrecognised_is_fatal bool
key unpack_fix_permissions bool
+ key dosym_mkdir bool
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 3b8d47a..0188973 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -197,4 +197,5 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = true
+dosym_mkdir = true
diff --git a/paludis/repositories/e/eapis/Makefile.am b/paludis/repositories/e/eapis/Makefile.am
index ed27090..634cf1e 100644
--- a/paludis/repositories/e/eapis/Makefile.am
+++ b/paludis/repositories/e/eapis/Makefile.am
@@ -6,6 +6,7 @@ eapis = \
0.conf \
1.conf \
exheres-0.conf \
+ kdebuild-1.conf \
paludis-1.conf \
pbin-1+0.conf \
pbin-1+1.conf \
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 76758f7..bf14317 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -224,4 +224,5 @@ pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = true
unpack_fix_permissions = false
+dosym_mkdir = false
diff --git a/paludis/repositories/e/eapis/kdebuild-1.conf b/paludis/repositories/e/eapis/kdebuild-1.conf
new file mode 100644
index 0000000..bc3d24e
--- /dev/null
+++ b/paludis/repositories/e/eapis/kdebuild-1.conf
@@ -0,0 +1,58 @@
+# Configuration for EAPI kdebuild-1
+# EAPI kdebuild-1 is used by the Gentoo KDE project. It is specified in PMS,
+# possibly as a hidden extra.
+
+source ${PALUDIS_EAPIS_DIR}/1.conf
+exported_name = kdebuild-1
+can_be_pbin = false
+
+package_dep_spec_parse_options = allow_slot_deps allow_slot_deps allow_slot_equal_deps \
+ allow_slot_star_deps allow_square_bracket_deps
+ebuild_module_suffixes = kdebuild-1 1 0
+utility_path_suffixes = kdebuild-1 1 0
+dependency_spec_tree_parse_options = uri_supports_arrow
+breaks_portage = true
+
+bracket_merged_variables = DEPEND RDEPEND PDEPEND
+source_merged_variables = IUSE KEYWORDS
+
+ebuild_must_not_set_variables = ${ebuild_must_not_set_variables} PROVIDE
+description_provide =
+metadata_provide =
+flat_cache_provide = -1
+
+ebuild_install = \
+ : killold ; \
+ userpriv sandbox : init saveenv ; \
+ : loadenv setup saveenv ; \
+ sandbox userpriv : loadenv unpack compile saveenv ; \
+ sandbox userpriv checkphase checks=default checks=always : loadenv test saveenv ; \
+ sandbox : loadenv install saveenv ; \
+ strip : ; \
+ prepost : loadenv preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+ebuild_info = \
+ : killoldmisc ; \
+ sandbox userpriv installed=true : initmisc infovars info ; \
+ sandbox userpriv installed=false : initmisc infovars info ; \
+ : tidyupmisc
+
+uri_labels = \
+ default = URIMirrorsThenListedLabel ; \
+ default-restrict-fetch = URIManualOnlyLabel ; \
+ default-restrict-mirror = URIListedOnlyLabel ; \
+ mirrors-first = URIMirrorsThenListedLabel ; \
+ mirrors-only = URIMirrorsOnlyLabel ; \
+ listed-first = URIListedThenMirrorsLabel ; \
+ listed-only = URIListedOnlyLabel ; \
+ manual = URIManualOnlyLabel
+
+dependency_labels = \
+ suggested = DependencySuggestedLabel ; \
+ required = DependencyRequiredLabel ;
+
+dosym_mkdir = false
+
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 0d22cc5..18e00d1 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -216,4 +216,5 @@ pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = false
+dosym_mkdir = false
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 1b09b74..f467c59 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -179,6 +179,8 @@ EbuildCommand::operator() ()
(*(*params[k::package_id()]->eapi())[k::supported()])[k::tools_options()].unpack_unrecognised_is_fatal ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
(*(*params[k::package_id()]->eapi())[k::supported()])[k::tools_options()].unpack_fix_permissions ? "yes" : "")
+ .with_setenv("PALUDIS_DOSYM_NO_MKDIR",
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::tools_options()].dosym_mkdir ? "" : "yes")
.with_setenv("PALUDIS_UNPACK_FROM_VAR",
(*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_distdir()])
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
@@ -637,6 +639,12 @@ EbuildUninstallCommand::EbuildUninstallCommand(const EbuildCommandParams & p,
}
std::string
+EbuildConfigCommand::ebuild_file() const
+{
+ return "-";
+}
+
+std::string
EbuildConfigCommand::commands() const
{
return params[k::commands()];
@@ -791,6 +799,15 @@ EbuildPretendCommand::EbuildPretendCommand(const EbuildCommandParams & p,
}
std::string
+EbuildInfoCommand::ebuild_file() const
+{
+ if (info_params[k::use_ebuild_file()])
+ return stringify(params[k::ebuild_file()]);
+ else
+ return "-";
+}
+
+std::string
EbuildInfoCommand::commands() const
{
return params[k::commands()];
@@ -799,7 +816,7 @@ EbuildInfoCommand::commands() const
bool
EbuildInfoCommand::failure()
{
- return false;
+ throw InfoActionError("Info command failed");
}
Command
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index d25702b..52a71c8 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -166,7 +166,8 @@ namespace paludis
kc::Field<k::profiles, tr1::shared_ptr<const FSEntrySequence> >,
kc::Field<k::expand_vars, tr1::shared_ptr<const Map<std::string, std::string> > >,
kc::Field<k::load_environment, const FSEntry *>,
- kc::Field<k::info_vars, FSEntry>
+ kc::Field<k::info_vars, FSEntry>,
+ kc::Field<k::use_ebuild_file, bool>
> EbuildInfoCommandParams;
/**
@@ -425,6 +426,8 @@ namespace paludis
virtual Command extend_command(const Command &);
+ virtual std::string ebuild_file() const;
+
public:
/**
* Constructor.
@@ -433,7 +436,7 @@ namespace paludis
};
/**
- * An EbuildPretendCommand is used to configure a package in a VDBRepository.
+ * An EbuildPretendCommand is used to pretend a package in ERepository.
*
* \ingroup grpebuildinterface
*/
@@ -458,7 +461,7 @@ namespace paludis
};
/**
- * An EbuildInfoCommand is used to obtain information from a package in a VDBRepository.
+ * An EbuildInfoCommand is used to obtain information from a package.
*
* \ingroup grpebuildinterface
*/
@@ -471,10 +474,12 @@ namespace paludis
virtual std::string commands() const;
- virtual bool failure();
+ virtual bool failure() PALUDIS_ATTRIBUTE((noreturn));
virtual Command extend_command(const Command &);
+ virtual std::string ebuild_file() const;
+
public:
/**
* Constructor.
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index 21b6f70..1c0678b 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~
-SUBDIRS = . 0 1 exheres-0 paludis-1 pbin-1 utils
+SUBDIRS = . 0 1 exheres-0 kdebuild-1 paludis-1 pbin-1 utils
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index b677759..8e6c068 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -171,7 +171,6 @@ check_base_vars="${save_base_vars}"
check_unmodifiable_vars="${save_unmodifiable_vars}"
for var in ${save_vars} ${default_save_vars} ${save_base_vars} ${save_unmodifiable_vars} ; do
- ebuild_notice "debug" "Saving ${var}=${!var}"
eval "export save_var_${var}='${!var}'"
done
diff --git a/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am b/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am
new file mode 100644
index 0000000..28f9af7
--- /dev/null
+++ b/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am
@@ -0,0 +1,38 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogkdebuild1dir = $(libexecdir)/paludis/kdebuild-1
+
+libexecprogkdebuild1_SCRIPTS = \
+ output_functions.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
+ PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
+ PALUDIS_EBUILD_MODULE_SUFFIXES="1 0" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+EXTRA_DIST = $(libexecprog1_SCRIPTS)
+
+built-sources : $(BUILT_SOURCES)
+ for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+
+distcheck-deps-local : $(DISTCHECK_DEPS)
+
+distcheck-deps : distcheck-deps-subdirs
+
+distcheck-deps-subdirs :
+ for s in $(SUBDIRS) . ; do if test x$$s = x. ; then $(MAKE) distcheck-deps-local || exit 1 ; \
+ else $(MAKE) -C $$s distcheck-deps || exit 1 ; fi ; done
+
+
diff --git a/paludis/repositories/e/ebuild/kdebuild-1/output_functions.bash b/paludis/repositories/e/ebuild/kdebuild-1/output_functions.bash
new file mode 100644
index 0000000..aca3739
--- /dev/null
+++ b/paludis/repositories/e/ebuild/kdebuild-1/output_functions.bash
@@ -0,0 +1,31 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# 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
+
+ebuild_notice()
+{
+ [[ -z "${PALUDIS_PIPE_COMMANDS_SUPPORTED}" ]] && return
+ paludis_pipe_command LOG "$EAPI" "$@" >/dev/null
+}
+
+ebuild_section()
+{
+ echo -ne "${COLOUR_CYAN}>>>${COLOUR_NORMAL} "
+ echo "$@"
+}
+
+
diff --git a/paludis/repositories/e/ebuild/utils/Makefile.am b/paludis/repositories/e/ebuild/utils/Makefile.am
index df81873..74ac3fb 100644
--- a/paludis/repositories/e/ebuild/utils/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/Makefile.am
@@ -1,5 +1,5 @@
MAINTAINERCLEANFILES = Makefile.in
-SUBDIRS = . exheres-0
+SUBDIRS = . exheres-0 kdebuild-1
libexecprogdir = $(libexecdir)/paludis/utils
diff --git a/paludis/repositories/e/ebuild/utils/dosym b/paludis/repositories/e/ebuild/utils/dosym
index a54b115..e1cbcea 100755
--- a/paludis/repositories/e/ebuild/utils/dosym
+++ b/paludis/repositories/e/ebuild/utils/dosym
@@ -36,8 +36,14 @@ if [[ ${#} -ne 2 ]]; then
fi
if [[ ! -d $(dirname "${D}$2") ]]; then
- ebuild_notice "qa" "$0: target directory $(dirname "${D}$2") does not exist; creating. Please fix the ebuild to create it explicitly."
- dodir $(dirname $2)
+ if [[ -n "${PALUDIS_DOSYM_NO_MKDIR}" ]] ; then
+ echo "dosym: error: target directory $(dirname "${D}$2" ) does not exist" 1>&2
+ kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+ exit 123
+ else
+ ebuild_notice "qa" "$0: target directory $(dirname "${D}$2") does not exist; creating. Please fix the ebuild to create it explicitly."
+ dodir $(dirname $2)
+ fi
fi
ln -snf "${1}" "${D}${2}"
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
index 50da7ba..48f4dc6 100644
--- a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
@@ -49,6 +49,7 @@ CLEANFILES = *~ $(bannedscripts)
$(bannedscripts) : banned_in_eapi_exheres-0
cat $? > $@
+ chmod +x $@
check_PROGRAMS =
diff --git a/paludis/repositories/e/ebuild/utils/kdebuild-1/Makefile.am b/paludis/repositories/e/ebuild/utils/kdebuild-1/Makefile.am
new file mode 100644
index 0000000..01527e5
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/kdebuild-1/Makefile.am
@@ -0,0 +1,64 @@
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = .
+
+libexecprogdir = $(libexecdir)/paludis/utils/kdebuild-1
+
+libexecprog_SCRIPTS = \
+ dohard \
+ dohtml \
+ dosed \
+ donewins \
+ prepall \
+ prepallstrip \
+ prepstrip \
+ prepallman \
+ prepman \
+ prepallinfo \
+ prepinfo \
+ prepdocs \
+ prepalldocs \
+ ecompress \
+ ecompressdir \
+ banned_in_eapi_kdebuild-1
+
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_UTILITY_PATH_SUFFIXES="exheres-0" \
+ PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise \
+ $(top_srcdir)/paludis/repositories/e/ebuild/`" \
+ PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ PALUDIS_EBUILD_LOG_LEVEL="silent" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/paludis/repositories/e/ebuild/utils/run_test.bash
+
+TESTS =
+
+EXTRA_DIST = $(libexecprog_SCRIPTS) $(check_SCRIPTS) \
+ banned_in_eapi_kdebuild-1 $(TESTS)
+
+bannedscripts = prepall prepallstrip prepstrip prepallman prepman prepallinfo \
+ prepinfo prepdocs prepalldocs dohard donewins dosed dohtml \
+ ecompress ecompressdir
+
+CLEANFILES = *~ $(bannedscripts)
+
+$(bannedscripts) : banned_in_eapi_kdebuild-1
+ cat $? > $@
+ chmod +x $@
+
+check_PROGRAMS =
+
+built-sources : $(BUILT_SOURCES)
+ for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+
+distcheck-deps-local : $(DISTCHECK_DEPS)
+
+distcheck-deps : distcheck-deps-subdirs
+
+distcheck-deps-subdirs :
+ for s in $(SUBDIRS) . ; do if test x$$s = x. ; then $(MAKE) distcheck-deps-local || exit 1 ; \
+ else $(MAKE) -C $$s distcheck-deps || exit 1 ; fi ; done
+
diff --git a/paludis/repositories/e/ebuild/utils/kdebuild-1/banned_in_eapi_kdebuild-1 b/paludis/repositories/e/ebuild/utils/kdebuild-1/banned_in_eapi_kdebuild-1
new file mode 100644
index 0000000..a987d4e
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/kdebuild-1/banned_in_eapi_kdebuild-1
@@ -0,0 +1,29 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008 Ciaran McCreesh
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+COLOUR_RED=$'\e[31;01m'
+COLOUR_NORMAL=$'\e[0m'
+
+echo "${COLOUR_RED}!!! Ebuild bug: '$(basename ${0} )' banned in EAPI kdebuild-1${COLOUR_NORMAL}"
+echo "$(basename ${0} ): making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+
+exit 123
+
+
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 907e884..2d8f174 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -50,6 +50,8 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/kc.hh>
+#include <paludis/util/config_file.hh>
+#include <paludis/util/instantiation_policy-impl.hh>
#include <fstream>
#include <list>
@@ -61,6 +63,44 @@
using namespace paludis;
using namespace paludis::erepository;
+namespace
+{
+ struct Suffixes :
+ InstantiationPolicy<Suffixes, instantiation_method::SingletonTag>
+ {
+ KeyValueConfigFile file;
+
+ Suffixes() :
+ file(FSEntry(getenv_with_default("PALUDIS_SUFFIXES_FILE", DATADIR "/paludis/ebuild_entries_suffixes.conf")),
+ KeyValueConfigFileOptions())
+ {
+ }
+
+ bool is_known_suffix(const std::string & s) const
+ {
+ return ! file.get("suffix_" + s + "_known").empty();
+ }
+
+ std::string guess_eapi(const std::string & s) const
+ {
+ return file.get("guess_eapi_" + s);
+ }
+
+ std::string manifest_key(const std::string & s) const
+ {
+ std::string result(file.get("manifest_key_" + s));
+ if (result.empty())
+ {
+ Log::get_instance()->message(ll_warning, lc_context) << "Don't know what the manifest key for files with "
+ "suffix '" << s << "' is, guessing 'MISC'";
+ return "MISC";
+ }
+ else
+ return result;
+ }
+ };
+}
+
namespace paludis
{
/**
@@ -104,13 +144,12 @@ EbuildEntries::~EbuildEntries()
}
const tr1::shared_ptr<const ERepositoryID>
-EbuildEntries::make_id(const QualifiedPackageName & q, const VersionSpec & v, const FSEntry & f,
- const std::string & guessed_eapi) const
+EbuildEntries::make_id(const QualifiedPackageName & q, const FSEntry & f) const
{
- Context context("When creating ID for '" + stringify(q) + "-" + stringify(v) + "' from '" + stringify(f) + "':");
+ Context context("When creating ID for '" + stringify(q) + "' from '" + stringify(f) + "':");
- tr1::shared_ptr<EbuildID> result(new EbuildID(q, v, _imp->params.environment,
- _imp->e_repository->shared_from_this(), f, guessed_eapi,
+ tr1::shared_ptr<EbuildID> result(new EbuildID(q, extract_package_file_version(q, f), _imp->params.environment,
+ _imp->e_repository->shared_from_this(), f, _guess_eapi(q, f),
_imp->master_mtime, _imp->eclass_mtimes));
return result;
}
@@ -397,7 +436,7 @@ EbuildEntries::fetch(const tr1::shared_ptr<const ERepositoryID> & id,
(k::environment(), _imp->params.environment)
(k::package_id(), id)
(k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
- (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::ebuild_file(), id->fs_location_key()->value())
(k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
(k::eclassdirs(), _imp->params.eclassdirs)
(k::exlibsdirs(), exlibsdirs)
@@ -608,7 +647,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
(k::environment(), _imp->params.environment)
(k::package_id(), id)
(k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
- (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::ebuild_file(), id->fs_location_key()->value())
(k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
(k::eclassdirs(), _imp->params.eclassdirs)
(k::exlibsdirs(), exlibsdirs)
@@ -673,7 +712,7 @@ EbuildEntries::info(const tr1::shared_ptr<const ERepositoryID> & id,
(k::environment(), _imp->params.environment)
(k::package_id(), id)
(k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
- (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::ebuild_file(), id->fs_location_key()->value())
(k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
(k::eclassdirs(), _imp->params.eclassdirs)
(k::exlibsdirs(), exlibsdirs)
@@ -701,6 +740,7 @@ EbuildEntries::info(const tr1::shared_ptr<const ERepositoryID> & id,
(k::profiles(), _imp->params.profiles)
(k::load_environment(), static_cast<const FSEntry *>(0))
(k::info_vars(), i)
+ (k::use_ebuild_file(), true)
);
EbuildInfoCommand cmd(command_params, info_params);
@@ -725,7 +765,7 @@ EbuildEntries::get_environment_variable(const tr1::shared_ptr<const ERepositoryI
(k::environment(), _imp->params.environment)
(k::package_id(), id)
(k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
- (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::ebuild_file(), id->fs_location_key()->value())
(k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
(k::eclassdirs(), _imp->params.eclassdirs)
(k::exlibsdirs(), exlibsdirs)
@@ -788,26 +828,27 @@ EbuildEntries::merge(const MergeParams & m)
bool
EbuildEntries::is_package_file(const QualifiedPackageName & n, const FSEntry & e) const
{
- if (_imp->e_repository->layout()->eapi_ebuild_suffix())
- return (0 == e.basename().compare(0, stringify(n.package).length() + 1, stringify(n.package) + "-")) &&
- std::string::npos != e.basename().rfind('.') &&
- e.basename().at(e.basename().length() - 1) != '~' &&
- e.is_regular_file_or_symlink_to_regular_file();
- else
- return is_file_with_prefix_extension(e, stringify(n.package) + "-", ".ebuild", IsFileWithOptions());
+ Context context("When working out whether '" + stringify(e) + "' is a package file for '" + stringify(n) + "':");
+
+ if (0 != e.basename().compare(0, stringify(n.package).length() + 1, stringify(n.package) + "-"))
+ return false;
+
+ std::string::size_type p(e.basename().rfind('.'));
+ if (std::string::npos == p)
+ return false;
+
+ std::string suffix(e.basename().substr(p + 1));
+ return Suffixes::get_instance()->is_known_suffix(suffix);
}
VersionSpec
EbuildEntries::extract_package_file_version(const QualifiedPackageName & n, const FSEntry & e) const
{
Context context("When extracting version from '" + stringify(e) + "':");
- if (_imp->e_repository->layout()->eapi_ebuild_suffix())
- {
- std::string::size_type p(e.basename().rfind('.'));
- return VersionSpec(strip_leading_string(e.basename().substr(0, p), stringify(n.package) + "-"));
- }
- else
- return VersionSpec(strip_leading_string(strip_trailing_string(e.basename(), ".ebuild"), stringify(n.package) + "-"));
+ std::string::size_type p(e.basename().rfind('.'));
+ if (std::string::npos == p)
+ throw InternalError(PALUDIS_HERE, "got npos");
+ return VersionSpec(strip_leading_string(e.basename().substr(0, p), stringify(n.package) + "-"));
}
bool
@@ -838,7 +879,7 @@ EbuildEntries::pretend(const tr1::shared_ptr<const ERepositoryID> & id,
(k::environment(), _imp->params.environment)
(k::package_id(), id)
(k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
- (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::ebuild_file(), id->fs_location_key()->value())
(k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
(k::eclassdirs(), _imp->params.eclassdirs)
(k::exlibsdirs(), exlibsdirs)
@@ -866,22 +907,33 @@ EbuildEntries::pretend(const tr1::shared_ptr<const ERepositoryID> & id,
}
std::string
-EbuildEntries::get_package_file_manifest_key(const FSEntry & f, const QualifiedPackageName & q) const
+EbuildEntries::get_package_file_manifest_key(const FSEntry & e, const QualifiedPackageName & q) const
{
- if (! is_package_file(q, f))
+ if (! is_package_file(q, e))
return "";
- if (is_file_with_prefix_extension(f, stringify(q.package) + "-", ".ebuild", IsFileWithOptions()))
+
+ std::string::size_type p(e.basename().rfind('.'));
+ if (std::string::npos == p)
return "EBUILD";
- else
- return "EXHERES";
+
+ std::string suffix(e.basename().substr(p + 1));
+ return Suffixes::get_instance()->manifest_key(suffix);
}
std::string
EbuildEntries::binary_ebuild_name(const QualifiedPackageName & q, const VersionSpec & v, const std::string & e) const
{
- if (_imp->e_repository->layout()->eapi_ebuild_suffix())
- return stringify(q.package) + "-" + stringify(v) + "." + e;
- else
- return stringify(q.package) + "-" + stringify(v) + ".ebuild";
+ return stringify(q.package) + "-" + stringify(v) + "." + e;
+}
+
+std::string
+EbuildEntries::_guess_eapi(const QualifiedPackageName &, const FSEntry & e) const
+{
+ std::string::size_type p(e.basename().rfind('.'));
+ if (std::string::npos == p)
+ return "";
+
+ std::string suffix(e.basename().substr(p + 1));
+ return Suffixes::get_instance()->guess_eapi(suffix);
}
diff --git a/paludis/repositories/e/ebuild_entries.hh b/paludis/repositories/e/ebuild_entries.hh
index 34f56db..db36fd7 100644
--- a/paludis/repositories/e/ebuild_entries.hh
+++ b/paludis/repositories/e/ebuild_entries.hh
@@ -46,6 +46,9 @@ namespace paludis
public ERepositoryEntries,
private PrivateImplementationPattern<EbuildEntries>
{
+ private:
+ std::string _guess_eapi(const QualifiedPackageName &, const FSEntry &) const;
+
public:
/**
* Create an EbuildEntries instance.
@@ -72,8 +75,7 @@ namespace paludis
virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &, const std::string &) const
+ virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::string get_environment_variable(const tr1::shared_ptr<const ERepositoryID> &, const std::string & var,
diff --git a/paludis/repositories/e/ebuild_entries_suffixes.conf b/paludis/repositories/e/ebuild_entries_suffixes.conf
new file mode 100644
index 0000000..dde3804
--- /dev/null
+++ b/paludis/repositories/e/ebuild_entries_suffixes.conf
@@ -0,0 +1,11 @@
+suffix_ebuild_known = yes
+guess_eapi_ebuild =
+manifest_key_ebuild = EBUILD
+
+suffix_exheres-0_known = yes
+guess_eapi_exheres-0 = exheres-0
+manifest_key_exheres-0 = EXHERES
+
+suffix_kdebuild-1_known = yes
+guess_eapi_kdebuild-1 = kdebuild-1
+manifest_key_kdebuild-1 = EBUILD
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 546ba0a..51d8e4c 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -202,7 +202,7 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
try
{
- tr1::shared_ptr<const PackageID> id(_imp->entries->make_id(n, _imp->entries->extract_package_file_version(n, *e), *e, ""));
+ tr1::shared_ptr<const PackageID> id(_imp->entries->make_id(n, *e));
if (indirect_iterator(v->end()) != std::find_if(indirect_iterator(v->begin()), indirect_iterator(v->end()),
tr1::bind(std::equal_to<VersionSpec>(), id->version(), tr1::bind(tr1::mem_fn(&PackageID::version), _1))))
Log::get_instance()->message(ll_warning, lc_context, "Ignoring entry '" + stringify(*e)
@@ -421,30 +421,6 @@ ExheresLayout::use_desc_dirs() const
return _imp->use_desc_dirs;
}
-bool
-ExheresLayout::eapi_ebuild_suffix() const
-{
- return true;
-}
-
-FSEntry
-ExheresLayout::package_file(const PackageID & id) const
-{
- for (DirIterator d(package_directory(id.name())), d_end ; d != d_end ; ++d)
- {
- std::string::size_type p(d->basename().rfind('.'));
- if (std::string::npos == p)
- continue;
-
- std::string prefix(stringify(id.name().package) + "-" + stringify(id.version()));
- if (0 == d->basename().compare(0, p, prefix))
- if (_imp->entries->is_package_file(id.name(), *d))
- return *d;
- }
-
- throw NoSuchPackageError(stringify(id));
-}
-
FSEntry
ExheresLayout::profiles_base_dir() const
{
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index 0fad604..6f91c25 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -88,9 +88,6 @@ namespace paludis
virtual FSEntry category_directory(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_file(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
const std::string & eapi) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -110,9 +107,6 @@ namespace paludis
virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool eapi_ebuild_suffix() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual FSEntry profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index 83d7827..1f1d957 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -108,9 +108,6 @@ namespace paludis
virtual FSEntry category_directory(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry package_file(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
const std::string & eapi) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
@@ -130,9 +127,6 @@ namespace paludis
virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual bool eapi_ebuild_suffix() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
virtual FSEntry profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
diff --git a/paludis/repositories/e/qa/Makefile.am b/paludis/repositories/e/qa/Makefile.am
index 1f2a05e..5244d89 100644
--- a/paludis/repositories/e/qa/Makefile.am
+++ b/paludis/repositories/e/qa/Makefile.am
@@ -122,7 +122,7 @@ dist_check_SCRIPTS = \
endif
-EXTRA_DIST = test_extras.cc $(check_SCRIPTS)
+EXTRA_DIST = $(check_SCRIPTS)
BUILT_SOURCES =
TESTS_ENVIRONMENT = env \
@@ -132,6 +132,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_QA_DATA_DIR="$(top_srcdir)/paludis/repositories/e/qa/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
@@ -163,7 +164,6 @@ check_PROGRAMS = $(TESTS)
spec_keys_TEST_SOURCES = spec_keys_TEST.cc
spec_keys_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -175,7 +175,6 @@ spec_keys_TEST_LDADD = \
stray_files_TEST_SOURCES = stray_files_TEST.cc
stray_files_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -187,7 +186,6 @@ stray_files_TEST_LDADD = \
extractors_TEST_SOURCES = extractors_TEST.cc
extractors_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -199,7 +197,6 @@ extractors_TEST_LDADD = \
homepage_key_TEST_SOURCES = homepage_key_TEST.cc
homepage_key_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -211,7 +208,6 @@ homepage_key_TEST_LDADD = \
visibility_TEST_SOURCES = visibility_TEST.cc
visibility_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -223,7 +219,6 @@ visibility_TEST_LDADD = \
default_functions_TEST_SOURCES = default_functions_TEST.cc
default_functions_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -235,7 +230,6 @@ default_functions_TEST_LDADD = \
kv_variables_TEST_SOURCES = kv_variables_TEST.cc
kv_variables_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -247,7 +241,6 @@ kv_variables_TEST_LDADD = \
misc_files_TEST_SOURCES = misc_files_TEST.cc
misc_files_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -259,7 +252,6 @@ misc_files_TEST_LDADD = \
manifest_TEST_SOURCES = manifest_TEST.cc
manifest_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -271,7 +263,6 @@ manifest_TEST_LDADD = \
subshell_die_TEST_SOURCES = subshell_die_TEST.cc
subshell_die_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -283,7 +274,6 @@ subshell_die_TEST_LDADD = \
function_keyword_TEST_SOURCES = function_keyword_TEST.cc
function_keyword_TEST_LDADD = \
libpaludiserepositoryqa.la \
- test_extras.o \
$(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index 70b2967..60a8f4b 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -350,14 +350,14 @@ QAController::_check_id(const tr1::shared_ptr<const PackageID> & i)
QAChecks::get_instance()->package_id_checks_group()->end(),
tr1::bind(std::equal_to<bool>(), false,
tr1::bind<bool>(tr1::mem_fn(&PackageIDCheckFunction::operator() ),
- _1, _imp->repo->layout()->package_file(*i), tr1::ref(_imp->reporter),
+ _1, i->fs_location_key()->value(), tr1::ref(_imp->reporter),
_imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i))));
std::ifstream f(stringify(i->fs_location_key()->value()).c_str());
std::string content((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
if (! f)
_imp->reporter.message(
- QAMessage(_imp->repo->layout()->package_file(*i), qaml_severe, "check_id",
+ QAMessage(i->fs_location_key()->value(), qaml_severe, "check_id",
"Couldn't get file contents for ID '" + stringify(*i) + ")")
.with_associated_id(i)
.with_associated_key(i, i->fs_location_key()));
@@ -367,14 +367,14 @@ QAController::_check_id(const tr1::shared_ptr<const PackageID> & i)
QAChecks::get_instance()->package_id_file_contents_checks_group()->end(),
tr1::bind(std::equal_to<bool>(), false,
tr1::bind<bool>(tr1::mem_fn(&PackageIDFileContentsCheckFunction::operator() ),
- _1, _imp->repo->layout()->package_file(*i), tr1::ref(_imp->reporter),
+ _1, i->fs_location_key()->value(), tr1::ref(_imp->reporter),
_imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i), content)));
}
}
catch (const Exception & e)
{
_imp->reporter.message(
- QAMessage(_imp->repo->layout()->package_file(*i), qaml_severe, "check_id",
+ QAMessage(i->fs_location_key()->value(), qaml_severe, "check_id",
"Caught exception '" + e.message() + "' (" + e.what() + ")")
.with_associated_id(i));
}
diff --git a/paludis/repositories/e/qa/test_extras.cc b/paludis/repositories/e/qa/test_extras.cc
deleted file mode 100644
index 08da203..0000000
--- a/paludis/repositories/e/qa/test_extras.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 Ciaran McCreesh
- *
- * 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
- */
-
-#include <paludis/repositories/e/e_repository.hh>
-
-void work_around_annoying_linker_bug(const paludis::ERepository & repo)
-{
- bool PALUDIS_ATTRIBUTE((unused)) b(repo.layout()->eapi_ebuild_suffix());
-}
-
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 3585923..8ab6a46 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -220,7 +220,7 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
try
{
- tr1::shared_ptr<const PackageID> id(_imp->entries->make_id(n, _imp->entries->extract_package_file_version(n, *e), *e, ""));
+ tr1::shared_ptr<const PackageID> id(_imp->entries->make_id(n, *e));
if (indirect_iterator(v->end()) != std::find_if(indirect_iterator(v->begin()), indirect_iterator(v->end()),
tr1::bind(std::equal_to<VersionSpec>(), id->version(), tr1::bind(tr1::mem_fn(&PackageID::version), _1))))
Log::get_instance()->message(ll_warning, lc_context, "Ignoring entry '" + stringify(*e)
@@ -438,30 +438,6 @@ TraditionalLayout::use_desc_dirs() const
return _imp->use_desc_dirs;
}
-bool
-TraditionalLayout::eapi_ebuild_suffix() const
-{
- return false;
-}
-
-FSEntry
-TraditionalLayout::package_file(const PackageID & id) const
-{
- for (DirIterator d(package_directory(id.name()), DirIteratorOptions() + dio_inode_sort), d_end ; d != d_end ; ++d)
- {
- std::string::size_type p(d->basename().rfind('.'));
- if (std::string::npos == p)
- continue;
-
- std::string prefix(stringify(id.name().package) + "-" + stringify(id.version()));
- if (0 == d->basename().compare(0, p, prefix))
- if (_imp->entries->is_package_file(id.name(), *d))
- return *d;
- }
-
- throw NoSuchPackageError(stringify(id));
-}
-
FSEntry
TraditionalLayout::profiles_base_dir() const
{
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index 41060a6..6233afb 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -89,9 +89,6 @@ namespace paludis
virtual FSEntry category_directory(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_file(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
const std::string & eapi) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -111,9 +108,6 @@ namespace paludis
virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool eapi_ebuild_suffix() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual FSEntry profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index bb2a4c0..95c172e 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -393,7 +393,8 @@ namespace test_cases
id->perform_action(uninstall_action);
}
}
- } test_phases_eapi_0("0"), test_phases_eapi_1("1"), test_phases_eapi_exheres_0("exheres-0");
+ } test_phases_eapi_0("0"), test_phases_eapi_1("1"), test_phases_eapi_exheres_0("exheres-0"),
+ test_phases_eapi_kdebuild_1("kdebuild-1");
struct VarsTest : TestCase
{
@@ -507,6 +508,7 @@ namespace test_cases
id->perform_action(uninstall_action);
}
}
- } test_vdb_vars_eapi_0("0"), test_vdb_vars_eapi_1("1"), test_vdb_vars_eapi_exheres_0("exheres-0");
+ } test_vdb_vars_eapi_0("0"), test_vdb_vars_eapi_1("1"), test_vdb_vars_eapi_exheres_0("exheres-0"),
+ test_vdb_vars_eapi_kdebuild_1("kdebuild-1");
}
diff --git a/paludis/repositories/e/vdb_repository_TEST_setup.sh b/paludis/repositories/e/vdb_repository_TEST_setup.sh
index 17d99d5..943573b 100755
--- a/paludis/repositories/e/vdb_repository_TEST_setup.sh
+++ b/paludis/repositories/e/vdb_repository_TEST_setup.sh
@@ -82,7 +82,7 @@ echo "cat/pkg1 build: cat/pkg2 build,run: cat/pkg3 suggested: cat/pkg4 post: cat
mkdir -p repo3
-mkdir -p srcrepo/{profiles/profile,cat/{target,vars}{,-exheres},eclass}
+mkdir -p srcrepo/{profiles/profile,cat/{target,vars}{,-exheres,-kdebuild},eclass}
cat <<END > srcrepo/profiles/profile/make.defaults
ARCH=test
USERLAND="GNU"
@@ -163,6 +163,30 @@ pkg_config() {
}
END
+cat <<'END' > srcrepo/cat/target-kdebuild/target-kdebuild-1.ebuild
+EAPI="exheres-0"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS=""
+LICENSE="GPL-2"
+PLATFORMS="test"
+DEPENDENCIES=""
+
+src_install() {
+ echo MONKEY > ${D}/monkey
+}
+
+pkg_info() {
+ echo "This is pkg_info"
+}
+
+pkg_config() {
+ echo "This is pkg_config"
+}
+END
+
cat <<'END' > srcrepo/cat/vars/vars-0.ebuild
EAPI="0"
DESCRIPTION="The Description"
@@ -289,3 +313,45 @@ pkg_config() {
}
END
+cat <<'END' > srcrepo/cat/vars-kdebuild/vars-kdebuild-1.ebuild
+EAPI="exheres-0"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS=""
+LICENSE="GPL-2"
+PLATFORMS="test"
+DEPENDENCIES="foo/bar"
+
+pkg_setup() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+src_compile() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_preinst() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_prerm() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_info() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_config() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+END
+
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index 42d8f36..dde7df4 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -24,14 +24,22 @@
#include <paludis/package_id.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
+#include <paludis/dep_label.hh>
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/join.hh>
#include <set>
+#include <list>
using namespace paludis;
+typedef std::list<tr1::shared_ptr<ActiveDependencyLabels> > LabelsStack;
+
namespace paludis
{
template <>
@@ -42,27 +50,31 @@ namespace paludis
const Environment * const environment;
const tr1::shared_ptr<const PackageID> id;
bool dependency_tags;
+ const bool only_if_suggested_label;
tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > conditions;
std::set<SetName> recursing_sets;
+ LabelsStack labels;
Implementation(DepList * const d, tr1::shared_ptr<const DestinationsSet> dd,
- const Environment * const e, const tr1::shared_ptr<const PackageID> & p, bool t) :
+ const Environment * const e, const tr1::shared_ptr<const PackageID> & p, bool t, bool l) :
dep_list(d),
destinations(dd),
environment(e),
id(p),
dependency_tags(t),
+ only_if_suggested_label(l),
conditions(tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> >(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec))))
{
+ labels.push_front(make_shared_ptr(new ActiveDependencyLabels(*make_shared_ptr(new DependencyLabelSequence))));
}
};
}
ShowSuggestVisitor::ShowSuggestVisitor(DepList * const d, tr1::shared_ptr<const DestinationsSet> dd,
- const Environment * const e, const tr1::shared_ptr<const PackageID> & p, bool t) :
- PrivateImplementationPattern<ShowSuggestVisitor>(new Implementation<ShowSuggestVisitor>(d, dd, e, p, t))
+ const Environment * const e, const tr1::shared_ptr<const PackageID> & p, bool t, bool l) :
+ PrivateImplementationPattern<ShowSuggestVisitor>(new Implementation<ShowSuggestVisitor>(d, dd, e, p, t, l))
{
}
@@ -80,7 +92,12 @@ ShowSuggestVisitor::visit_sequence(const ConditionalDepSpec & a,
ConditionTracker(_imp->conditions).add_condition(a) : _imp->conditions);
if (a.condition_met())
+ {
+ _imp->labels.push_front(make_shared_ptr(new ActiveDependencyLabels(**_imp->labels.begin())));
+ RunOnDestruction restore_labels(tr1::bind(tr1::mem_fn(&LabelsStack::pop_front), &_imp->labels));
+
std::for_each(cur, end, accept_visitor(*this));
+ }
}
void
@@ -92,6 +109,20 @@ ShowSuggestVisitor::visit_sequence(const AnyDepSpec & a,
&_imp->conditions, _imp->dependency_tags ?
ConditionTracker(_imp->conditions).add_condition(a) : _imp->conditions);
+ _imp->labels.push_front(make_shared_ptr(new ActiveDependencyLabels(**_imp->labels.begin())));
+ RunOnDestruction restore_labels(tr1::bind(tr1::mem_fn(&LabelsStack::pop_front), &_imp->labels));
+
+ std::for_each(cur, end, accept_visitor(*this));
+}
+
+void
+ShowSuggestVisitor::visit_sequence(const AllDepSpec &,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+{
+ _imp->labels.push_front(make_shared_ptr(new ActiveDependencyLabels(**_imp->labels.begin())));
+ RunOnDestruction restore_labels(tr1::bind(tr1::mem_fn(&LabelsStack::pop_front), &_imp->labels));
+
std::for_each(cur, end, accept_visitor(*this));
}
@@ -100,15 +131,70 @@ ShowSuggestVisitor::visit_leaf(const BlockDepSpec &)
{
}
+namespace
+{
+ struct SuggestActiveVisitor :
+ ConstVisitor<DependencySuggestLabelVisitorTypes>
+ {
+ bool result;
+
+ SuggestActiveVisitor() :
+ result(false)
+ {
+ }
+
+ void visit(const DependencyRecommendedLabel &)
+ {
+ }
+
+ void visit(const DependencySuggestedLabel &)
+ {
+ result = true;
+ }
+
+ void visit(const DependencyRequiredLabel &)
+ {
+ }
+ };
+}
+
void
ShowSuggestVisitor::visit_leaf(const PackageDepSpec & a)
{
Context context("When adding suggested dep '" + stringify(a) + "':");
+ if (_imp->only_if_suggested_label)
+ {
+ SuggestActiveVisitor v;
+ for (DependencySuggestLabelSequence::ConstIterator
+ i((*_imp->labels.begin())->suggest_labels()->begin()),
+ i_end((*_imp->labels.begin())->suggest_labels()->end()) ;
+ i != i_end ; ++i)
+ (*i)->accept(v);
+
+ if (! v.result)
+ {
+ Log::get_instance()->message(ll_debug, lc_context) << "Skipping dep '"
+ << a << "' because no suggested label is active";
+ return;
+ }
+ }
+
Save<tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > > save_c(
&_imp->conditions, _imp->dependency_tags ?
ConditionTracker(_imp->conditions).add_condition(a) : _imp->conditions);
+ tr1::shared_ptr<const PackageIDSequence> installed_matches(_imp->environment->package_database()->query(
+ query::SupportsAction<InstalledAction>() &
+ query::Matches(a), qo_order_by_version));
+ if (! installed_matches->empty())
+ {
+ Log::get_instance()->message(ll_debug, lc_context) << "Suggestion '" << a << "' already matched by installed packages '"
+ << join(indirect_iterator(installed_matches->begin()), indirect_iterator(installed_matches->end()), ", ")
+ << "', not suggesting it";
+ return;
+ }
+
tr1::shared_ptr<const PackageIDSequence> matches(_imp->environment->package_database()->query(
query::SupportsAction<InstallAction>() &
query::Matches(a), qo_order_by_version));
@@ -132,9 +218,9 @@ ShowSuggestVisitor::visit_leaf(const PackageDepSpec & a)
}
void
-ShowSuggestVisitor::visit_leaf(const DependencyLabelsDepSpec &)
+ShowSuggestVisitor::visit_leaf(const DependencyLabelsDepSpec & spec)
{
- // XXX implement
+ _imp->labels.begin()->reset(new ActiveDependencyLabels(**_imp->labels.begin(), spec));
}
void
diff --git a/paludis/show_suggest_visitor.hh b/paludis/show_suggest_visitor.hh
index 3d9ab10..299f664 100644
--- a/paludis/show_suggest_visitor.hh
+++ b/paludis/show_suggest_visitor.hh
@@ -44,8 +44,6 @@ namespace paludis
*/
class ShowSuggestVisitor :
public ConstVisitor<DependencySpecTree>,
- public ConstVisitor<DependencySpecTree>::VisitConstSequence<ShowSuggestVisitor, AnyDepSpec>,
- public ConstVisitor<DependencySpecTree>::VisitConstSequence<ShowSuggestVisitor, AllDepSpec>,
private PrivateImplementationPattern<ShowSuggestVisitor>
{
public:
@@ -53,7 +51,7 @@ namespace paludis
///\{
ShowSuggestVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsSet> ddd,
- const Environment * const, const tr1::shared_ptr<const PackageID> &, bool);
+ const Environment * const, const tr1::shared_ptr<const PackageID> &, bool, bool);
~ShowSuggestVisitor();
///\}
@@ -77,7 +75,9 @@ namespace paludis
DependencySpecTree::ConstSequenceIterator,
DependencySpecTree::ConstSequenceIterator);
- using ConstVisitor<DependencySpecTree>::VisitConstSequence<ShowSuggestVisitor, AllDepSpec>::visit_sequence;
+ void visit_sequence(const AllDepSpec &,
+ DependencySpecTree::ConstSequenceIterator,
+ DependencySpecTree::ConstSequenceIterator);
///\}
};
diff --git a/paludis/util/echo_functions.bash.in b/paludis/util/echo_functions.bash.in
index 9af0cf0..e6f1417 100644
--- a/paludis/util/echo_functions.bash.in
+++ b/paludis/util/echo_functions.bash.in
@@ -29,6 +29,7 @@ COLOUR_YELLOW=$'\e[33;01m'
COLOUR_RED=$'\e[31;01m'
COLOUR_BLUE=$'\e[34;01m'
COLOUR_PINK=$'\e[35;01m'
+COLOUR_CYAN=$'\e[36;01m'
if [[ ${PALUDIS_COLOURS} == pink ]]; then
COLOUR_GOOD=${COLOUR_PINK}
diff --git a/paludis/util/keys.hh b/paludis/util/keys.hh
index 29125e4..5dd1041 100644
--- a/paludis/util/keys.hh
+++ b/paludis/util/keys.hh
@@ -152,6 +152,7 @@ namespace paludis
typedef kc::Key<123> env_distdir;
typedef kc::Key<124> description_use;
typedef kc::Key<125> debug_dir;
+ typedef kc::Key<126> use_ebuild_file;
}
}
diff --git a/python/Makefile.am b/python/Makefile.am
index 61129bf..61ca0eb 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -106,6 +106,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_QA_DATA_DIR="$(top_srcdir)/paludis/repositories/e/qa/" \
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 3c5f55f..3b89f35 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -88,6 +88,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_QA_DATA_DIR="$(top_srcdir)/paludis/repositories/e/qa/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
diff --git a/src/clients/adjutrix/Makefile.am b/src/clients/adjutrix/Makefile.am
index d91b814..c4643a5 100644
--- a/src/clients/adjutrix/Makefile.am
+++ b/src/clients/adjutrix/Makefile.am
@@ -61,6 +61,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index a503f63..a29a1da 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -61,6 +61,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EXTRA_EBUILD_MODULES_DIRS="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
+ PALUDIS_SUFFIXES_FILE="$(top_srcdir)/paludis/repositories/e/ebuild_entries_suffixes.conf" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_DISTRIBUTION="gentoo" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \