summaryrefslogtreecommitdiffstats
path: root/debian/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-30 16:45:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-30 16:45:07 +0000
commit0ec4a0912294e5ef354ea5074e0446eb364e05c5 (patch)
tree020b497d1954ba229263a78d0b150c97a5cc57e8 /debian/lib
parentMerging upstream version 20240709. (diff)
downloadfirmware-nonfree-0ec4a0912294e5ef354ea5074e0446eb364e05c5.tar.xz
firmware-nonfree-0ec4a0912294e5ef354ea5074e0446eb364e05c5.zip
Adding debian version 20240709-2.debian/20240709-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/lib')
-rw-r--r--debian/lib/python/config.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/lib/python/config.py b/debian/lib/python/config.py
index 46cc324..57980ef 100644
--- a/debian/lib/python/config.py
+++ b/debian/lib/python/config.py
@@ -1,3 +1,5 @@
+import re
+
from debian_linux.config import ConfigParser, SchemaItemList
class Config(dict):
@@ -12,7 +14,9 @@ class Config(dict):
package_schemas = {
'base': {
'files': SchemaItemList(),
+ 'files-excluded': SchemaItemList(),
'support': SchemaItemList(),
+ 'usrmovemitigation': SchemaItemList(),
}
}
@@ -44,3 +48,19 @@ class Config(dict):
s = self.get(real, {})
s.update(config[section])
self[real] = s
+
+_wildcard_re = re.compile(r'\*\*/|[*?.^$+{}\\\[\]|()]')
+_wildcard_map = {
+ '**/': r'(?:.+/)?',
+ '*': r'[^/]*',
+ '?': r'[^/]',
+}
+
+# pathlib.Path.match() does *not* support '**', so do our own
+# pattern-to-regexp conversion
+def pattern_to_re(pattern):
+ return re.compile(
+ _wildcard_re.sub(
+ lambda match: _wildcard_map.get(match.group(0),
+ '\\' + match.group(0)),
+ pattern))