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