From 81d09d26268f7cb9a371b05c1abe07d581eb952a Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 10 Jan 2023 18:09:40 +0100 Subject: pkg/subsystem: add the path matching code Additionally, optimize the matching by joining the rules without exclusion (that is, almost all MAINTAINER records). --- pkg/subsystem/entity/entities.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pkg/subsystem/entity/entities.go (limited to 'pkg/subsystem/entity') diff --git a/pkg/subsystem/entity/entities.go b/pkg/subsystem/entity/entities.go new file mode 100644 index 000000000..6d028e391 --- /dev/null +++ b/pkg/subsystem/entity/entities.go @@ -0,0 +1,15 @@ +// Copyright 2023 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package entity + +type Subsystem struct { + PathRules []PathRule +} + +// PathRule describes the part of the directory tree belonging to a single subsystem. +type PathRule struct { + IncludeRegexp string + // ExcludeRegexps are tested before IncludeRegexp. + ExcludeRegexp string +} -- cgit mrf-deployment