From: Aleksei Nikiforov <darktemplar@altlinux.org>
To: devel@lists.altlinux.org
Cc: Aleksei Nikiforov <darktemplar@altlinux.org>
Subject: [devel] [PATCH for apt] Fix crash when removing 3rd-party packages with some tags missing
Date: Fri, 31 Jan 2020 11:36:54 +0300
Message-ID: <20200131083654.55647-1-darktemplar@altlinux.org> (raw)
---
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
next reply other threads:[~2020-01-31 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-31 8:36 Aleksei Nikiforov [this message]
2020-01-31 14:53 ` Ivan Zakharyaschev
2020-01-31 15:48 ` Aleksei Nikiforov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200131083654.55647-1-darktemplar@altlinux.org \
--to=darktemplar@altlinux.org \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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