aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/dep_spec.cc23
-rw-r--r--python/dep_spec.hh6
-rwxr-xr-xpython/dep_spec_TEST.py2
3 files changed, 17 insertions, 14 deletions
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 7d0146822..0d568a4de 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -438,17 +438,17 @@ PythonSimpleURIDepSpec::PythonSimpleURIDepSpec(const SimpleURIDepSpec & d) :
{
}
-PythonBlockDepSpec::PythonBlockDepSpec(const std::string & t, const std::shared_ptr<const PythonPackageDepSpec> & a, const bool s) :
+PythonBlockDepSpec::PythonBlockDepSpec(const std::string & t, const std::shared_ptr<const PythonPackageDepSpec> & a, const BlockKind s) :
PythonStringDepSpec(t),
_spec(a),
- _strong(s)
+ _kind(s)
{
}
PythonBlockDepSpec::PythonBlockDepSpec(const BlockDepSpec & d) :
PythonStringDepSpec(d.text()),
_spec(std::make_shared<PythonPackageDepSpec>(d.blocking())),
- _strong(d.strong())
+ _kind(d.block_kind())
{
}
@@ -458,10 +458,10 @@ PythonBlockDepSpec::blocking() const
return _spec;
}
-bool
-PythonBlockDepSpec::strong() const
+BlockKind
+PythonBlockDepSpec::block_kind() const
{
- return _strong;
+ return _kind;
}
PythonFetchableURIDepSpec::PythonFetchableURIDepSpec(const std::string & s) :
@@ -924,7 +924,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonBlockDepSpec & d)
{
- _add_to->append(std::make_shared<BlockDepSpec>(d.text(), *d.blocking(), d.strong()));
+ _add_to->append(std::make_shared<BlockDepSpec>(d.text(), *d.blocking(), d.block_kind()));
}
template <typename H_>
@@ -1045,6 +1045,9 @@ void expose_dep_spec()
enum_auto("UserPackageDepSpecOption", last_updso,
"Options for parse_user_package_dep_spec.");
+ enum_auto("BlockKind", last_bk,
+ "Options for BlockDepSpec.");
+
/**
* Options
*/
@@ -1332,15 +1335,15 @@ void expose_dep_spec()
"BlockDepSpec",
"A BlockDepSpec represents a block on a package name (for example, 'app-editors/vim'), \n"
"possibly with associated version and SLOT restrictions.",
- bp::init<std::string, std::shared_ptr<const PythonPackageDepSpec>, bool>("__init__(string, PackageDepSpec, bool)")
+ bp::init<std::string, std::shared_ptr<const PythonPackageDepSpec>, BlockKind>("__init__(string, PackageDepSpec, BlockKind)")
)
.add_property("blocking", &PythonBlockDepSpec::blocking,
"[ro] PackageDepSpec\n"
"The spec we're blocking."
)
- .add_property("strong", &PythonBlockDepSpec::strong,
- "[ro] bool\n"
+ .add_property("block_kind", &PythonBlockDepSpec::block_kind,
+ "[ro] BlockKind\n"
"Are we a strong block?"
)
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index e51af9a82..466a5eaf5 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -233,14 +233,14 @@ namespace paludis
{
private:
std::shared_ptr<const PythonPackageDepSpec> _spec;
- bool _strong;
+ BlockKind _kind;
public:
- PythonBlockDepSpec(const std::string &, const std::shared_ptr<const PythonPackageDepSpec> &, const bool);
+ PythonBlockDepSpec(const std::string &, const std::shared_ptr<const PythonPackageDepSpec> &, const BlockKind);
PythonBlockDepSpec(const BlockDepSpec &);
std::shared_ptr<const PythonPackageDepSpec> blocking() const;
- bool strong() const;
+ BlockKind block_kind() const;
};
class PALUDIS_VISIBLE PythonURILabelsDepSpec :
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index 556f24b28..375e7ee01 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -31,7 +31,7 @@ class TestCase_1_DepSpecs(unittest.TestCase):
self.pds3 = parse_user_package_dep_spec("*/*::testrepo", self.env,
[UserPackageDepSpecOption.ALLOW_WILDCARDS])
self.pds4 = parse_user_package_dep_spec("cat/pkg::testrepo", self.env, [])
- self.bds = BlockDepSpec("!>=foo/bar-1:100::testrepo", self.pds, False)
+ self.bds = BlockDepSpec("!>=foo/bar-1:100::testrepo", self.pds, BlockKind.WEAK)
self.nds = NamedSetDepSpec("system")
def test_01_init(self):