public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - fix _install_langs behavior (#489235)
Date: Mon, 23 Nov 2026 09:25:43 GMT	[thread overview]
Message-ID: <179542594360.1.16796902919068052394.rpms-rpm-e15b00592e46@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : e15b00592e46a7c9a2e62166fe41a4571d4185d2
            Author : Panu Matilainen <pmatilai@fedoraproject.org>
            Date   : 2009-03-09T13:08:01+00:00
            Stats  : +99/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/e15b00592e46a7c9a2e62166fe41a4571d4185d2?branch=pmatilai-v6

            Log:
            - fix _install_langs behavior (#489235)
- fix recording of file states into rpmdb on install

---
diff --git a/rpm-4.7.0-beta1-fstates.patch b/rpm-4.7.0-beta1-fstates.patch
new file mode 100644
index 0000000..d4e7b07
--- /dev/null
+++ b/rpm-4.7.0-beta1-fstates.patch
@@ -0,0 +1,68 @@
+commit 2b4507d852ac8469608bef2ce8e219d76b0c543e
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Mon Mar 9 14:48:47 2009 +0200
+
+    Fix RPMTAG_FILESTATES in rpmdb
+    - sizeof(rpmfileState) != sizeof(char), and char is what goes to headers
+      resulting in some pretty weird states despite being correct on disk
+    - add rpm_fstate_t type for the header presentation of states and
+      use where appropriate
+
+diff --git a/lib/psm.c b/lib/psm.c
+index 112d344..b493b33 100644
+--- a/lib/psm.c
++++ b/lib/psm.c
+@@ -1417,11 +1417,11 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
+ 	    rpm_time_t installTime = (rpm_time_t) time(NULL);
+ 	    rpmfs fs = rpmteGetFileStates(psm->te);
+ 	    rpm_count_t fc = rpmfsFC(fs);
+-	    rpmfileState * fileStates = rpmfsGetStates(fs);
++	    rpm_fstate_t * fileStates = rpmfsGetStates(fs);
+ 	    Header h = rpmteHeader(psm->te);
+ 
+ 	    if (fileStates != NULL && fc > 0) {
+-		headerPutChar(h, RPMTAG_FILESTATES, (char *) fileStates, fc);
++		headerPutChar(h, RPMTAG_FILESTATES, fileStates, fc);
+ 	    }
+ 
+ 	    headerPutUint32(h, RPMTAG_INSTALLTIME, &installTime, 1);
+diff --git a/lib/rpmte.c b/lib/rpmte.c
+index 130c1d9..bda5411 100644
+--- a/lib/rpmte.c
++++ b/lib/rpmte.c
+@@ -988,7 +988,7 @@ rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix)
+     return RPMFILE_STATE_MISSING;
+ }
+ 
+-rpmfileState * rpmfsGetStates(rpmfs fs)
++rpm_fstate_t * rpmfsGetStates(rpmfs fs)
+ {
+     return fs->states;
+ }
+diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h
+index 5706d56..3ce4112 100644
+--- a/lib/rpmte_internal.h
++++ b/lib/rpmte_internal.h
+@@ -36,10 +36,12 @@ struct sharedFileInfo_s {
+     int otherFileNum;
+ };
+ 
++typedef char rpm_fstate_t;
++
+ struct rpmfs_s {
+     unsigned int fc;
+ 
+-    rpmfileState * states;
++    rpm_fstate_t * states;
+     rpmFileAction * actions;	/*!< File disposition(s). */
+ 
+     sharedFileInfo replaced;	/*!< (TR_ADDED) to be replaced files in the rpmdb */
+@@ -106,7 +108,7 @@ rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix);
+  * May return NULL
+  */
+ RPM_GNUC_INTERNAL
+-rpmfileState * rpmfsGetStates(rpmfs fs);
++rpm_fstate_t * rpmfsGetStates(rpmfs fs);
+ 
+ RPM_GNUC_INTERNAL
+ rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix);

diff --git a/rpm-4.7.0-beta1-installangs.patch b/rpm-4.7.0-beta1-installangs.patch
new file mode 100644
index 0000000..0c63555
--- /dev/null
+++ b/rpm-4.7.0-beta1-installangs.patch
@@ -0,0 +1,22 @@
+commit cdcbd324fe41cd729434576200593c0fbda44a19
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Mon Mar 9 14:57:46 2009 +0200
+
+    Unbreak %_install_langs handling (rhbz#489235)
+    - using rpmfiFLangs() in skipFiles() broke the %_install_langs logic,
+      causing all files to be skipped if install langs, eek
+
+diff --git a/lib/transaction.c b/lib/transaction.c
+index 2940634..25a147a 100644
+--- a/lib/transaction.c
++++ b/lib/transaction.c
+@@ -488,7 +488,8 @@ static void skipFiles(const rpmts ts, rpmte p)
+ 	/*
+ 	 * Skip i18n language specific files.
+ 	 */
+-	if (ts->installLangs != NULL && (flangs = rpmfiFLangs(fi)) != NULL) {
++	flangs = (ts->installLangs != NULL) ? rpmfiFLangs(fi) : NULL;
++	if (flangs != NULL && *flangs != '\0') {
+ 	    const char *l, *le;
+ 	    char **lang;
+ 	    for (lang = ts->installLangs; *lang != NULL; lang++) {

diff --git a/rpm.spec b/rpm.spec
index ad3074e..76805ab 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -25,7 +25,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: 0.%{snapver}.2%{?dist}
+Release: 0.%{snapver}.3%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -44,6 +44,8 @@ Patch3: rpm-4.6.0-fedora-specspo.patch
 
 # Patches already in upstream
 Patch200: rpm-4.7.0-beta1-srcrpm-macros.patch
+Patch201: rpm-4.7.0-beta1-fstates.patch
+Patch202: rpm-4.7.0-beta1-installangs.patch
 
 # These are not yet upstream
 Patch300: rpm-4.7.0-extra-provides.patch
@@ -185,6 +187,8 @@ that will manipulate RPM packages and databases.
 %patch3 -p1 -b .fedora-specspo
 
 %patch200 -p1 -b .srcrpm-macros
+%patch201 -p1 -b .fstates
+%patch202 -p1 -b .installangs
 
 %patch300 -p1 -b .extra-prov
 
@@ -391,6 +395,10 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Mon Mar 09 2009 Panu Matilainen <pmatilai@redhat.com> - 4.7.0-0.beta1.3
+- fix _install_langs behavior (#489235)
+- fix recording of file states into rpmdb on install
+
 * Sun Mar 08 2009 Panu Matilainen <pmatilai@redhat.com> - 4.7.0-0.beta1.2
 - load macros before creating directories on src.rpm install (#489104)
 

                 reply	other threads:[~2026-11-23  9:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179542594360.1.16796902919068052394.rpms-rpm-e15b00592e46@fedoraproject.org \
    --to=pmatilai@fedoraproject.org \
    --cc=git-commits@fedoraproject.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox