]> git.pld-linux.org Git - packages/poldek.git/commitdiff
fix for crashes on subpackages with inherited group auto/th/poldek-0.30.0-1.rc7.3
authorKacper Kornet <draenog@pld-linux.org>
Tue, 7 May 2013 07:57:35 +0000 (08:57 +0100)
committerKacper Kornet <draenog@pld-linux.org>
Tue, 7 May 2013 07:57:35 +0000 (08:57 +0100)
Together with rpm-5.4.10-52 fixes
https://bugs.launchpad.net/poldek/+bug/1077603

poldek-inherited-group.patch [new file with mode: 0644]
poldek.spec

diff --git a/poldek-inherited-group.patch b/poldek-inherited-group.patch
new file mode 100644 (file)
index 0000000..9d3ec75
--- /dev/null
@@ -0,0 +1,72 @@
+commit 84563d90b30b05d1705d84344f75aec5f7fd6f58
+Author: Kacper Kornet <draenog@pld-linux.org>
+Date:   Tue May 7 08:45:51 2013 +0100
+
+    Fix for crashes on subpackages with inherited group
+    
+    In normal case RPMTAG_GROUP is RPM_I18NSTRING_TYPE. However when group
+    is inherited from main package in some versions of rpm5 it is
+    RPM_STRING_TYPE. What's worse some versions of rpm5 returns
+    RPM_STRING_TYPE but report RPM_I18NSTRING_TYPE. However the last
+    behaviour is so buggy that we don't care about it.
+    
+    Reverts 810280a1e3be737bf074b536c414eadbb0f38596 and adds proper
+    fix for https://bugs.launchpad.net/poldek/+bug/966972 by reusing
+    existing code.
+
+diff --git a/pkgroup.c b/pkgroup.c
+index 9fdeaf9..cd8bf4d 100644
+--- a/pkgroup.c
++++ b/pkgroup.c
+@@ -470,21 +470,17 @@ int pkgroup_idx_update_rpmhdr(struct pkgroup_idx *idx, void *rpmhdr)
+     DBGF("ngroups %d, %d\n", ngroups, n_array_size(langs));
+     for (i=0; i < ngroups; i++) {
+-      const char *lang = n_array_nth(langs, i);
+-      
+-      const char *grp = groups;
+-      if (ngroups > 1) grp = groups[i];
+-      
+-      DBGF("   gr[%d of %d] %s\n", i, ngroups, grp);
+-      
+-      if (n_str_eq(lang, "C")) {
+-        if ((gr = n_hash_get(idx->ht, grp)) == NULL) {
+-          gr = pkgroup_new(n_array_size(idx->arr) + 1, grp);
+-          n_array_push(idx->arr, gr);
+-          n_hash_insert(idx->ht, gr->name, gr);
++        const char *lang = n_array_nth(langs, i);
++        DBGF("   gr[%d of %d] %s\n", i, ngroups, groups[i]);
++        
++        if (n_str_eq(lang, "C")) {
++            if ((gr = n_hash_get(idx->ht, groups[i])) == NULL) {
++                gr = pkgroup_new(n_array_size(idx->arr) + 1, groups[i]);
++                n_array_push(idx->arr, gr);
++                n_hash_insert(idx->ht, gr->name, gr);
++            }
++            break;
+         }
+-        break;
+-      }
+     }
+     if (gr != NULL) {
+diff --git a/pm/rpm/rpmhdr.c b/pm/rpm/rpmhdr.c
+index 817803c..dd24be5 100644
+--- a/pm/rpm/rpmhdr.c
++++ b/pm/rpm/rpmhdr.c
+@@ -121,7 +121,6 @@ int pm_rpmhdr_get_raw_entry(Header h, int32_t tag, void *buf, int32_t *cnt)
+     }
+ #endif
+-#ifndef HAVE_RPM_5
+     if (tag == RPMTAG_GROUP && type == RPM_STRING_TYPE) { // build by old rpm
+         char **g;
+       
+@@ -132,7 +131,6 @@ int pm_rpmhdr_get_raw_entry(Header h, int32_t tag, void *buf, int32_t *cnt)
+         g[1] = NULL;
+         *(char ***)buf = g;
+     }
+-#endif
+     DBGF("%d type=%d, cnt=%d\n", tag, type, *cnt);
+     return 1;
index c8fcf48ff52329fbec37ac01e8137e035d41ccfc..16f3017044c236274365c17f1378cef58a3bd312 100644 (file)
@@ -15,7 +15,7 @@
 %define                ver_rpm         5.4.10
 
 %define                snap    rc7
-%define                rel     2%{?with_snap:.%{SNAP}}
+%define                rel     3%{?with_snap:.%{SNAP}}
 Summary:       RPM packages management helper tool
 Summary(hu.UTF-8):     RPM csomagkezelést segítő eszköz
 Summary(pl.UTF-8):     Pomocnicze narzędzie do zarządzania pakietami RPM
@@ -44,6 +44,7 @@ Patch1:               %{name}-config.patch
 Patch2:                %{name}-size-type.patch
 Patch3:                %{name}-Os-fail-workaround.patch
 Patch4:                %{name}-git.patch
+Patch5:                %{name}-inherited-group.patch
 URL:           http://poldek.pld-linux.org/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -207,6 +208,7 @@ Moduły języka Python dla poldka.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %{__rm} m4/libtool.m4 m4/lt*.m4
 
This page took 0.06603 seconds and 4 git commands to generate.