[OE-core] [jethro] [PATCH] rpm: Fix the Bug of SRPM String error
Zheng, Ruoqin
zhengrq.fnst at cn.fujitsu.com
Wed May 17 05:14:38 UTC 2017
Ping
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
Nanjing, 210012, China
MAIL : zhengrq.fnst at cn.fujistu.com
-----Original Message-----
From: Zheng, Ruoqin/郑 若钦
Sent: Monday, May 08, 2017 6:16 PM
To: openembedded-core at lists.openembedded.org
Cc: Zheng, Ruoqin/郑 若钦 <zhengrq.fnst at cn.fujitsu.com>
Subject: [OE-core] [jethro] [PATCH] rpm: Fix the Bug of SRPM String error
Add a patch 0001-Fix-the-Bug-of-SRPM-String-error.patch to fix SRPM bug
When use bitbake to build a SRPM package, some sections of SRPM can't be displayed normally.
For example:
$ rpm -qpi zlib-1.2.8-r0.src.rpm
warning: zlib-1.2.8-r0.src.rpm: Header V4 DSA/SHA1 Signature, key ID e64962a6: NOKEY
Name : zlib
Version : 1.2.8
Release : r0
Architecture: i586
Install Date: (not installed)
Group : ﺩ
Size : 633007
License : Zlib
Signature : DSA/SHA1, 2017年04月22日 00時38分03秒, Key ID bc5e0520e64962a6
Source RPM : (none)
Build Date : 2017年04月22日 00時38分03秒
Build Host : force
Relocations : (not relocatable)
Packager : Poky <poky at yoctoproject.org>
URL : http://zlib.net/
Summary : ¨¯
Description :
ﺩ
Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
---
.../0001-Fix-the-Bug-of-SRPM-String-error.patch | 162 +++++++++++++++++++++
meta/recipes-devtools/rpm/rpm_5.4.14.bb | 1 +
2 files changed, 163 insertions(+)
create mode 100644 meta/recipes-devtools/rpm/rpm/0001-Fix-the-Bug-of-SRPM-String-error.patch
diff --git a/meta/recipes-devtools/rpm/rpm/0001-Fix-the-Bug-of-SRPM-String-error.patch b/meta/recipes-devtools/rpm/rpm/0001-Fix-the-Bug-of-SRPM-String-error.patch
new file mode 100644
index 0000000..f85e333
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/0001-Fix-the-Bug-of-SRPM-String-erro
+++ r.patch
@@ -0,0 +1,162 @@
+Subject: [PATCH] Fix the Bug of SRPM String error
+
+Upstream-Status: Backport from rpm 5.4.16 $ rpm -qpi
+zlib-1.2.8-r0.src.rpm
+warning: zlib-1.2.8-r0.src.rpm: Header V4 DSA/SHA1 Signature, key ID e64962a6: NOKEY
+Name : zlib
+Version : 1.2.8
+Release : r0
+Architecture: i586
+Install Date: (not installed)
+Group : د
+Size : 633007
+License : Zlib
+Signature : DSA/SHA1, 2017年04月22日 00時38分03秒, Key ID bc5e0520e64962a6
+Source RPM : (none)
+Build Date : 2017年04月22日 00時38分03秒
+Build Host : force
+Relocations : (not relocatable)
+Packager : Poky <poky at yoctoproject.org>
+URL : http://zlib.net/
+Summary : ¨¯
+Description :
+د
+
+Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
+---
+ rpmdb/header.c | 8 ++++----
+ rpmdb/rpmtag.h | 1 +
+ rpmdb/tagname.c | 61
+++++++++++++++++++++++++++++++++++++++++-----------------
+ 3 files changed, 48 insertions(+), 22 deletions(-)
+
+diff --git a/rpmdb/header.c b/rpmdb/header.c index 2f72a05..0e1d613
+100644
+--- a/rpmdb/header.c
++++ b/rpmdb/header.c
+@@ -32,7 +32,7 @@ GENfree(HeaderIterator)
+ #endif /* __cplusplus */
+
+ #if defined(SUPPORT_IMPLICIT_TAG_DATA_TYPES)
+-extern void tagTypeValidate(HE_t he)
++extern void tagTypeValidate(HE_t he, unsigned int flags)
+ /*@*/;
+ #endif
+
+@@ -2273,7 +2273,7 @@ int headerGet(Header h, HE_t he, unsigned int
+flags) /*@-modfilesys@*/
+ /* XXX verify that explicit and implicit types are identical. */
+ if (rc)
+- tagTypeValidate(he);
++ tagTypeValidate(he, flags);
+ /*@=modfilesys@*/
+ #endif
+
+@@ -2296,7 +2296,7 @@ int headerPut(Header h, HE_t he, /*@unused@*/
+unsigned int flags) #if defined(SUPPORT_IMPLICIT_TAG_DATA_TYPES)
+ /*@-modfilesys@*/
+ /* XXX verify that explicit and implicit types are identical. */
+- tagTypeValidate(he);
++ tagTypeValidate(he, flags);
+ /*@=modfilesys@*/
+ #endif
+
+@@ -2321,7 +2321,7 @@ int headerMod(Header h, HE_t he, /*@unused@*/
+unsigned int flags) #if defined(SUPPORT_IMPLICIT_TAG_DATA_TYPES)
+ /*@-modfilesys@*/
+ /* XXX verify that explicit and implicit types are identical. */
+- tagTypeValidate(he);
++ tagTypeValidate(he, flags);
+ /*@=modfilesys@*/
+ #endif
+
+diff --git a/rpmdb/rpmtag.h b/rpmdb/rpmtag.h index b4ad445..e5c895d
+100644
+--- a/rpmdb/rpmtag.h
++++ b/rpmdb/rpmtag.h
+@@ -772,6 +772,7 @@ int headerGet(Header h, HE_t he, unsigned int flags)
+ /*@modifies he, internalState @*/;
+ #define HEADERGET_NOEXTENSION (1 << 0) /*!< Extension search disabler. */
+ #define HEADERGET_NOI18NSTRING (1 << 1) /*!< Return i18n strings as argv. */
++#define HEADERGET_SIGHEADER (1 << 2) /*!< Override signature tag data. */
+
+ /** \ingroup header
+ * Add or append tag container to header.
+diff --git a/rpmdb/tagname.c b/rpmdb/tagname.c index c30a3c2..44fda1c
+100644
+--- a/rpmdb/tagname.c
++++ b/rpmdb/tagname.c
+@@ -504,28 +504,53 @@ tagStore_t tagStoreFree(tagStore_t dbiTags,
+size_t dbiNTags)
+ * Validate that implicit and explicit types are identical.
+ * @param he tag container
+ */
+-void tagTypeValidate(HE_t he);
+-void tagTypeValidate(HE_t he)
++void tagTypeValidate(HE_t he, unsigned int flags); void
++tagTypeValidate(HE_t he, unsigned int flags)
+ {
+- /* XXX Re-map RPM_I18NSTRING_TYPE -> RPM_STRING_TYPE */
+- if (he->t == RPM_I18NSTRING_TYPE)
+- he->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))
++ /* XXX Skip RPMSIGTAG_* validation. */
++ if (flags & HEADERGET_SIGHEADER)
+ return;
+
+- /* XXX Make 0x3fffffff disappear for now. Signature? */
+- if (he->tag == 0x3fffffff && he->t == RPM_BIN_TYPE)
++ /* XXX Arbitrary tags are always STRING or STRING_ARRAY. */
++ if (he->tag & 0x40000000) {
++ if (!(he->t == RPM_STRING_TYPE || he->t == RPM_STRING_ARRAY_TYPE)) {
++ rpmTagType tagtype = RPM_STRING_TYPE;
++ rpmlog(RPMLOG_WARNING,
++ _("tag %s(%u) type(0x%x) != expected type(0x%x)\n"),
++ tagName(he->tag), (unsigned) he->tag, he->t, tagtype);
++ }
+ 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 == 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));
++ switch (he->tag) {
++#if defined(SUPPORT_I18NSTRING_TYPE)
++ case RPMTAG_SUMMARY:
++ case RPMTAG_DESCRIPTION:
++ case RPMTAG_GROUP:
++#endif
++ case RPMTAG_FILESTATES: /* XXX either CHAR or UINT8 */
++ break;
++ case RPMTAG_PREINPROG: /* XXX either STRING or STRING_ARRAY */
++ case RPMTAG_POSTINPROG: /* XXX either STRING or STRING_ARRAY */
++ case RPMTAG_PREUNPROG: /* XXX either STRING or STRING_ARRAY */
++ case RPMTAG_POSTUNPROG: /* XXX either STRING or STRING_ARRAY */
++ case RPMTAG_VERIFYSCRIPTPROG:/* XXX either STRING or STRING_ARRAY */
++ if (!(he->t == RPM_STRING_TYPE || he->t == RPM_STRING_ARRAY_TYPE)) {
++ rpmTagType tagtype = RPM_STRING_TYPE;
++ rpmlog(RPMLOG_WARNING,
++ _("tag %s(%u) type(0x%x) != expected type(0x%x)\n"),
++ tagName(he->tag), (unsigned) he->tag, he->t, tagtype);
++ }
++ break;
++ default:
++ { rpmTagType tagtype = tagType(he->tag);
++ rpmTagType type = (tagtype & 0xffff);
++ if (type && he->t != type) {
++ rpmlog(RPMLOG_WARNING,
++ _("tag %s(%u) type(0x%x) != expected type(0x%x)\n"),
++ tagName(he->tag), (unsigned) he->tag, he->t, tagtype);
++ }
++ } break;
++ }
+ }
+ #endif
+--
+2.7.4
+
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index 73b3734..f8bdfe9 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -100,6 +100,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;e
file://rpm-macros.in-disable-external-key-server.patch \
file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
file://configure.ac-check-for-both-gpg2-and-gpg.patch \
+ file://0001-Fix-the-Bug-of-SRPM-String-error.patch \
"
# Uncomment the following line to enable platform score debugging
--
2.7.4
More information about the Openembedded-core
mailing list