aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-05 17:29:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-05 17:29:26 +0000
commit1e93178594f3f67605ef6bd4f906b14057976432 (patch)
tree23a7b55c8c0b1fa54d80494bf68678617771a18c
parente43f9a6d5714d54973c292c14a0b1ca9dd054873 (diff)
downloadpaludis-1e93178594f3f67605ef6bd4f906b14057976432.tar.gz
paludis-1e93178594f3f67605ef6bd4f906b14057976432.tar.xz
Start tracking failure kinds
-rw-r--r--paludis/resolver/Makefile.am11
-rw-r--r--paludis/resolver/arrow.cc2
-rw-r--r--paludis/resolver/arrow.hh3
-rw-r--r--paludis/resolver/failure_kinds-fwd.hh39
-rw-r--r--paludis/resolver/failure_kinds.cc30
-rw-r--r--paludis/resolver/failure_kinds.hh33
-rw-r--r--paludis/resolver/failure_kinds.se14
-rw-r--r--paludis/resolver/orderer.cc15
8 files changed, 147 insertions, 0 deletions
diff --git a/paludis/resolver/Makefile.am b/paludis/resolver/Makefile.am
index c712da9..d7f31af 100644
--- a/paludis/resolver/Makefile.am
+++ b/paludis/resolver/Makefile.am
@@ -2,16 +2,19 @@ include $(top_srcdir)/misc/common-makefile.am
DISTCLEANFILES = \
destination_types-se.hh destination_types-se.cc \
+ failure_kinds-se.hh failure_kinds-se.cc \
sync_point-se.hh sync_point-se.cc \
use_existing-se.hh use_existing-se.cc
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
EXTRA_DIST = \
destination_types-se.hh destination_types-se.cc destination_types.se \
+ failure_kinds-se.hh failure_kinds-se.cc failure_kinds.se \
sync_point-se.hh sync_point-se.cc sync_point.se \
use_existing-se.hh use_existing-se.cc use_existing.se \
$(check_SCRIPTS)
BUILT_SOURCES = \
destination_types-se.hh destination_types-se.cc \
+ failure_kinds-se.hh failure_kinds-se.cc \
sync_point-se.hh sync_point-se.cc \
use_existing-se.hh use_existing-se.cc
@@ -25,6 +28,7 @@ noinst_HEADERS = \
decision.hh decision-fwd.hh \
destination.hh destination-fwd.hh \
destination_types.hh destination_types-fwd.hh destination_types-se.hh \
+ failure_kinds.hh failure_kinds-fwd.hh failure_kinds-se.hh \
orderer.hh orderer-fwd.hh \
reason.hh reason-fwd.hh \
resolution.hh resolution-fwd.hh \
@@ -47,6 +51,7 @@ libpaludisresolver_a_SOURCES = \
decision.cc \
destination.cc \
destination_types.cc \
+ failure_kinds.cc \
job.cc \
job_id.cc \
jobs.cc \
@@ -185,6 +190,12 @@ sync_point-se.hh : sync_point.se $(top_srcdir)/misc/make_se.bash
sync_point-se.cc : sync_point.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/sync_point.se > $@ ; then rm -f $@ ; exit 1 ; fi
+failure_kinds-se.hh : failure_kinds.se $(top_srcdir)/misc/make_se.bash
+ if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/failure_kinds.se > $@ ; then rm -f $@ ; exit 1 ; fi
+
+failure_kinds-se.cc : failure_kinds.se $(top_srcdir)/misc/make_se.bash
+ if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/failure_kinds.se > $@ ; then rm -f $@ ; exit 1 ; fi
+
destination_types-se.hh : destination_types.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/destination_types.se > $@ ; then rm -f $@ ; exit 1 ; fi
diff --git a/paludis/resolver/arrow.cc b/paludis/resolver/arrow.cc
index e945b26..2b726dc 100644
--- a/paludis/resolver/arrow.cc
+++ b/paludis/resolver/arrow.cc
@@ -32,6 +32,7 @@ Arrow::serialise(Serialiser & s) const
{
s.object("Arrow")
.member(SerialiserFlags<>(), "comes_after", comes_after())
+ .member(SerialiserFlags<>(), "failure_kinds", failure_kinds())
.member(SerialiserFlags<serialise::might_be_null>(), "maybe_reason", maybe_reason())
;
}
@@ -42,6 +43,7 @@ Arrow::deserialise(Deserialisation & d)
Deserialisator v(d, "Arrow");
return make_named_values<Arrow>(
value_for<n::comes_after>(v.member<JobID>("comes_after")),
+ value_for<n::failure_kinds>(v.member<FailureKinds>("failure_kinds")),
value_for<n::maybe_reason>(v.member<std::tr1::shared_ptr<const Reason> >("maybe_reason"))
);
}
diff --git a/paludis/resolver/arrow.hh b/paludis/resolver/arrow.hh
index deea7e8..99d8b70 100644
--- a/paludis/resolver/arrow.hh
+++ b/paludis/resolver/arrow.hh
@@ -24,6 +24,7 @@
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/reason-fwd.hh>
#include <paludis/resolver/job_id.hh>
+#include <paludis/resolver/failure_kinds-fwd.hh>
#include <paludis/serialise-fwd.hh>
#include <paludis/util/named_value.hh>
@@ -32,6 +33,7 @@ namespace paludis
namespace n
{
struct comes_after;
+ struct failure_kinds;
struct maybe_reason;
}
@@ -40,6 +42,7 @@ namespace paludis
struct Arrow
{
NamedValue<n::comes_after, JobID> comes_after;
+ NamedValue<n::failure_kinds, FailureKinds> failure_kinds;
NamedValue<n::maybe_reason, std::tr1::shared_ptr<const Reason> > maybe_reason;
void serialise(Serialiser &) const;
diff --git a/paludis/resolver/failure_kinds-fwd.hh b/paludis/resolver/failure_kinds-fwd.hh
new file mode 100644
index 0000000..86384a1
--- /dev/null
+++ b/paludis/resolver/failure_kinds-fwd.hh
@@ -0,0 +1,39 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_FWD_HH 1
+
+#include <paludis/util/attributes.hh>
+#include <paludis/util/options.hh>
+#include <iosfwd>
+
+namespace paludis
+{
+ namespace resolver
+ {
+
+#include <paludis/resolver/failure_kinds-se.hh>
+
+ typedef Options<FailureKind> FailureKinds;
+
+ }
+}
+
+#endif
diff --git a/paludis/resolver/failure_kinds.cc b/paludis/resolver/failure_kinds.cc
new file mode 100644
index 0000000..522960d
--- /dev/null
+++ b/paludis/resolver/failure_kinds.cc
@@ -0,0 +1,30 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 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
+ * 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/resolver/failure_kinds.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/exception.hh>
+#include <istream>
+#include <ostream>
+
+using namespace paludis;
+using namespace paludis::resolver;
+
+#include <paludis/resolver/failure_kinds-se.cc>
+
diff --git a/paludis/resolver/failure_kinds.hh b/paludis/resolver/failure_kinds.hh
new file mode 100644
index 0000000..76a93cd
--- /dev/null
+++ b/paludis/resolver/failure_kinds.hh
@@ -0,0 +1,33 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_HH 1
+
+#include <paludis/resolver/failure_kinds-fwd.hh>
+
+namespace paludis
+{
+ namespace resolver
+ {
+
+ }
+}
+
+#endif
diff --git a/paludis/resolver/failure_kinds.se b/paludis/resolver/failure_kinds.se
new file mode 100644
index 0000000..236812a
--- /dev/null
+++ b/paludis/resolver/failure_kinds.se
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_enum_FailureKind()
+{
+ prefix fk
+ namespace paludis::resolver
+
+ key fk_ignorable_always "We can always ignore this failure"
+ key fk_ignorable_if_satisfied "We can ignore this failure if we're if-satisfied"
+
+ want_destringify
+}
+
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 81c1040..792507b 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -143,6 +143,7 @@ namespace
* not at pretend time */
usable_job->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(common_jobs.done_pretends()->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
}
@@ -168,6 +169,7 @@ namespace
* not at pretend time */
usable_job->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(common_jobs.done_pretends()->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
}
@@ -207,17 +209,20 @@ namespace
/* we can't do any fetches or installs until all pretends have passed */
fetch_job->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(common_jobs.done_pretends()->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
install_job->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(common_jobs.done_pretends()->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
/* we haven't done all our pretends until we've done our pretend */
common_jobs.done_pretends()->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(pretend_job->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
@@ -226,18 +231,21 @@ namespace
* but the stronger requirement doesn't seem to hurt */
common_jobs.done_installs()->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(usable_job->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
/* we can't install until we've fetched */
install_job->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(fetch_job->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
/* we aren't usable until we've been installed */
usable_job->arrows()->push_back(make_named_values<Arrow>(
value_for<n::comes_after>(install_job->id()),
+ value_for<n::failure_kinds>(FailureKinds()),
value_for<n::maybe_reason>(make_null_shared_ptr())
));
}
@@ -391,6 +399,10 @@ namespace
+ "' with reason '" + stringify(r.sanitised_dependency().spec())
+ "' from '" + stringify(r.from_resolvent()) + "':");
+ FailureKinds failure_kinds;
+ if (r.already_met())
+ failure_kinds += fk_ignorable_if_satisfied;
+
if (r.sanitised_dependency().spec().if_block())
{
/* only strong blockers impose arrows. todo: maybe weak
@@ -413,6 +425,7 @@ namespace
jobs->fetch(jobs->find_id_for_installed(r.from_resolvent()))->arrows()->push_back(
make_named_values<Arrow>(
value_for<n::comes_after>(our_identifier),
+ value_for<n::failure_kinds>(failure_kinds),
value_for<n::maybe_reason>(reason)
));
}
@@ -444,6 +457,7 @@ namespace
jobs->fetch(jobs->find_id_for_installed(r.from_resolvent()))->arrows()->push_back(
make_named_values<Arrow>(
value_for<n::comes_after>(our_identifier),
+ value_for<n::failure_kinds>(failure_kinds),
value_for<n::maybe_reason>(reason)
));
}
@@ -455,6 +469,7 @@ namespace
jobs->fetch(jobs->find_id_for_usable(r.from_resolvent()))->arrows()->push_back(
make_named_values<Arrow>(
value_for<n::comes_after>(our_identifier),
+ value_for<n::failure_kinds>(failure_kinds),
value_for<n::maybe_reason>(reason)
));
}