diff --git a/extract_utils/args.py b/extract_utils/args.py index ecb50cb6..4c1b8968 100644 --- a/extract_utils/args.py +++ b/extract_utils/args.py @@ -41,7 +41,7 @@ '-s', '--section', action='store', - help='only apply to section', + help='only apply to section name matching pattern', ) parser.add_argument( '-m', diff --git a/extract_utils/file.py b/extract_utils/file.py index dd50b3e3..c0acb62b 100644 --- a/extract_utils/file.py +++ b/extract_utils/file.py @@ -5,6 +5,7 @@ from __future__ import annotations +import fnmatch import re from enum import Enum from os import path @@ -499,7 +500,7 @@ def __add_file(self, file: File, section: str | None): if FileArgs.SYMLINK in file.args: self.package_symlinks.add(file) - if self.__section is None or section == self.__section: + if self.__section is None or fnmatch.fnmatch(section, self.__section): self.files.add(file) self.partitions.add(file.partition) if file.has_dst: