- fix _install_langs behavior (#489235)

- fix recording of file states into rpmdb on install
This commit is contained in:
Panu Matilainen 2009-03-09 13:08:01 +00:00
parent fc85648d1e
commit e15b00592e
3 changed files with 99 additions and 1 deletions

View File

@ -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);

View File

@ -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++) {

View File

@ -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)