public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Merge branch 'master' into f15
@ 2026-11-23  9:27 Panu Matilainen
  0 siblings, 0 replies; 4+ messages in thread
From: Panu Matilainen @ 2026-11-23  9:27 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : 59df4acec7e67667a870b4cfb85a9e1f184deeef
            Author : Panu Matilainen <pmatilai@redhat.com>
            Date   : 2011-06-10T12:51:02+03:00
            Stats  : +336/-2 in 7 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/59df4acec7e67667a870b4cfb85a9e1f184deeef?branch=pmatilai-v6

            Log:
            Merge branch 'master' into f15

* master: (3 commits)
  - fix crash if prep or changelog section in spec is empty (#706959) - fix crash on macro which undefines itself - fix script dependency generation with file 5.07 string changes (#712251)
  ...

---
diff --git a/rpm-4.9.0-debugedit-dwarf4.patch b/rpm-4.9.0-debugedit-dwarf4.patch
new file mode 100644
index 0000000..e10e1f1
--- /dev/null
+++ b/rpm-4.9.0-debugedit-dwarf4.patch
@@ -0,0 +1,130 @@
+--- rpm-4.9.0/tools/debugedit.c		2010-12-03 13:11:57.000000000 +0100
++++ rpm-4.9.0/tools/debugedit.c.jj	2011-05-25 18:49:53.151936963 +0200
+@@ -1,4 +1,4 @@ 
+-/* Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010 Red Hat, Inc.
++/* Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010, 2011 Red Hat, Inc.
+    Written by Alexander Larsson <alexl@redhat.com>, 2002
+    Based on code by Jakub Jelinek <jakub@redhat.com>, 2001.
+ 
+@@ -44,6 +44,10 @@ 
+ #include "tools/hashtab.h"
+ 
+ #define DW_TAG_partial_unit 0x3c
++#define DW_FORM_sec_offset 0x17
++#define DW_FORM_exprloc 0x18
++#define DW_FORM_flag_present 0x19
++#define DW_FORM_ref_sig8 0x20
+ 
+ char *base_dir = NULL;
+ char *dest_dir = NULL;
+@@ -220,6 +224,7 @@ static struct
+ #define DEBUG_STR	8
+ #define DEBUG_FRAME	9
+ #define DEBUG_RANGES	10
++#define DEBUG_TYPES	11
+     { ".debug_info", NULL, NULL, 0, 0, 0 },
+     { ".debug_abbrev", NULL, NULL, 0, 0, 0 },
+     { ".debug_line", NULL, NULL, 0, 0, 0 },
+@@ -231,6 +236,7 @@ static struct
+     { ".debug_str", NULL, NULL, 0, 0, 0 },
+     { ".debug_frame", NULL, NULL, 0, 0, 0 },
+     { ".debug_ranges", NULL, NULL, 0, 0, 0 },
++    { ".debug_types", NULL, NULL, 0, 0, 0 },
+     { NULL, NULL, NULL, 0, 0, 0 }
+   };
+ 
+@@ -323,7 +329,8 @@ no_memory:
+ 		goto no_memory;
+ 	    }
+ 	  form = read_uleb128 (ptr);
+-	  if (form == 2 || form > DW_FORM_indirect)
++	  if (form == 2
++	      || (form > DW_FORM_flag_present && form != DW_FORM_ref_sig8))
+ 	    {
+ 	      error (0, 0, "%s: Unknown DWARF DW_FORM_%d", dso->filename, form);
+ 	      htab_delete (h);
+@@ -352,7 +359,6 @@ static char *
+ canonicalize_path (const char *s, char *d)
+ {
+   char *rv = d;
+-  const char *sroot;
+   char *droot;
+ 
+   if (IS_DIR_SEPARATOR (*s))
+@@ -368,7 +374,6 @@ canonicalize_path (const char *s, char *
+ 	s++;
+     }
+   droot = d;
+-  sroot = s;
+ 
+   while (*s)
+     {
+@@ -495,7 +500,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
+     }
+ 
+   value = read_16 (ptr);
+-  if (value != 2 && value != 3)
++  if (value != 2 && value != 3 && value != 4)
+     {
+       error (0, 0, "%s: DWARF version %d unhandled", dso->filename,
+ 	     value);
+@@ -511,8 +516,8 @@ edit_dwarf2_line (DSO *dso, uint32_t off
+       return 1;
+     }
+ 
+-  opcode_base = ptr[4];
+-  ptr = dir = ptr + 4 + opcode_base;
++  opcode_base = ptr[4 + (value >= 4)];
++  ptr = dir = ptr + 4 + (value >= 4) + opcode_base;
+ 
+   /* dir table: */
+   value = 1;
+@@ -739,7 +744,8 @@ edit_attributes (DSO *dso, unsigned char
+ 	{
+ 	  if (t->attr[i].attr == DW_AT_stmt_list)
+ 	    {
+-	      if (form == DW_FORM_data4)
++	      if (form == DW_FORM_data4
++		  || form == DW_FORM_sec_offset)
+ 		{
+ 		  list_offs = do_read_32_relocated (ptr);
+ 		  found_list_offs = 1;
+@@ -841,6 +847,8 @@ edit_attributes (DSO *dso, unsigned char
+ 	      else
+ 		ptr += 4;
+ 	      break;
++	    case DW_FORM_flag_present:
++	      break;
+ 	    case DW_FORM_addr:
+ 	      ptr += ptr_size;
+ 	      break;
+@@ -855,10 +863,12 @@ edit_attributes (DSO *dso, unsigned char
+ 	      break;
+ 	    case DW_FORM_ref4:
+ 	    case DW_FORM_data4:
++	    case DW_FORM_sec_offset:
+ 	      ptr += 4;
+ 	      break;
+ 	    case DW_FORM_ref8:
+ 	    case DW_FORM_data8:
++	    case DW_FORM_ref_sig8:
+ 	      ptr += 8;
+ 	      break;
+ 	    case DW_FORM_sdata:
+@@ -887,6 +897,7 @@ edit_attributes (DSO *dso, unsigned char
+ 	      form = DW_FORM_block1;
+ 	      break;
+ 	    case DW_FORM_block:
++	    case DW_FORM_exprloc:
+ 	      len = read_uleb128 (ptr);
+ 	      form = DW_FORM_block1;
+ 	      assert (len < UINT_MAX);
+@@ -1190,7 +1201,7 @@ edit_dwarf2 (DSO *dso)
+ 		}
+ 
+ 	      cu_version = read_16 (ptr);
+-	      if (cu_version != 2 && cu_version != 3)
++	      if (cu_version != 2 && cu_version != 3 && cu_version != 4)
+ 		{
+ 		  error (0, 0, "%s: DWARF version %d unhandled", dso->filename,
+ 			 cu_version);

diff --git a/rpm-4.9.0-debuginfo-allnames.patch b/rpm-4.9.0-debuginfo-allnames.patch
new file mode 100644
index 0000000..125c85c
--- /dev/null
+++ b/rpm-4.9.0-debuginfo-allnames.patch
@@ -0,0 +1,55 @@
+--- rpm-4.9.0/scripts/find-debuginfo.sh	2011-02-19 07:57:21.000000000 +0100
++++ rpm-4.9.0/scripts/find-debuginfo.sh.orig	2011-02-19 08:50:23.000000000 +0100
+@@ -127,6 +127,23 @@ debug_link()
+   link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+ }
+ 
++# Provide .2, .3, ... symlinks to all filename instances of this build-id.
++make_id_dup_link()
++{
++  local id="$1" file="$2" idfile
++
++  local n=1
++  while true; do
++    idfile=".build-id/${id:0:2}/${id:2}.$n"
++    [ $# -eq 3 ] && idfile="${idfile}$3"
++    if [ ! -L "$RPM_BUILD_ROOT/usr/lib/debug/$idfile" ]; then
++      break
++    fi
++    n=$[$n+1]
++  done
++  debug_link "$file" "/$idfile"
++}
++
+ # Make a build-id symlink for id $1 with suffix $3 to file $2.
+ make_id_link()
+ {
+@@ -140,6 +157,8 @@ make_id_link()
+     return
+   fi
+ 
++  make_id_dup_link "$@"
++
+   [ $# -eq 3 ] && return 0
+ 
+   local other=$(readlink -m "$root_idfile")
+@@ -188,6 +207,9 @@ while read nlinks inum f; do
+   if [ $nlinks -gt 1 ]; then
+     eval linked=\$linked_$inum
+     if [ -n "$linked" ]; then
++      eval id=\$linkedid_$inum
++      make_id_dup_link "$id" "$dn/$(basename $f)"
++      make_id_dup_link "$id" "/usr/lib/debug$dn/$bn" .debug
+       link=$debugfn
+       get_debugfn "$linked"
+       echo "hard linked $link to $debugfn"
+@@ -202,6 +224,9 @@ while read nlinks inum f; do
+   echo "extracting debug info from $f"
+   id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
+ 			      -i -l "$SOURCEFILE" "$f") || exit
++  if [ $nlinks -gt 1 ]; then
++    eval linkedid_$inum=\$id
++  fi
+   if [ -z "$id" ]; then
+     echo >&2 "*** ${strict_error}: No build ID note found in $f"
+     $strict && exit 2

diff --git a/rpm-4.9.0-empty-changelog-crash.patch b/rpm-4.9.0-empty-changelog-crash.patch
new file mode 100644
index 0000000..f592cc8
--- /dev/null
+++ b/rpm-4.9.0-empty-changelog-crash.patch
@@ -0,0 +1,21 @@
+commit 78a6cf6fbf047c5bf0066df21792e4c9925d04a0
+Author: Michael Schroeder <mls@suse.de>
+Date:   Tue May 24 08:51:56 2011 +0300
+
+    Do not die on empty changelog section
+    
+    Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
+
+diff --git a/build/parseChangelog.c b/build/parseChangelog.c
+index 36a19c3..d4681cb 100644
+--- a/build/parseChangelog.c
++++ b/build/parseChangelog.c
+@@ -233,7 +233,7 @@ int parseChangelog(rpmSpec spec)
+ 	}
+     }
+ 
+-    if (addChangelog(spec->packages->header, sb)) {
++    if (sb && addChangelog(spec->packages->header, sb)) {
+ 	goto exit;
+     }
+     res = nextPart;

diff --git a/rpm-4.9.0-empty-prep-crash.patch b/rpm-4.9.0-empty-prep-crash.patch
new file mode 100644
index 0000000..40c5a98
--- /dev/null
+++ b/rpm-4.9.0-empty-prep-crash.patch
@@ -0,0 +1,21 @@
+commit 39800e901e2258685d1fc34e1e9a7b8a058e11ce
+Author: Michael Schroeder <mls@suse.de>
+Date:   Mon May 16 11:57:44 2011 +0300
+
+    Fix segfault on build with empty %prep section
+    
+    Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
+
+diff --git a/build/parsePrep.c b/build/parsePrep.c
+index c0508ec..9e61dde 100644
+--- a/build/parsePrep.c
++++ b/build/parsePrep.c
+@@ -504,7 +504,7 @@ int parsePrep(rpmSpec spec)
+ 	}
+     }
+ 
+-    for (ARGV_const_t lines = saveLines; *lines; lines++) {
++    for (ARGV_const_t lines = saveLines; lines && *lines; lines++) {
+ 	res = 0;
+ 	if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
+ 	    res = doSetupMacro(spec, *lines);

diff --git a/rpm-4.9.0-file-compat.patch b/rpm-4.9.0-file-compat.patch
new file mode 100644
index 0000000..9a2624e
--- /dev/null
+++ b/rpm-4.9.0-file-compat.patch
@@ -0,0 +1,39 @@
+commit db4905f51eb80b55c408e3a659bab6b4ec5d9e3b
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Fri Jun 10 12:08:45 2011 +0300
+
+    Adjust script detection rules to work with file >= 5.07 too (RhBug:712251)
+    - Somewhere between file 5.05 and 5.07 it started adding encoding
+      to script descriptions, eg "<mumble> script text executable" became
+      "<mumble> script, <encoding> text executable" breaking what had
+      been working for 10+ years in the case of old find-requires.
+    - Permit either comma or space after "script", this works for both
+      old and new file.
+
+diff --git a/autodeps/linux.req b/autodeps/linux.req
+index cf60bd9..b9a8f99 100644
+--- a/autodeps/linux.req
++++ b/autodeps/linux.req
+@@ -20,10 +20,11 @@ fi
+ # --- Grab the file manifest and classify files.
+ #filelist=`sed "s/['\"]/\\\&/g"`
+ filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
+-exelist=`echo $filelist | xargs -r file | grep -Ev ":.* (commands|script) " | \
++exelist=`echo $filelist | xargs -r file | \
++	grep -Ev ":.* (commands|script)[, ]" | \
+ 	grep ":.*executable" | cut -d: -f1`
+ scriptlist=`echo $filelist | xargs -r file | \
+-	grep -E ":.* (commands|script) " | cut -d: -f1`
++	grep -E ":.* (commands|script)[, ]" | cut -d: -f1`
+ liblist=`echo $filelist | xargs -r file | \
+ 	grep ":.*shared object" | cut -d : -f1`
+ 
+diff --git a/fileattrs/script.attr b/fileattrs/script.attr
+index 13b8ba0..79f4d73 100644
+--- a/fileattrs/script.attr
++++ b/fileattrs/script.attr
+@@ -1,3 +1,3 @@
+ %__script_requires	%{_rpmconfigdir}/script.req
+-%__script_magic		^.* script text.*$
++%__script_magic		^.* script[, ].*$
+ %__script_flags		exeonly

diff --git a/rpm-4.9.0-macro-self-undefine.patch b/rpm-4.9.0-macro-self-undefine.patch
new file mode 100644
index 0000000..0d998c3
--- /dev/null
+++ b/rpm-4.9.0-macro-self-undefine.patch
@@ -0,0 +1,35 @@
+commit f4c79584d01c6394544c86c122d2f32f77a1d02d
+Author: Michael Schroeder <mls@suse.de>
+Date:   Wed May 18 09:04:40 2011 +0300
+
+    Always copy macro source when expanding it
+    - A macro can undefine itself, and unless we grab a copy of it we'll
+      end up accessing already freed memory. Fixes a regression from
+      commit ebc4ceaaeb8bb59019f4635471b28eb5f3eaaaa6 which assumed
+      a copy is not always needed.
+    
+    Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
+
+diff --git a/rpmio/macro.c b/rpmio/macro.c
+index 8ea4819..d79ef18 100644
+--- a/rpmio/macro.c
++++ b/rpmio/macro.c
+@@ -1022,12 +1022,12 @@ expandMacro(MacroBuf mb, const char *src, size_t slen)
+     char *source = NULL;
+ 
+     /* Handle non-terminated substrings by creating a terminated copy */
+-    if (slen > 0) {
+-	source = xmalloc(slen + 1);
+-	strncpy(source, src, slen);
+-	source[slen] = '\0';
+-	s = source;
+-    }
++    if (!slen)
++	slen = strlen(src);
++    source = xmalloc(slen + 1);
++    strncpy(source, src, slen);
++    source[slen] = '\0';
++    s = source;
+ 
+     if (mb->buf == NULL) {
+ 	size_t blen = MACROBUFSIZ + strlen(s);

diff --git a/rpm.spec b/rpm.spec
index fb1c5a5..14dc357 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,10 +21,10 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}6%{?dist}
+Release: %{?snapver:0.%{snapver}.}9%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
-Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2
+Source0: http://rpm.org/releases/rpm-4.9.x/%{name}-%{srcver}.tar.bz2
 %if %{with int_bdb}
 Source1: db-%{bdbver}.tar.gz
 %endif
@@ -54,10 +54,21 @@ Patch104: rpm-4.9.0-fstate-verify.patch
 Patch105: rpm-4.9.0-fstate-deps.patch
 # Preferred color pkgs should be erased last
 Patch106: rpm-4.9.0-prefcolor-erase.patch
+# Fix crash on empty prep-section
+Patch107: rpm-4.9.0-empty-prep-crash.patch
+# Fix crash on empty changelog-section
+Patch108: rpm-4.9.0-empty-changelog-crash.patch
+# Fix crash on macro undefining itself
+Patch109: rpm-4.9.0-macro-self-undefine.patch
+# Fix breakage caused by file 5.07 string changes
+Patch110: rpm-4.9.0-file-compat.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
 Patch302: rpm-4.7.1-geode-i686.patch
+# To be upstreamed after rawhide-testdrive (#641377, #707677)
+Patch303: rpm-4.9.0-debugedit-dwarf4.patch
+Patch304: rpm-4.9.0-debuginfo-allnames.patch
 
 # Partially GPL/LGPL dual-licensed and some bits with BSD
 # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD 
@@ -227,9 +238,15 @@ packages on a system.
 %patch104 -p1 -b .fstate-verify
 %patch105 -p1 -b .fstate-deps
 %patch106 -p1 -b .prefcolor-erase
+%patch107 -p1 -b .empty-prep-crash
+%patch108 -p1 -b .empty-changelog-crash
+%patch109 -p1 -b .macro-self-undefine
+%patch110 -p1 -b .file-compat
 
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
+%patch303 -p1 -b .dwarf-4
+%patch304 -p1 -b .debuginfo-allnames
 
 %if %{with int_bdb}
 ln -s db-%{bdbver} db
@@ -321,6 +338,9 @@ make check
 %post libs -p /sbin/ldconfig
 %postun libs -p /sbin/ldconfig
 
+%post build-libs -p /sbin/ldconfig
+%postun build-libs -p /sbin/ldconfig
+
 %posttrans
 # XXX this is klunky and ugly, rpm itself should handle this
 dbstat=/usr/lib/rpm/rpmdb_stat
@@ -440,6 +460,19 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
+* Fri Jun 10 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-9
+- fix crash if prep or changelog section in spec is empty (#706959)
+- fix crash on macro which undefines itself
+- fix script dependency generation with file 5.07 string changes (#712251)
+
+* Thu May 26 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-8
+- add dwarf-4 support to debugedit (#707677)
+- generate build-id symlinks for all filenames sharing a build-id (#641377)
+
+* Thu Apr 07 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-7
+- add missing ldconfig calls to build-libs sub-package
+- fix source url
+
 * Thu Apr 07 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-6
 - revert the spec query change (#693338) for now, it breaks fedpkg
 

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

* [rpms/rpm] pmatilai-v6: Merge branch 'master' into f15
@ 2026-11-23  9:27 Panu Matilainen
  0 siblings, 0 replies; 4+ messages in thread
From: Panu Matilainen @ 2026-11-23  9:27 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : 0c490cbc1461ad305a7b77a7f118f6680af4f60b
            Author : Panu Matilainen <pmatilai@redhat.com>
            Date   : 2011-04-07T09:31:01+03:00
            Stats  : +7/-3 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/0c490cbc1461ad305a7b77a7f118f6680af4f60b?branch=pmatilai-v6

            Log:
            Merge branch 'master' into f15

* master:
  - revert the spec query change (#693338) for now, it breaks fedpkg

---
diff --git a/rpm.spec b/rpm.spec
index 2081b84..fb1c5a5 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}5%{?dist}
+Release: %{?snapver:0.%{snapver}.}6%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2
@@ -47,7 +47,7 @@ Patch101: rpm-4.9.0-sticky-elf.patch
 # Fix leaks on freeing a populated transaction set
 Patch102: rpm-4.9.0-rpmts-noref.patch
 # Only list packages that will be built on spec query (#693338)
-Patch103: rpm-4.9.0-specquery-pkgs.patch
+# Patch103: rpm-4.9.0-specquery-pkgs.patch
 # Verify some properties of replaced and wrong-colored files (#528383)
 Patch104: rpm-4.9.0-fstate-verify.patch
 # Take file state into account for file dependencies
@@ -222,7 +222,8 @@ packages on a system.
 %patch100 -p1 -b .manifest-fix
 %patch101 -p1 -b .sticky-elf
 %patch102 -p1 -b .rpmts-noref
-%patch103 -p1 -b .specquery-pkgs
+# this breaks fedpkg
+# %patch103 -p1 -b .specquery-pkgs
 %patch104 -p1 -b .fstate-verify
 %patch105 -p1 -b .fstate-deps
 %patch106 -p1 -b .prefcolor-erase
@@ -439,6 +440,9 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
+* Thu Apr 07 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-6
+- revert the spec query change (#693338) for now, it breaks fedpkg
+
 * Tue Apr 05 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-5
 - verify some properties of replaced and wrong-colored files (#528383)
 - only list packages that would be generated on spec query (#693338)

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

* [rpms/rpm] pmatilai-v6: Merge branch 'master' into f15
@ 2026-11-23  9:27 Panu Matilainen
  0 siblings, 0 replies; 4+ messages in thread
From: Panu Matilainen @ 2026-11-23  9:27 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 5d0960ecd763178077a5670cf05014ceb732086a
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2011-04-05T19:06:26+03:00
Stats  : +214/-1 in 6 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/5d0960ecd763178077a5670cf05014ceb732086a?branch=pmatilai-v6

Log:
Merge branch 'master' into f15

---
diff --git a/rpm-4.9.0-fstate-deps.patch b/rpm-4.9.0-fstate-deps.patch
new file mode 100644
index 0000000..a4f5050
--- /dev/null
+++ b/rpm-4.9.0-fstate-deps.patch
@@ -0,0 +1,51 @@
+commit 566a15c9c08aa593d05e2f55f1c171a48bc1b1bc
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Wed Mar 9 09:39:32 2011 +0200
+
+    Take file state into account for file dependencies
+    - Files which are not installed, have been replaced or are of wrong
+      color can not actually satisfy a dependency despite what the package's
+      file list says.
+    - This prevents breaking the system despite seemingly correct dependencies
+      in some situations, such as on multilib systems where a colored
+      files can appear to be shared between primary and secondary architecture
+      packages, but only the file from primary arch package is physically
+      present, and removing the primary arch package would remove the
+      file and silently break any dependencies on such files in practise.
+      Similarly replaced files become owned by the replacing package in
+      practise, so the original package whose files were replaced can no
+      longer satisfy dependency on those files.
+
+diff --git a/lib/depends.c b/lib/depends.c
+index 4daa512..69aecbb 100644
+--- a/lib/depends.c
++++ b/lib/depends.c
+@@ -345,12 +345,25 @@ static int rpmdbProvides(rpmts ts, depCache dcache, rpmds dep)
+ 	return rc;
+     }
+ 
+-    /* See if a filename dependency is a real file in some package */
++    /*
++     * See if a filename dependency is a real file in some package,
++     * taking file state into account: replaced, wrong colored and
++     * not installed files can not satisfy a dependency.
++     */
+     if (Name[0] == '/') {
+ 	mi = rpmtsPrunedIterator(ts, RPMDBI_BASENAMES, Name);
+ 	while ((h = rpmdbNextIterator(mi)) != NULL) {
+-	    rpmdsNotify(dep, "(db files)", rc);
+-	    break;
++	    int fs = RPMFILE_STATE_MISSING;
++	    struct rpmtd_s states;
++	    if (headerGet(h, RPMTAG_FILESTATES, &states, HEADERGET_MINMEM)) {
++		rpmtdSetIndex(&states, rpmdbGetIteratorFileNum(mi));
++		fs = rpmtdGetNumber(&states);
++		rpmtdFreeData(&states);
++	    }
++	    if (fs == RPMFILE_STATE_NORMAL || fs == RPMFILE_STATE_NETSHARED) {
++		rpmdsNotify(dep, "(db files)", rc);
++		break;
++	    }
+ 	}
+ 	rpmdbFreeIterator(mi);
+     }

diff --git a/rpm-4.9.0-fstate-verify.patch b/rpm-4.9.0-fstate-verify.patch
new file mode 100644
index 0000000..97026ed
--- /dev/null
+++ b/rpm-4.9.0-fstate-verify.patch
@@ -0,0 +1,41 @@
+commit ee0ae58b442c5f79967a0d0580144b5c84e0c888
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Wed Mar 9 10:25:29 2011 +0200
+
+    Verify some properties of replaced and wrong-colored files (RhBug:528383)
+    - We can't verify any properties of replaced files, but we can and
+      should still see if it exists at all.
+    - Files skipped due to wrong color are supposed to share some of
+      the attributes with the file that got actually installed, such
+      as permissions and whether it exists at all. Verify what we can
+      instead of silently ignoring.
+
+diff --git a/lib/verify.c b/lib/verify.c
+index 3be357d..46210bc 100644
+--- a/lib/verify.c
++++ b/lib/verify.c
+@@ -70,12 +70,22 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi,
+      */
+     switch (rpmfiFState(fi)) {
+     case RPMFILE_STATE_NETSHARED:
+-    case RPMFILE_STATE_REPLACED:
+     case RPMFILE_STATE_NOTINSTALLED:
+-    case RPMFILE_STATE_WRONGCOLOR:
+     case RPMFILE_STATE_MISSING:
+ 	return 0;
+ 	break;
++    case RPMFILE_STATE_REPLACED:
++	/* For replaced files we can only verify if it exists at all */
++	flags = RPMVERIFY_LSTATFAIL;
++	break;
++    case RPMFILE_STATE_WRONGCOLOR:
++	/*
++	 * Files with wrong color are supposed to share some attributes
++	 * with the actually installed file - verify what we can.
++	 */
++	flags &= ~(RPMVERIFY_FILEDIGEST | RPMVERIFY_FILESIZE |
++		   RPMVERIFY_MTIME | RPMVERIFY_RDEV);
++	break;
+     case RPMFILE_STATE_NORMAL:
+ 	break;
+     }

diff --git a/rpm-4.9.0-prefcolor-erase.patch b/rpm-4.9.0-prefcolor-erase.patch
new file mode 100644
index 0000000..1a4c763
--- /dev/null
+++ b/rpm-4.9.0-prefcolor-erase.patch
@@ -0,0 +1,46 @@
+commit 4a16d55f1f689ab06e8dd45c50b86e478a732367
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Tue Mar 8 13:28:32 2011 +0200
+
+    Preferred color pkgs should be erased last
+    - On install we need to queue preferred colored pkgs before others
+      to account for the way colored files get laid on disk. On erase,
+      we need to revert this for the same reason. Most of the time
+      dependencies take care of this, but the queue placement matters in
+      cases such as RhBug:680261 where the order is not dependency-driven.
+
+diff --git a/lib/order.c b/lib/order.c
+index 3b0849d..18fe05c 100644
+--- a/lib/order.c
++++ b/lib/order.c
+@@ -208,6 +208,8 @@ static void addQ(tsortInfo p, tsortInfo * qp, tsortInfo * rp,
+ 		rpm_color_t prefcolor)
+ {
+     tsortInfo q, qprev;
++    rpm_color_t pcolor = rpmteColor(p->te);
++    int tailcond;
+ 
+     /* Mark the package as queued. */
+     p->tsi_reqx = 1;
+@@ -218,13 +220,18 @@ static void addQ(tsortInfo p, tsortInfo * qp, tsortInfo * rp,
+ 	return;
+     }
+ 
+-    /* Find location in queue using metric tsi_qcnt. */
++    if (rpmteType(p->te) == TR_ADDED)
++	tailcond = (pcolor && pcolor != prefcolor);
++    else
++	tailcond = (pcolor && pcolor == prefcolor);
++
++    /* Find location in queue using metric tsi_qcnt and color. */
+     for (qprev = NULL, q = (*qp);
+ 	 q != NULL;
+ 	 qprev = q, q = q->tsi_suc)
+     {
+-	/* XXX Insure preferred color first. */
+-	if (rpmteColor(p->te) != prefcolor && rpmteColor(p->te) != rpmteColor(q->te))
++	/* Place preferred color towards queue head on install, tail on erase */
++	if (tailcond && (pcolor != rpmteColor(q->te)))
+ 	    continue;
+ 
+ 	if (q->tsi_qcnt <= p->tsi_qcnt)

diff --git a/rpm-4.9.0-rpmts-noref.patch b/rpm-4.9.0-rpmts-noref.patch
new file mode 100644
index 0000000..4951488
--- /dev/null
+++ b/rpm-4.9.0-rpmts-noref.patch
@@ -0,0 +1,30 @@
+commit 077d2c850cf0a719d7abacc3256168d60a4ec7bb
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Tue Apr 5 17:33:12 2011 +0300
+
+    Dont reference transaction set from transaction elements
+    - Elements referencing ts prevents rpmtsFree() from freeing anything
+      unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
+      from commit 8f7c2d7063df6d1057425d014ce4168d46c5e7d9.
+
+diff --git a/lib/rpmte.c b/lib/rpmte.c
+index 860b3f4..dfd7b6f 100644
+--- a/lib/rpmte.c
++++ b/lib/rpmte.c
+@@ -291,7 +291,6 @@ rpmte rpmteFree(rpmte te)
+ 	rpmfsFree(te->fs);
+ 	rpmpsFree(te->probs);
+ 	rpmteCleanDS(te);
+-	rpmtsFree(te->ts);
+ 
+ 	argvFree(te->collections);
+ 	argvFree(te->lastInCollectionsAny);
+@@ -308,7 +307,7 @@ rpmte rpmteNew(rpmts ts, Header h, rpmElementType type, fnpyKey key,
+ 	       rpmRelocation * relocs)
+ {
+     rpmte p = xcalloc(1, sizeof(*p));
+-    p->ts = rpmtsLink(ts);
++    p->ts = ts;
+     p->type = type;
+     addTE(p, h, key, relocs);
+     switch (type) {

diff --git a/rpm-4.9.0-specquery-pkgs.patch b/rpm-4.9.0-specquery-pkgs.patch
new file mode 100644
index 0000000..f0f7d89
--- /dev/null
+++ b/rpm-4.9.0-specquery-pkgs.patch
@@ -0,0 +1,23 @@
+commit 94fb6eed6a7a8957152035c3156974fc00bc4b42
+Author: Jindrich Novy <jnovy@redhat.com>
+Date:   Mon Apr 4 16:03:11 2011 +0200
+
+    Don't list packages which will not be created in spec query (RhBug:693338)
+    - particularly, while doing "rpm -q --specfile <a spec file>"
+
+diff --git a/build/spec.c b/build/spec.c
+index 6861753..353ae47 100644
+--- a/build/spec.c
++++ b/build/spec.c
+@@ -412,8 +412,10 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
+ 
+     res = 0;
+     if (qva->qva_source == RPMQV_SPECRPMS) {
+-	for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next)
++	for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
++	    if (pkg->fileList == NULL) continue;
+ 	    xx = qva->qva_showPackage(qva, ts, pkg->header);
++	}
+     } else {
+ 	xx = qva->qva_showPackage(qva, ts, spec->sourceHeader);
+     }

diff --git a/rpm.spec b/rpm.spec
index f25172e..2081b84 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}4%{?dist}
+Release: %{?snapver:0.%{snapver}.}5%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2
@@ -44,6 +44,16 @@ Patch4: rpm-4.8.1-use-gpg2.patch
 Patch100: rpm-4.9.0-manifest-fix.patch
 # Recognize elf executables with sticky bit as elf
 Patch101: rpm-4.9.0-sticky-elf.patch
+# Fix leaks on freeing a populated transaction set
+Patch102: rpm-4.9.0-rpmts-noref.patch
+# Only list packages that will be built on spec query (#693338)
+Patch103: rpm-4.9.0-specquery-pkgs.patch
+# Verify some properties of replaced and wrong-colored files (#528383)
+Patch104: rpm-4.9.0-fstate-verify.patch
+# Take file state into account for file dependencies
+Patch105: rpm-4.9.0-fstate-deps.patch
+# Preferred color pkgs should be erased last
+Patch106: rpm-4.9.0-prefcolor-erase.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
@@ -211,6 +221,11 @@ packages on a system.
 
 %patch100 -p1 -b .manifest-fix
 %patch101 -p1 -b .sticky-elf
+%patch102 -p1 -b .rpmts-noref
+%patch103 -p1 -b .specquery-pkgs
+%patch104 -p1 -b .fstate-verify
+%patch105 -p1 -b .fstate-deps
+%patch106 -p1 -b .prefcolor-erase
 
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
@@ -424,6 +439,13 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
+* Tue Apr 05 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-5
+- verify some properties of replaced and wrong-colored files (#528383)
+- only list packages that would be generated on spec query (#693338)
+- preferred color packages should be erased last (#680261)
+- fix leaks when freeing a populated transaction set
+- take file state into account for file dependencies
+
 * Tue Mar 22 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-4
 - fix classification of elf executables with sticky bit set (#689182)
 

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

* [rpms/rpm] pmatilai-v6: Merge branch 'master' into f15
@ 2026-11-23  9:27 Panu Matilainen
  0 siblings, 0 replies; 4+ messages in thread
From: Panu Matilainen @ 2026-11-23  9:27 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : ae27e7d914a2bff69cc7032e756a1eb713e8e5c8
            Author : Panu Matilainen <pmatilai@redhat.com>
            Date   : 2011-03-22T09:08:43+02:00
            Stats  : +34/-3 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/ae27e7d914a2bff69cc7032e756a1eb713e8e5c8?branch=pmatilai-v6

            Log:
            Merge branch 'master' into f15

* master: (3 commits)
  - fix classification of elf executables with sticky bit set (#689182)
  - also renumber manifest crash patch to reflect upstream status
  ...

---
diff --git a/rpm-4.9.0-sticky-elf.patch b/rpm-4.9.0-sticky-elf.patch
new file mode 100644
index 0000000..52b10f5
--- /dev/null
+++ b/rpm-4.9.0-sticky-elf.patch
@@ -0,0 +1,16 @@
+commit 6eba5dc468aa2d26ff80f9321e8d4d014279d506
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Tue Mar 22 08:36:35 2011 +0200
+
+    Fix classification of ELF binaries with sticky bit (RhBug:689182)
+
+diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr
+index fba180b..bc6ce83 100644
+--- a/fileattrs/elf.attr
++++ b/fileattrs/elf.attr
+@@ -1,4 +1,4 @@
+ %__elf_provides		%{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_requires		%{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+-%__elf_magic		^ELF (32|64)-bit.*$
++%__elf_magic		^(sticky )?ELF (32|64)-bit.*$
+ %__elf_flags		exeonly

diff --git a/rpm.spec b/rpm.spec
index d59a70e..2f2aad1 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -21,7 +21,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}2%{?dist}
+Release: %{?snapver:0.%{snapver}.}4%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2
@@ -42,6 +42,10 @@ Patch4: rpm-4.8.1-use-gpg2.patch
 Patch5: rpm-4.9.0-manifest-fix.patch
 
 # Patches already in upstream
+# Do not try to free and unallocated variable (#688091)
+Patch100: rpm-4.9.0-manifest-fix.patch
+# Recognize elf executables with sticky bit as elf
+Patch101: rpm-4.9.0-sticky-elf.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
@@ -208,6 +212,9 @@ packages on a system.
 %patch4 -p1 -b .use-gpg2
 %patch5 -p1 -b .manifest-fix
 
+%patch100 -p1 -b .manifest-fix
+%patch101 -p1 -b .sticky-elf
+
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
 
@@ -325,7 +332,6 @@ exit 0
 %{_bindir}/rpm2cpio
 %{_bindir}/rpmdb
 %{_bindir}/rpmkeys
-%{_bindir}/rpmsign
 %{_bindir}/rpmquery
 %{_bindir}/rpmverify
 
@@ -421,9 +427,15 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
-* Wed Mar 16 2011 Jindirch Novy <jnovy@redhat.com> - 4.9.0-2
+* Tue Mar 22 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-4
+- fix classification of elf executables with sticky bit set (#689182)
+
+* Wed Mar 16 2011 Jindirch Novy <jnovy@redhat.com> - 4.9.0-3
 - fix crash in package manifest check (#688091)
 
+* Fri Mar 04 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-2
+- fix duplicate rpmsign binary in rpm main package dragging in build-libs
+
 * Wed Mar 02 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-1
 - update to 4.9.0 final
 - drop upstreamed patches

diff --git a/rpm.spec b/rpm.spec
index f25172e..2f2aad1 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -38,6 +38,8 @@ Patch2: rpm-4.8.90-fedora-specspo.patch
 Patch3: rpm-4.8.0-no-man-dirs.patch
 # gnupg2 comes installed by default, avoid need to drag in gnupg too
 Patch4: rpm-4.8.1-use-gpg2.patch
+# do not try to free and unallocated variable (#688091)
+Patch5: rpm-4.9.0-manifest-fix.patch
 
 # Patches already in upstream
 # Do not try to free and unallocated variable (#688091)
@@ -208,6 +210,7 @@ packages on a system.
 %patch2 -p1 -b .fedora-specspo
 %patch3 -p1 -b .no-man-dirs
 %patch4 -p1 -b .use-gpg2
+%patch5 -p1 -b .manifest-fix
 
 %patch100 -p1 -b .manifest-fix
 %patch101 -p1 -b .sticky-elf

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

end of thread, other threads:[~2026-11-23  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:27 [rpms/rpm] pmatilai-v6: Merge branch 'master' into f15 Panu Matilainen
  -- strict thread matches above, loose matches on Subject: below --
2026-11-23  9:27 Panu Matilainen
2026-11-23  9:27 Panu Matilainen
2026-11-23  9:27 Panu Matilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox