aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-27 00:53:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-27 00:53:13 +0000
commitafbba3f9f61c274306916368e4f22d1a63060448 (patch)
tree0898a5326ddadf42ebb1fd5cbaa469baadecda09
parentc2513f966b4d92347f1047dadefaf13497a3e866 (diff)
downloadpaludis-afbba3f9f61c274306916368e4f22d1a63060448.tar.gz
paludis-afbba3f9f61c274306916368e4f22d1a63060448.tar.xz
We can sometimes skip src_ phases too
-rw-r--r--paludis/repositories/e/can_skip_phase.cc61
-rw-r--r--paludis/repositories/e/eapis/0.conf6
-rw-r--r--paludis/repositories/e/eapis/2.conf10
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf12
-rw-r--r--paludis/repositories/e/eapis/kdebuild-1.conf6
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf6
6 files changed, 77 insertions, 24 deletions
diff --git a/paludis/repositories/e/can_skip_phase.cc b/paludis/repositories/e/can_skip_phase.cc
index 0309d56..50cd759 100644
--- a/paludis/repositories/e/can_skip_phase.cc
+++ b/paludis/repositories/e/can_skip_phase.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 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
@@ -21,12 +21,49 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/spec_tree.hh>
#include <set>
+#include <algorithm>
using namespace paludis;
using namespace paludis::erepository;
+namespace
+{
+ struct FindAnyFetchesFinder
+ {
+ bool result;
+
+ FindAnyFetchesFinder() :
+ result(true)
+ {
+ }
+
+ void visit(const FetchableURISpecTree::NodeType<AllDepSpec>::Type & node)
+ {
+ std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
+ }
+
+ void visit(const FetchableURISpecTree::NodeType<ConditionalDepSpec>::Type & node)
+ {
+ if (node.spec()->condition_met())
+ std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
+ }
+
+ void visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::Type &)
+ {
+ result = false;
+ }
+
+ void visit(const FetchableURISpecTree::NodeType<URILabelsDepSpec>::Type &)
+ {
+ }
+ };
+}
+
bool
paludis::erepository::can_skip_phase(const std::tr1::shared_ptr<const ERepositoryID> & id,
const EAPIPhase & phase)
@@ -39,12 +76,28 @@ paludis::erepository::can_skip_phase(const std::tr1::shared_ptr<const ERepositor
return false;
std::set<std::string> skip_if_no_values;
- tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(skipifno, ",", "", inserter(skip_if_no_values, skip_if_no_values.begin()));
+ tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(skipifno, ",", "",
+ inserter(skip_if_no_values, skip_if_no_values.begin()));
for (std::set<std::string>::const_iterator i(skip_if_no_values.begin()), i_end(skip_if_no_values.end()) ;
i != i_end ; ++i)
- if (id->defined_phases_key()->value()->end() != id->defined_phases_key()->value()->find(*i))
- return false;
+ {
+ if (*i == "*sources")
+ {
+ if (id->fetches_key())
+ {
+ FindAnyFetchesFinder f;
+ id->fetches_key()->value()->root()->accept(f);
+ if (! f.result)
+ return false;
+ }
+ }
+ else
+ {
+ if (id->defined_phases_key()->value()->end() != id->defined_phases_key()->value()->find(*i))
+ return false;
+ }
+ }
return true;
}
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 9a85763..6ee7489 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -104,9 +104,9 @@ ebuild_install = \
skipname=killold : killold ; \
skipname=init userpriv sandbox : init saveenv ; \
skipname=setup skipifno=setup : loadenv setup saveenv ; \
- skipname=unpack sandbox userpriv : loadenv unpack saveenv ; \
- skipname=compile sandbox userpriv : loadenv compile saveenv ; \
- skipname=test sandbox userpriv optional_tests : loadenv test saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv : loadenv unpack saveenv ; \
+ skipname=compile skipifno=*sources,unpack,compile sandbox userpriv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,compile,test sandbox userpriv optional_tests : loadenv test saveenv ; \
skipname=install skipifno=install sandbox : loadenv install saveenv ; \
skipname=strip strip : ; \
skipname=preinst skipifno=preinst prepost : loadenv preinst saveenv ; \
diff --git a/paludis/repositories/e/eapis/2.conf b/paludis/repositories/e/eapis/2.conf
index 8512cdd..6abd0f4 100644
--- a/paludis/repositories/e/eapis/2.conf
+++ b/paludis/repositories/e/eapis/2.conf
@@ -15,11 +15,11 @@ ebuild_install = \
skipname=killold : killold ; \
skipname=init userpriv sandbox : init saveenv ; \
skipname=setup skipifno=setup : loadenv setup saveenv ; \
- skipname=unpack sandbox userpriv : loadenv unpack saveenv ; \
- skipname=prepare sandbox userpriv : loadenv prepare saveenv ; \
- skipname=configure sandbox userpriv : loadenv configure saveenv ; \
- skipname=compile sandbox userpriv : loadenv compile saveenv ; \
- skipname=test sandbox userpriv optional_tests : loadenv test saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv : loadenv unpack saveenv ; \
+ skipname=prepare skipifno=*sources,unpack,prepare sandbox userpriv : loadenv prepare saveenv ; \
+ skipname=configure skipifno=*sources,unpack,prepare,configure sandbox userpriv : loadenv configure saveenv ; \
+ skipname=compile skipifno=*sources,unpack,prepare,configure,compile sandbox userpriv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,prepare,configure,compile,test sandbox userpriv optional_tests : loadenv test saveenv ; \
skipname=install skipifno=install sandbox : loadenv install saveenv ; \
skipname=strip strip : ; \
skipname=preinst skipifno=preinst prepost : loadenv preinst saveenv ; \
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index dcca5bb..e079ebf 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -108,12 +108,12 @@ ebuild_install = \
skipname=killold : killold ; \
skipname=init userpriv sandbox : init saveenv ; \
skipname=setup skipifno=setup sandbox : loadenv setup saveenv ; \
- skipname=unpack sandbox userpriv : loadenv unpack saveenv ; \
- skipname=prepare sandbox userpriv : loadenv prepare saveenv ; \
- skipname=configure sandbox userpriv : loadenv configure saveenv ; \
- skipname=compile sandbox userpriv : loadenv compile saveenv ; \
- skipname=test sandbox userpriv recommended_tests : loadenv test saveenv ; \
- skipname=install sandbox : loadenv install saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv : loadenv unpack saveenv ; \
+ skipname=prepare skipifno=*sources,unpack,prepare sandbox userpriv : loadenv prepare saveenv ; \
+ skipname=configure skipifno=*sources,unpack,prepare,configure sandbox userpriv : loadenv configure saveenv ; \
+ skipname=compile skipifno=*sources,unpack,prepare,configure,compile sandbox userpriv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,prepare,configure,compile,test sandbox userpriv recommended_tests : loadenv test saveenv ; \
+ skipname=install skipifno=*sources,unpack,prepare,configure,compile,test,install sandbox : loadenv install saveenv ; \
skipname=strip strip : ; \
skipname=preinst skipifno=preinst sandbox : loadenv preinst saveenv ; \
skipname=merge merge : ; \
diff --git a/paludis/repositories/e/eapis/kdebuild-1.conf b/paludis/repositories/e/eapis/kdebuild-1.conf
index 54ac875..dc77f73 100644
--- a/paludis/repositories/e/eapis/kdebuild-1.conf
+++ b/paludis/repositories/e/eapis/kdebuild-1.conf
@@ -29,9 +29,9 @@ ebuild_install = \
skipname=killold : killold ; \
skipname=init userpriv sandbox : init saveenv ; \
skipname=setup skipifno=setup : loadenv setup saveenv ; \
- skipname=unpack sandbox userpriv : loadenv unpack saveenv ; \
- skipname=compile sandbox userpriv : loadenv compile saveenv ; \
- skipname=test sandbox userpriv recommended_tests : loadenv test saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv : loadenv unpack saveenv ; \
+ skipname=compile skipifno=*sources,unpack,compile sandbox userpriv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,compile,test sandbox userpriv recommended_tests : loadenv test saveenv ; \
skipname=install skipifno=install sandbox : loadenv install saveenv ; \
skipname=strip strip : ; \
skipname=preinst skipifno=preinst prepost : loadenv preinst saveenv ; \
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 081d58c..989c572 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -106,9 +106,9 @@ ebuild_install = \
skipname=killold : killold ; \
skipname=init userpriv sandbox : init saveenv ; \
skipname=setup skipifno=setup sandbox : loadenv setup saveenv ; \
- skipname=unpack sandbox userpriv : loadenv unpack saveenv ; \
- skipname=compile sandbox userpriv : loadenv compile saveenv ; \
- skipname=test sandbox userpriv recommended_tests : loadenv test saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv : loadenv unpack saveenv ; \
+ skipname=compile skipifno=*sources,unpack,compile sandbox userpriv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,compile,test sandbox userpriv recommended_tests : loadenv test saveenv ; \
skipname=install skipifno=install sandbox : loadenv install saveenv ; \
skipname=strip strip : ; \
skipname=preinst skipifno=preinst sandbox : loadenv preinst saveenv ; \