Skip to content

Commit c8406b4

Browse files
authored
Merge pull request #19 from jpopelka/conflict-with-modular
Skip modular packages when checking for conflicts
2 parents f1aa0c6 + a113602 commit c8406b4

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

Diff for: .pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.1.7
7+
rev: v0.1.13
88
hooks:
99
- id: ruff-format
1010
- id: ruff
@@ -22,7 +22,7 @@ repos:
2222
- id: mixed-line-ending
2323
- id: trailing-whitespace
2424
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.7.1
25+
rev: v1.8.0
2626
hooks:
2727
- id: mypy
2828
additional_dependencies: [types-requests, types-six]

Diff for: docs/CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dev
77
* Exclude dirs known to be owned by many packages from conflict checking.
88
* If check-upgrade finds a package upgradable by its modular version, skip it.
99
* Make it possible to run rpmdeplint as a library.
10+
* Skip modular packages when checking for conflicts.
1011

1112
2.0
1213
~~~~~~

Diff for: docs/rpmdeplint.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Options
4040
--repo=myrepo,/home/me/my_repo
4141

4242
Note that the URL/path should point at a directory containing
43-
``repodata/repomd.xml``. Examples::
43+
``repodata/repomd.xml``.
4444

4545
.. option:: --repos-from-system, -R
4646

@@ -107,11 +107,13 @@ check-conflicts
107107
* the file’s checksum, permissions, owner, and group are identical in both
108108
packages (RPM allows both packages to own the file in this case); or
109109
* the file’s color is different between the two packages (RPM will
110-
silently resolve the conflict in favour of the 64-bit file).
110+
silently resolve the conflict in favour of the 64-bit file); or
111+
* any (or both) of them is/are a modular package.
111112

112113
check-upgrade
113114
Checks that there are no existing packages in the repositories which would
114115
upgrade or obsolete the given packages.
116+
Modular packages are not considered as candidates.
115117

116118
If this check fails, it means that the package under test will never be
117119
installed (since the package manager will always pick the newer or obsoleting

Diff for: rpmdeplint/analyzer.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ def find_conflicts(self) -> list[str]:
419419
# solver = self.pool.Solver()
420420
problems = []
421421
for solvable in self.solvables:
422+
if ".module" in solvable.evr:
423+
logger.debug("Skipping modular %s", solvable)
424+
continue
422425
logger.debug("Checking all files in %s for conflicts", solvable)
423426
filenames = self._files_in_solvable(solvable)
424427
# In libsolv, iterating all solvables is fast, and listing all
@@ -427,10 +430,11 @@ def find_conflicts(self) -> list[str]:
427430
# Hence, this approach, where we visit each solvable and use Python
428431
# set operations to look for any overlapping filenames.
429432
for conflicting in self.pool.solvables_iter():
430-
# Conflicts cannot happen between identical solvables and also
431-
# between solvables with the same name - such solvables cannot
432-
# be installed next to each other.
433-
if conflicting == solvable or conflicting.name == solvable.name:
433+
# Conflicts cannot happen between solvables with the same name,
434+
# such solvables cannot be installed next to each other.
435+
if conflicting.name == solvable.name:
436+
continue
437+
if ".module" in conflicting.evr:
434438
continue
435439
# Intersect files owned by solvable and conflicting and remove
436440
# dirs that are known to be owned by many packages.
@@ -501,6 +505,9 @@ def find_upgrade_problems(self) -> list[str]:
501505
transaction = solver.transaction()
502506
problems = []
503507
for solvable in self.solvables:
508+
if ".module" in solvable.evr:
509+
logger.debug("Skipping modular %s", solvable)
510+
continue
504511
action = transaction.steptype(
505512
solvable, transaction.SOLVER_TRANSACTION_SHOW_OBSOLETES
506513
)

Diff for: rpmdeplint/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def validate_common_dependency_analyzer_args(parser, args):
196196
)
197197

198198

199-
def main(args=None):
199+
def main(args=None) -> ExitCode:
200200
def add_subparser(
201201
subcommand: str, _help: str, subcommand_func: Callable[..., ExitCode]
202202
):

0 commit comments

Comments
 (0)