[dunfell,36/42] dnf: Backport bugfix for upgrade

Message ID bc0c1234b7ae48394af92a4d14c2b47f2e3b98a1.1638136329.git.steve@sakoman.com
State Accepted, archived
Commit 87c413d2a9554412d02dee4534febfafdbe4a4c1
Headers show
Series [dunfell,01/42] linux-yocto/5.4: update to v5.4.154 | expand

Commit Message

Steve Sakoman Nov. 28, 2021, 9:57 p.m. UTC
From: Jate Sujjavanich <jatedev@gmail.com>

Keep installed packages in upgrade job

This prevents duplicate identical packages from being reinstalled
with each upgrade

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 ...ackages-in-upgrade-job-RhBug-1728252.patch | 60 +++++++++++++++++++
 meta/recipes-devtools/dnf/dnf_4.2.2.bbappend  |  3 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta/recipes-devtools/dnf/dnf/0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch
 create mode 100644 meta/recipes-devtools/dnf/dnf_4.2.2.bbappend

Comments

Mittal, Anuj Nov. 29, 2021, 4:43 a.m. UTC | #1
On Sun, 2021-11-28 at 11:57 -1000, Steve Sakoman wrote:
> From: Jate Sujjavanich <jatedev@gmail.com>
> 
> Keep installed packages in upgrade job
> 
> This prevents duplicate identical packages from being reinstalled
> with each upgrade
> 
> Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
>  ...ackages-in-upgrade-job-RhBug-1728252.patch | 60
> +++++++++++++++++++
>  meta/recipes-devtools/dnf/dnf_4.2.2.bbappend  |  3 +

Why is this being added to a bbappend instead of the recipe itself?

Thanks,

Anuj

