Skip to content

Commit bd221aa

Browse files
Daniel Machjrohel
authored andcommitted
[goal] Exclude @System repo packages from distro_sync.
1 parent a789233 commit bd221aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dnf/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,8 +2036,11 @@ def distro_sync(self, pkg_spec=None):
20362036
if pkg_spec is None:
20372037
self._goal.distupgrade_all()
20382038
else:
2039-
sltrs = dnf.subject.Subject(pkg_spec) \
2040-
._get_best_selectors(self, obsoletes=self.conf.obsoletes, reports=True)
2039+
subject = dnf.subject.Subject(pkg_spec)
2040+
solution = subject.get_best_solution(self.sack, with_src=False)
2041+
solution["query"].filterm(reponame__neq=hawkey.SYSTEM_REPO_NAME)
2042+
sltrs = subject._get_best_selectors(self, solution=solution,
2043+
obsoletes=self.conf.obsoletes, reports=True)
20412044
if not sltrs:
20422045
logger.info(_('No package %s installed.'), pkg_spec)
20432046
return 0

0 commit comments

Comments
 (0)