Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility to load filelists conditionally #2012

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
util: Add function for detecting file in specs
A helper function used to detect if any spec is a filename pattern.
  • Loading branch information
jan-kolarik committed Jan 12, 2024
commit 03f25088600cb8b5c0209d54e019204fba15d86e
8 changes: 8 additions & 0 deletions dnf/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,3 +631,11 @@ def _tsi_or_pkg_nevra_cmp(item1, item2):
def _name_unset_wrapper(input_name):
# returns <name-unset> for everything that evaluates to False (None, empty..)
return input_name if input_name else _("<name-unset>")


def _is_file_pattern_present(specs):
for spec in specs:
subj = dnf.subject.Subject(spec)
if subj._filename_pattern:
return True
return False