>  2 files changed, 63 insertions(+)
>  create mode 100644 meta/recipes-devtools/dnf/dnf/0040-Keep-
> installed-packages-in-upgrade-job-RhBug-1728252.patch
>  create mode 100644 meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> 
> diff --git a/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-
> packages-in-upgrade-job-RhBug-1728252.patch b/meta/recipes-
> devtools/dnf/dnf/0040-Keep-installed-packages-in-upgrade-job-RhBug-
> 1728252.patch
> new file mode 100644
> index 0000000000..57c2375a54
> --- /dev/null
> +++ b/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-packages-in-
> upgrade-job-RhBug-1728252.patch
> @@ -0,0 +1,60 @@
> +From c88a77198c0156e425c2725f30e481207de5162f Mon Sep 17 00:00:00
> 2001
> +From: Jaroslav Mracek <jmracek@redhat.com>
> +Date: Tue, 3 Sep 2019 11:01:51 +0200
> +Subject: [PATCH] Keep installed packages in upgrade job
> + (RhBug:1728252,1644241,1741381)
> +
> +In combination with marking of job as TARGETED it prevents from
> +reinstalling of modified packages with same NEVRA.
> +
> +https://bugzilla.redhat.com/show_bug.cgi?id=1728252
> +https://bugzilla.redhat.com/show_bug.cgi?id=1644241
> +https://bugzilla.redhat.com/show_bug.cgi?id=1741381
> +
> +Closes: #1474
> +Approved by: m-blaha
> +
> +
> +Backport to fix bug in dnf in oe-core
> +from https://github.com/rpm-software-management/dnf
> +
> +Removed spec file portion of patch
> +
> +Upstream-Status: Backport
> +Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
> +---
> + dnf.spec                  | 4 ++--
> + dnf/base.py               | 3 ---
> + dnf/module/module_base.py | 2 +-
> + 3 files changed, 3 insertions(+), 6 deletions(-)
> +
> +diff --git a/dnf/base.py b/dnf/base.py
> +index b2ced61..628c154 100644
> +--- a/dnf/base.py
> ++++ b/dnf/base.py
> +@@ -1968,9 +1968,6 @@ class Base(object):
> +                 obsoletes=q.installed().union(q.upgrades()))
> +             # add obsoletes into transaction
> +             q = q.union(obsoletes)
> +-        # provide only available packages to solver otherwise
> selection of available
> +-        # possibilities will be ignored
> +-        q = q.available()
> +         if reponame is not None:
> +             q.filterm(reponame=reponame)
> +         q = self._merge_update_filters(q, pkg_spec=pkg_spec)
> +diff --git a/dnf/module/module_base.py b/dnf/module/module_base.py
> +index 976d730..ce70f63 100644
> +--- a/dnf/module/module_base.py
> ++++ b/dnf/module/module_base.py
> +@@ -214,7 +214,7 @@ class ModuleBase(object):
> + 
> +             if not upgrade_package_set:
> +                 logger.error(_("Unable to match profile in argument
> {}").format(spec))
> +-            query =
> self.base.sack.query().available().filterm(name=upgrade_package_set)
> ++            query =
> self.base.sack.query().filterm(name=upgrade_package_set)
> +             if query:
> +                 sltr = dnf.selector.Selector(self.base.sack)
> +                 sltr.set(pkg=query)
> +-- 
> +2.7.4
> +
> diff --git a/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> b/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> new file mode 100644
> index 0000000000..3811db604b
> --- /dev/null
> +++ b/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> @@ -0,0 +1,3 @@
> +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> +
> +SRC_URI +=
> "file://0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch
> "
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#158918):
> https://lists.openembedded.org/g/openembedded-core/message/158918
> Mute This Topic: https://lists.openembedded.org/mt/87365202/3616702
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/openembedded-core/unsub [
> anuj.mittal@intel.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Steve Sakoman Nov. 29, 2021, 1:54 p.m. UTC | #2
On Sun, Nov 28, 2021 at 6:43 PM Mittal, Anuj <anuj.mittal@intel.com> wrote:
>
> On Sun, 2021-11-28 at 11:57 -1000, Steve Sakoman wrote:
> > From: Jate Sujjavanich <jatedev@gmail.com>
> >
> > Keep installed packages in upgrade job
> >
> > This prevents duplicate identical packages from being reinstalled
> > with each upgrade
> >
> > Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
> > Signed-off-by: Steve Sakoman <steve@sakoman.com>
> > ---
> >  ...ackages-in-upgrade-job-RhBug-1728252.patch | 60
> > +++++++++++++++++++
> >  meta/recipes-devtools/dnf/dnf_4.2.2.bbappend  |  3 +
>
> Why is this being added to a bbappend instead of the recipe itself?

Arghh . . . I noticed this only after testing on the autobuilder and
forgot to remove these two dnf patches prior to generating the series
for review.  Thanks for catching this Anuj!

Jate, can you revise the patches and resubmit?

Steve

> >  2 files changed, 63 insertions(+)
> >  create mode 100644 meta/recipes-devtools/dnf/dnf/0040-Keep-
> > installed-packages-in-upgrade-job-RhBug-1728252.patch
> >  create mode 100644 meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> >
> > diff --git a/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-
> > packages-in-upgrade-job-RhBug-1728252.patch b/meta/recipes-
> > devtools/dnf/dnf/0040-Keep-installed-packages-in-upgrade-job-RhBug-
> > 1728252.patch
> > new file mode 100644
> > index 0000000000..57c2375a54
> > --- /dev/null
> > +++ b/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-packages-in-
> > upgrade-job-RhBug-1728252.patch
> > @@ -0,0 +1,60 @@
> > +From c88a77198c0156e425c2725f30e481207de5162f Mon Sep 17 00:00:00
> > 2001
> > +From: Jaroslav Mracek <jmracek@redhat.com>
> > +Date: Tue, 3 Sep 2019 11:01:51 +0200
> > +Subject: [PATCH] Keep installed packages in upgrade job
> > + (RhBug:1728252,1644241,1741381)
> > +
> > +In combination with marking of job as TARGETED it prevents from
> > +reinstalling of modified packages with same NEVRA.
> > +
> > +https://bugzilla.redhat.com/show_bug.cgi?id=1728252
> > +https://bugzilla.redhat.com/show_bug.cgi?id=1644241
> > +https://bugzilla.redhat.com/show_bug.cgi?id=1741381
> > +
> > +Closes: #1474
> > +Approved by: m-blaha
> > +
> > +
> > +Backport to fix bug in dnf in oe-core
> > +from https://github.com/rpm-software-management/dnf
> > +
> > +Removed spec file portion of patch
> > +
> > +Upstream-Status: Backport
> > +Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
> > +---
> > + dnf.spec                  | 4 ++--
> > + dnf/base.py               | 3 ---
> > + dnf/module/module_base.py | 2 +-
> > + 3 files changed, 3 insertions(+), 6 deletions(-)
> > +
> > +diff --git a/dnf/base.py b/dnf/base.py
> > +index b2ced61..628c154 100644
> > +--- a/dnf/base.py
> > ++++ b/dnf/base.py
> > +@@ -1968,9 +1968,6 @@ class Base(object):
> > +                 obsoletes=q.installed().union(q.upgrades()))
> > +             # add obsoletes into transaction
> > +             q = q.union(obsoletes)
> > +-        # provide only available packages to solver otherwise
> > selection of available
> > +-        # possibilities will be ignored
> > +-        q = q.available()
> > +         if reponame is not None:
> > +             q.filterm(reponame=reponame)
> > +         q = self._merge_update_filters(q, pkg_spec=pkg_spec)
> > +diff --git a/dnf/module/module_base.py b/dnf/module/module_base.py
> > +index 976d730..ce70f63 100644
> > +--- a/dnf/module/module_base.py
> > ++++ b/dnf/module/module_base.py
> > +@@ -214,7 +214,7 @@ class ModuleBase(object):
> > +
> > +             if not upgrade_package_set:
> > +                 logger.error(_("Unable to match profile in argument
> > {}").format(spec))
> > +-            query =
> > self.base.sack.query().available().filterm(name=upgrade_package_set)
> > ++            query =
> > self.base.sack.query().filterm(name=upgrade_package_set)
> > +             if query:
> > +                 sltr = dnf.selector.Selector(self.base.sack)
> > +                 sltr.set(pkg=query)
> > +--
> > +2.7.4
> > +
> > diff --git a/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> > b/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> > new file mode 100644
> > index 0000000000..3811db604b
> > --- /dev/null
> > +++ b/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
> > @@ -0,0 +1,3 @@
> > +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> > +
> > +SRC_URI +=
> > "file://0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch
> > "
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#158918):
> > https://lists.openembedded.org/g/openembedded-core/message/158918
> > Mute This Topic: https://lists.openembedded.org/mt/87365202/3616702
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe:
> > https://lists.openembedded.org/g/openembedded-core/unsub [
> > anuj.mittal@intel.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
Jate Sujjavanich Nov. 29, 2021, 2:47 p.m. UTC | #3
Sorry about that. I will send you a v2 update.

- Jate

Patch

diff --git a/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch b/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch
new file mode 100644
index 0000000000..57c2375a54
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf/0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch
@@ -0,0 +1,60 @@ 
+From c88a77198c0156e425c2725f30e481207de5162f Mon Sep 17 00:00:00 2001
+From: Jaroslav Mracek <jmracek@redhat.com>
+Date: Tue, 3 Sep 2019 11:01:51 +0200
+Subject: [PATCH] Keep installed packages in upgrade job
+ (RhBug:1728252,1644241,1741381)
+
+In combination with marking of job as TARGETED it prevents from
+reinstalling of modified packages with same NEVRA.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1728252
+https://bugzilla.redhat.com/show_bug.cgi?id=1644241
+https://bugzilla.redhat.com/show_bug.cgi?id=1741381
+
+Closes: #1474
+Approved by: m-blaha
+
+
+Backport to fix bug in dnf in oe-core
+from https://github.com/rpm-software-management/dnf
+
+Removed spec file portion of patch
+
+Upstream-Status: Backport
+Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
+---
+ dnf.spec                  | 4 ++--
+ dnf/base.py               | 3 ---
+ dnf/module/module_base.py | 2 +-
+ 3 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/dnf/base.py b/dnf/base.py
+index b2ced61..628c154 100644
+--- a/dnf/base.py
++++ b/dnf/base.py
+@@ -1968,9 +1968,6 @@ class Base(object):
+                 obsoletes=q.installed().union(q.upgrades()))
+             # add obsoletes into transaction
+             q = q.union(obsoletes)
+-        # provide only available packages to solver otherwise selection of available
+-        # possibilities will be ignored
+-        q = q.available()
+         if reponame is not None:
+             q.filterm(reponame=reponame)
+         q = self._merge_update_filters(q, pkg_spec=pkg_spec)
+diff --git a/dnf/module/module_base.py b/dnf/module/module_base.py
+index 976d730..ce70f63 100644
+--- a/dnf/module/module_base.py
++++ b/dnf/module/module_base.py
+@@ -214,7 +214,7 @@ class ModuleBase(object):
+ 
+             if not upgrade_package_set:
+                 logger.error(_("Unable to match profile in argument {}").format(spec))
+-            query = self.base.sack.query().available().filterm(name=upgrade_package_set)
++            query = self.base.sack.query().filterm(name=upgrade_package_set)
+             if query:
+                 sltr = dnf.selector.Selector(self.base.sack)
+                 sltr.set(pkg=query)
+-- 
+2.7.4
+
diff --git a/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend b/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
new file mode 100644
index 0000000000..3811db604b
--- /dev/null
+++ b/meta/recipes-devtools/dnf/dnf_4.2.2.bbappend
@@ -0,0 +1,3 @@ 
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0040-Keep-installed-packages-in-upgrade-job-RhBug-1728252.patch"