2ad730 add SOURCES/0011-Keep-installed-packages-in-upgrade-job-RhBug172825216442411741381.patch

Authored and Committed by hughesjr 5 years ago
    add SOURCES/0011-Keep-installed-packages-in-upgrade-job-RhBug172825216442411741381.patch
    
        
SOURCES/0011-Keep-installed-packages-in-upgrade-job-RhBug172825216442411741381.patch ADDED
@@ -0,0 +1,49 @@
1
+ From a5c4a994f8ad2764ca8f971c39f189d5f9d7d337 Mon Sep 17 00:00:00 2001
2
+ From: Jaroslav Mracek <jmracek@redhat.com>
3
+ Date: Tue, 3 Sep 2019 11:01:51 +0200
4
+ Subject: [PATCH] Keep installed packages in upgrade job (RhBug:1728252,1644241,1741381)
5
+
6
+ In combination with marking of job as TARGETED it prevents from
7
+ reinstalling of modified packages with same NEVRA.
8
+
9
+ https://bugzilla.redhat.com/show_bug.cgi?id=1728252
10
+ https://bugzilla.redhat.com/show_bug.cgi?id=1644241
11
+ https://bugzilla.redhat.com/show_bug.cgi?id=1741381
12
+
13
+ Closes: #1474
14
+ Approved by: m-blaha
15
+ ---
16
+ dnf/base.py | 3 ---
17
+ dnf/module/module_base.py | 2 +-
18
+ 2 files changed, 1 insertion(+), 4 deletions(-)
19
+
20
+ diff --git a/dnf/base.py b/dnf/base.py
21
+ index b2ced61..628c154 100644
22
+ --- a/dnf/base.py
23
+ +++ b/dnf/base.py
24
+ @@ -1968,9 +1968,6 @@ class Base(object):
25
+ obsoletes=q.installed().union(q.upgrades()))
26
+ # add obsoletes into transaction
27
+ q = q.union(obsoletes)
28
+ - # provide only available packages to solver otherwise selection of available
29
+ - # possibilities will be ignored
30
+ - q = q.available()
31
+ if reponame is not None:
32
+ q.filterm(reponame=reponame)
33
+ q = self._merge_update_filters(q, pkg_spec=pkg_spec)
34
+ diff --git a/dnf/module/module_base.py b/dnf/module/module_base.py
35
+ index 976d730..ce70f63 100644
36
+ --- a/dnf/module/module_base.py
37
+ +++ b/dnf/module/module_base.py
38
+ @@ -214,7 +214,7 @@ class ModuleBase(object):
39
+
40
+ if not upgrade_package_set:
41
+ logger.error(_("Unable to match profile in argument {}").format(spec))
42
+ - query = self.base.sack.query().available().filterm(name=upgrade_package_set)
43
+ + query = self.base.sack.query().filterm(name=upgrade_package_set)
44
+ if query:
45
+ sltr = dnf.selector.Selector(self.base.sack)
46
+ sltr.set(pkg=query)
47
+ --
48
+ libgit2 0.28.2
49
+