rpms/rpm/devel rpm-4.7.0-beta1-fstates.patch, NONE, 1.1 rpm-4.7.0-beta1-installangs.patch, NONE, 1.1 rpm.spec, 1.336, 1.337

Panu Matilainen pmatilai at fedoraproject.org
Mon Mar 9 13:08:31 UTC 2009


Author: pmatilai

Update of /cvs/pkgs/rpms/rpm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16764

Modified Files:
	rpm.spec 
Added Files:
	rpm-4.7.0-beta1-fstates.patch 
	rpm-4.7.0-beta1-installangs.patch 
Log Message:
- fix _install_langs behavior (#489235)
- fix recording of file states into rpmdb on install


rpm-4.7.0-beta1-fstates.patch:

--- NEW FILE rpm-4.7.0-beta1-fstates.patch ---
commit 2b4507d852ac8469608bef2ce8e219d76b0c543e
Author: Panu Matilainen <pmatilai at 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);

rpm-4.7.0-beta1-installangs.patch:

--- NEW FILE rpm-4.7.0-beta1-installangs.patch ---
commit cdcbd324fe41cd729434576200593c0fbda44a19
Author: Panu Matilainen <pmatilai at 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++) {


Index: rpm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/rpm.spec,v
retrieving revision 1.336
retrieving revision 1.337
diff -u -r1.336 -r1.337
--- rpm.spec	8 Mar 2009 09:52:55 -0000	1.336
+++ rpm.spec	9 Mar 2009 13:08:01 -0000	1.337
@@ -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 @@
 
 # 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 @@
 %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 @@
 %doc doc/librpm/html/*
 
 %changelog
+* Mon Mar 09 2009 Panu Matilainen <pmatilai at 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 at redhat.com> - 4.7.0-0.beta1.2
 - load macros before creating directories on src.rpm install (#489104)
 




More information about the fedora-extras-commits mailing list