[packages/rpm] fix for wrong type reported by headerGet
draenog
draenog at pld-linux.org
Tue May 7 09:41:14 CEST 2013
commit c065c1c1c805160aefc44c79e2115cb092bff825
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Tue May 7 08:32:54 2013 +0100
fix for wrong type reported by headerGet
It is a part of changes (rest will be in poldek) to fix poldek's crashes
on subpackages with inherited Group.
rpm-preserve-tag-type.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++
rpm.spec | 4 +++-
2 files changed, 58 insertions(+), 1 deletion(-)
---
diff --git a/rpm.spec b/rpm.spec
index 5fd3b97..8b13a71 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -52,7 +52,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 5.4.10
-Release: 51
+Release: 52
License: LGPL v2.1
Group: Base
# http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.10-0.20120706.src.rpm
@@ -163,6 +163,7 @@ Patch68: rubyprov-archdirs.patch
Patch69: rubyprov-abi-versioned.patch
Patch70: python-%{name}sense-missingok.patch
Patch71: %{name}-changelog-encoding.patch
+Patch72: %{name}-preserve-tag-type.patch
# Patches imported from Mandriva
@@ -890,6 +891,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
%patch67 -p1
%patch70 -p1
%patch71 -p1
+%patch72 -p1
%patch1000 -p1
%patch1001 -p1
diff --git a/rpm-preserve-tag-type.patch b/rpm-preserve-tag-type.patch
new file mode 100644
index 0000000..9956219
--- /dev/null
+++ b/rpm-preserve-tag-type.patch
@@ -0,0 +1,55 @@
+commit 8241b884f83153dee9cdcddac7a476c6234cf156
+Author: Kacper Kornet <draenog at pld-linux.org>
+Date: Sun May 5 21:56:02 2013 +0100
+
+ Don't overwrite type of validated tag
+
+ It caused headerGet(h, he, HEADERGET_NOI18NSTRING|HEADERGET_NOEXTENSION)
+ to return always he->t = RPMTAG_STRING even when RPM_I18NSTRING_TYPE (char **)
+ was returned in reality.
+
+diff --git a/rpmdb/tagname.c b/rpmdb/tagname.c
+index 540838b..174df60 100644
+--- a/rpmdb/tagname.c
++++ b/rpmdb/tagname.c
+@@ -491,26 +491,28 @@ tagStore_t tagStoreFree(tagStore_t dbiTags, size_t dbiNTags)
+ void tagTypeValidate(HE_t he);
+ void tagTypeValidate(HE_t he)
+ {
++ HE_s he_s = *he;
++
+ /* XXX Re-map RPM_I18NSTRING_TYPE -> RPM_STRING_TYPE */
+- if (he->t == RPM_I18NSTRING_TYPE)
+- he->t = RPM_STRING_TYPE;
++ if (he_s.t == RPM_I18NSTRING_TYPE)
++ he_s.t = RPM_STRING_TYPE;
+
+ /* XXX Arbitrary tags are always strings. */
+- if ((he->tag & 0x40000000)
+- && (he->t == RPM_STRING_TYPE || he->t == RPM_STRING_ARRAY_TYPE))
++ if ((he_s.tag & 0x40000000)
++ && (he_s.t == RPM_STRING_TYPE || he_s.t == RPM_STRING_ARRAY_TYPE))
+ return;
+
+ /* XXX Make 0x3fffffff disappear for now. Signature? */
+- if (he->tag == 0x3fffffff && he->t == RPM_BIN_TYPE)
++ if (he_s.tag == 0x3fffffff && he_s.t == RPM_BIN_TYPE)
+ return;
+
+ /* XXX hack around known borkage for now. */
+-if (!(he->tag == 62))
+-if (!(he->tag == 261 || he->tag == 269))
+-if (!(he->tag == 1000 || he->tag == 1004 || he->tag == 1007))
+-if (!(he->tag == 1029))
+-if (!(he->tag == 1086 || he->tag == 1087))
+-if (he->t != (tagType(he->tag) & 0xffff))
+-fprintf(stderr, "==> warning: tag %u type(0x%x) != implicit type(0x%x)\n", (unsigned) he->tag, he->t, tagType(he->tag));
++if (!(he_s.tag == 62))
++if (!(he_s.tag == 261 || he_s.tag == 269))
++if (!(he_s.tag == 1000 || he_s.tag == 1004 || he_s.tag == 1007))
++if (!(he_s.tag == 1029))
++if (!(he_s.tag == 1086 || he_s.tag == 1087))
++if (he_s.t != (tagType(he_s.tag) & 0xffff))
++fprintf(stderr, "==> warning: tag %u type(0x%x) != implicit type(0x%x)\n", (unsigned) he_s.tag, he_s.t, tagType(he_s.tag));
+ }
+ #endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/c065c1c1c805160aefc44c79e2115cb092bff825
More information about the pld-cvs-commit
mailing list