feat: support multiarch system classifiers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@ -37,7 +37,7 @@ class Rule
|
||||
{
|
||||
protected:
|
||||
RuleAction m_result;
|
||||
virtual bool applies(const Library *parent) = 0;
|
||||
virtual bool applies(const Library *parent, const RuntimeContext & runtimeContext) = 0;
|
||||
|
||||
public:
|
||||
Rule(RuleAction result) : m_result(result)
|
||||
@ -45,9 +45,9 @@ public:
|
||||
}
|
||||
virtual ~Rule() {};
|
||||
virtual QJsonObject toJson() = 0;
|
||||
RuleAction apply(const Library *parent)
|
||||
RuleAction apply(const Library *parent, const RuntimeContext & runtimeContext)
|
||||
{
|
||||
if (applies(parent))
|
||||
if (applies(parent, runtimeContext))
|
||||
return m_result;
|
||||
else
|
||||
return Defer;
|
||||
@ -63,9 +63,9 @@ private:
|
||||
QString m_version_regexp;
|
||||
|
||||
protected:
|
||||
virtual bool applies(const Library *)
|
||||
virtual bool applies(const Library *, const RuntimeContext & runtimeContext)
|
||||
{
|
||||
return (m_system == RuntimeContext::currentSystem());
|
||||
return runtimeContext.classifierMatches(m_system);
|
||||
}
|
||||
OsRule(RuleAction result, QString system, QString version_regexp)
|
||||
: Rule(result), m_system(system), m_version_regexp(version_regexp)
|
||||
@ -84,7 +84,7 @@ public:
|
||||
class ImplicitRule : public Rule
|
||||
{
|
||||
protected:
|
||||
virtual bool applies(const Library *)
|
||||
virtual bool applies(const Library *, const RuntimeContext & runtimeContext)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user