ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] [PATCH for apt] Fix crash when removing 3rd-party packages with some tags missing
@ 2020-01-31  8:36 Aleksei Nikiforov
  2020-01-31 14:53 ` Ivan Zakharyaschev
  0 siblings, 1 reply; 3+ messages in thread
From: Aleksei Nikiforov @ 2020-01-31  8:36 UTC (permalink / raw)
  To: devel; +Cc: Aleksei Nikiforov

---
 apt/apt-pkg/rpm/rpmpm.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/apt/apt-pkg/rpm/rpmpm.cc b/apt/apt-pkg/rpm/rpmpm.cc
index e00630f..4bca9f4 100644
--- a/apt/apt-pkg/rpm/rpmpm.cc
+++ b/apt/apt-pkg/rpm/rpmpm.cc
@@ -81,7 +81,12 @@ std::string rpm_name_conversion(const pkgCache::PkgIterator &Pkg)
 #if RPM_VERSION >= 0x040202
    // This is needed for removal to work on multilib packages, but old
    // rpm versions don't support name.arch in RPMDBI_LABEL, oh well...
-   Name = Name + "." + Pkg.CurrentVer().Arch();
+   // Note: some 3rd-party packages may still miss arch, so only use it
+   // when it's present
+   if (Pkg.CurrentVer().Arch() != nullptr)
+   {
+      Name = Name + "." + Pkg.CurrentVer().Arch();
+   }
 #endif
 
    return Name;
-- 
2.24.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-31 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31  8:36 [devel] [PATCH for apt] Fix crash when removing 3rd-party packages with some tags missing Aleksei Nikiforov
2020-01-31 14:53 ` Ivan Zakharyaschev
2020-01-31 15:48   ` Aleksei Nikiforov

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git