Move ->actions from rpmfi to rpmfs

and adjust all code using it
also "revert" a4e345455d
 "Move file action calculations to rpmfiNew() where possible"
This commit is contained in:
Florian Festi 2008-12-03 10:39:48 +01:00
parent 9c9410dc7a
commit 395b5cffd5
9 changed files with 119 additions and 117 deletions

View File

@ -15,6 +15,7 @@
#include "lib/cpio.h"
#include "lib/fsm.h"
#include "lib/rpmfi_internal.h" /* rpmfiFSM() */
#include "lib/rpmte_internal.h" /* rpmfs */
#include "lib/signature.h"
#include "lib/rpmlead.h"
#include "build/buildio.h"
@ -30,10 +31,11 @@ static rpmRC cpio_doio(FD_t fdo, Header h, CSA_t csa,
rpmts ts = rpmtsCreate();
rpmfi fi = csa->cpioList;
rpmte te = NULL;
rpmfs fs = NULL;
char *failedFile = NULL;
FD_t cfd;
rpmRC rc = RPMRC_OK;
int xx;
int xx, i;
{ char *fmode = rpmExpand(fmodeMacro, NULL);
if (!(fmode && fmode[0] == 'w'))
@ -48,6 +50,15 @@ static rpmRC cpio_doio(FD_t fdo, Header h, CSA_t csa,
/* make up a transaction element for passing to fsm */
rpmtsAddInstallElement(ts, h, NULL, 0, NULL);
te = rpmtsElement(ts, 0);
fs = rpmteGetFileStates(te);
fi = rpmfiInit(fi, 0);
while ((i = rpmfiNext(fi)) >= 0) {
if (rpmfiFFlags(fi) & RPMFILE_GHOST)
rpmfsSetAction(fs, i, FA_SKIP);
else
rpmfsSetAction(fs, i, FA_COPYOUT);
}
xx = fsmSetup(rpmfiFSM(fi), FSM_PKGBUILD, ts, te, fi, cfd,
&csa->cpioArchiveSize, &failedFile);

View File

@ -292,6 +292,7 @@ void * dnlInitIterator(const FSM_t fsm,
{
rpmfi fi = fsmGetFi(fsm);
rpmfs fs = rpmteGetFileStates(fsmGetTe(fsm));
DNLI_t dnli;
int i, j;
@ -307,7 +308,7 @@ void * dnlInitIterator(const FSM_t fsm,
/* Identify parent directories not skipped. */
for (i = 0; i < fi->fc; i++)
if (!XFA_SKIPPING(fi->actions[i])) dnli->active[fi->dil[i]] = 1;
if (!XFA_SKIPPING(rpmfsGetAction(fs, i))) dnli->active[fi->dil[i]] = 1;
/* Exclude parent directories that are explicitly included. */
for (i = 0; i < fi->fc; i++) {
@ -459,11 +460,11 @@ static int saveHardLink(FSM_t fsm)
return 1;
/* Here come the bits, time to choose a non-skipped file name. */
{ rpmfi fi = fsmGetFi(fsm);
{ rpmfs fs = rpmteGetFileStates(fsmGetTe(fsm));
for (j = fsm->li->linksLeft - 1; j >= 0; j--) {
ix = fsm->li->filex[j];
if (ix < 0 || XFA_SKIPPING(fi->actions[ix]))
if (ix < 0 || XFA_SKIPPING(rpmfsGetAction(fs, ix)))
continue;
break;
}
@ -639,7 +640,7 @@ static int fsmMapPath(FSM_t fsm)
rpmte te = fsmGetTe(fsm);
rpmfs fs = rpmteGetFileStates(te);
/* XXX these should use rpmfiFFlags() etc */
fsm->action = (fi->actions ? fi->actions[i] : FA_UNKNOWN);
fsm->action = rpmfsGetAction(fs, i);
fsm->fflags = (fi->fflags ? fi->fflags[i] : RPMFILE_NONE);
/* src rpms have simple base name in payload. */

View File

@ -322,6 +322,14 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
goto exit;
}
{
/* set all files to be installed */
rpmfs fs = rpmteGetFileStates(te);
int i;
unsigned int fc = rpmfiFC(fi);
for (i=0; i<fc; i++) rpmfsSetAction(fs, i, FA_CREATE);
}
psm = rpmpsmNew(ts, te, fi);
psm->goal = PSM_PKGINSTALL;
@ -1403,11 +1411,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);
char * fileStates = rpmfsGetStates(fs);
rpmfileState * fileStates = rpmfsGetStates(fs);
Header h = rpmteHeader(psm->te);
if (fileStates != NULL && fc > 0) {
headerPutChar(h, RPMTAG_FILESTATES, fileStates, fc);
headerPutChar(h, RPMTAG_FILESTATES, (char *) fileStates, fc);
}
headerPutUint32(h, RPMTAG_INSTALLTIME, &installTime, 1);

View File

@ -456,24 +456,6 @@ const char * rpmfiFLangs(rpmfi fi)
return flangs;
}
rpmFileAction rpmfiFAction(rpmfi fi)
{
rpmFileAction action;
if (fi != NULL && fi->actions != NULL && fi->i >= 0 && fi->i < fi->fc) {
action = fi->actions[fi->i];
} else {
action = FA_UNKNOWN;
}
return action;
}
void rpmfiSetFAction(rpmfi fi, rpmFileAction action)
{
if (fi != NULL && fi->actions != NULL && fi->i >= 0 && fi->i < fi->fc) {
fi->actions[fi->i] = action;
}
}
int rpmfiNext(rpmfi fi)
{
int i = -1;
@ -747,12 +729,11 @@ static char **duparray(char ** src, int size)
* @param ts transaction set
* @param fi transaction element file info
* @param origH package header
* @param actions file dispositions
* @return header with relocated files
*/
static
Header relocateFileList(const rpmts ts, rpmfi fi,
Header origH, rpmFileAction * actions)
Header origH)
{
rpmte p = rpmtsRelocateElement(ts);
static int _printed = 0;
@ -849,8 +830,7 @@ assert(p != NULL);
}
}
/* XXX actions check prevents problem from being appended twice. */
if (!valid && !allowBadRelocate && actions) {
if (!valid && !allowBadRelocate) {
rpmps ps = rpmtsProblems(ts);
rpmpsAppend(ps, RPMPROB_BADRELOCATE,
rpmteNEVRA(p), rpmteKey(p),
@ -1035,20 +1015,17 @@ dColors[j] |= fColors[i];
break;
}
}
if (actions) {
actions[i] = FA_SKIPNSTATE;
rpmlog(RPMLOG_DEBUG, "excluding %s %s\n",
ftstring(ft), fn);
}
rpmfsSetAction(rpmteGetFileStates(p), i, FA_SKIPNSTATE);
rpmlog(RPMLOG_DEBUG, "excluding %s %s\n",
ftstring(ft), fn);
continue;
}
/* Relocation on full paths only, please. */
if (fnlen != len) continue;
if (actions)
rpmlog(RPMLOG_DEBUG, "relocating %s to %s\n",
fn, relocations[j].newPath);
rpmlog(RPMLOG_DEBUG, "relocating %s to %s\n",
fn, relocations[j].newPath);
nrelocated++;
strcpy(fn, relocations[j].newPath);
@ -1122,9 +1099,8 @@ dColors[j] |= fColors[i];
(void) rpmCleanPath(t);
rstrcat(&t, "/");
if (actions)
rpmlog(RPMLOG_DEBUG,
"relocating directory %s to %s\n", dirNames[i], t);
rpmlog(RPMLOG_DEBUG,
"relocating directory %s to %s\n", dirNames[i], t);
free(dirNames[i]);
dirNames[i] = t;
nrelocated++;
@ -1245,7 +1221,6 @@ fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, fi->Type, fi->fc);
fi->fn = _free(fi->fn);
fi->apath = _free(fi->apath);
fi->actions = _free(fi->actions);
fi->replacedSizes = _free(fi->replacedSizes);
fi->h = headerFree(fi->h);
@ -1365,19 +1340,6 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags)
if (!(flags & RPMFI_NOFILECAPS))
_hgfi(h, RPMTAG_FILECAPS, &td, defFlags, fi->fcaps);
/* For build and src.rpm's the file actions are known at this point */
fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
if (isBuild) {
for (int i = 0; i < fi->fc; i++) {
int ghost = fi->fflags[i] & RPMFILE_GHOST;
fi->actions[i] = ghost ? FA_SKIP : FA_COPYOUT;
}
} else if (isSource) {
for (int i = 0; i < fi->fc; i++) {
fi->actions[i] = FA_CREATE;
}
}
if (!(flags & RPMFI_NOFILELINKTOS)) {
fi->flinkcache = strcacheNew();
fi->flinks = cacheTag(fi->flinkcache, h, RPMTAG_FILELINKTOS);
@ -1438,7 +1400,7 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags)
Header foo;
/* FIX: fi-digests undefined */
foo = relocateFileList(ts, fi, h, fi->actions);
foo = relocateFileList(ts, fi, h);
fi->h = headerFree(fi->h);
fi->h = headerLink(foo);
foo = headerFree(foo);
@ -1461,19 +1423,14 @@ fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, Type, (fi ? fi->fc : 0));
rpmfi rpmfiUpdateState(rpmfi fi, rpmts ts, rpmte p)
{
rpmFileAction * actions = fi->actions;
rpmte savep;
fi->actions = NULL;
/* FIX: fi->actions is NULL */
fi = rpmfiFree(fi);
savep = rpmtsSetRelocateElement(ts, p);
fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER);
(void) rpmtsSetRelocateElement(ts, savep);
free(fi->actions);
fi->actions = actions;
p->fi = fi;
return fi;
}

View File

@ -336,20 +336,6 @@ const char * rpmfiFCaps(rpmfi fi);
*/
const char * rpmfiFLangs(rpmfi fi);
/** \ingroup rpmfi
* Return current file action from file info set.
* @param fi file info set
* @return current file action
*/
rpmFileAction rpmfiFAction(rpmfi fi);
/** \ingroup rpmfi
* Set current file action on file info set.
* @param fi file info set
* @param action file action
*/
void rpmfiSetFAction(rpmfi fi, rpmFileAction action);
/** \ingroup rpmfi
* Return next file iterator index.
* @param fi file info set

View File

@ -75,7 +75,6 @@ struct rpmfi_s {
rpmfiFlags fiflags; /*!< file info set control flags */
headerGetFlags scareFlags; /*!< headerGet flags wrt scareMem */
/*-----------------------------*/
rpmFileAction * actions; /*!< File disposition(s). */
struct fingerPrint_s * fps; /*!< File fingerprint(s). */
pgpHashAlgo digestalgo; /*!< File checksum algorithm */

View File

@ -756,6 +756,8 @@ rpmfs rpmfsNew(unsigned int fc) {
fs->fc = fc;
fs->replaced = NULL;
fs->states = NULL;
fs->actions = xmalloc(fc * sizeof(*fs->actions));
memset(fs->actions, FA_UNKNOWN, fc * sizeof(*fs->actions));
fs->numReplaced = fs->allocatedReplaced = 0;
return fs;
}
@ -763,6 +765,8 @@ rpmfs rpmfsNew(unsigned int fc) {
rpmfs rpmfsFree(rpmfs fs) {
fs->replaced = _free(fs->replaced);
fs->states = _free(fs->states);
fs->actions = _free(fs->actions);
fs = _free(fs);
return fs;
}
@ -827,3 +831,21 @@ rpmfileState * rpmfsGetStates(rpmfs fs)
{
return fs->states;
}
rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix)
{
rpmFileAction action;
if (fs->actions != NULL && ix < fs->fc) {
action = fs->actions[ix];
} else {
action = FA_UNKNOWN;
}
return action;
}
void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action)
{
if (fs->actions != NULL && ix < fs->fc) {
fs->actions[ix] = action;
}
}

View File

@ -93,6 +93,7 @@ struct rpmfs_s {
unsigned int fc;
rpmfileState * states;
rpmFileAction * actions; /*!< File disposition(s). */
sharedFileInfo replaced; /*!< (TR_ADDED) to be replaced files in the rpmdb */
int numReplaced;
@ -121,7 +122,7 @@ int rpmteMarkFailed(rpmte te, rpmts ts);
RPM_GNUC_INTERNAL
int rpmteHaveTransScript(rpmte te, rpmTag tag);
RPM_GNUC_INTERNAL
//RPM_GNUC_INTERNAL
rpmfs rpmteGetFileStates(rpmte te);
RPM_GNUC_INTERNAL
@ -154,5 +155,12 @@ rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix);
RPM_GNUC_INTERNAL
rpmfileState * rpmfsGetStates(rpmfs fs);
RPM_GNUC_INTERNAL
rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix);
//RPM_GNUC_INTERNAL
void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action);
#endif /* _RPMTE_INTERNAL_H */

View File

@ -60,6 +60,8 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi,
rpm_color_t oFColor, FColor;
char * altNEVR = NULL;
rpmps ps;
unsigned int fx = rpmfiFX(fi);
rpmfs fs = rpmteGetFileStates(p);
altNEVR = headerGetNEVRA(otherHeader, NULL);
@ -74,7 +76,7 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi,
isCfgFile = ((rpmfiFFlags(otherFi) | rpmfiFFlags(fi)) & RPMFILE_CONFIG);
if (XFA_SKIPPING(rpmfiFAction(fi)))
if (XFA_SKIPPING(rpmfsGetAction(fs, fx)))
return 0;
if (rpmfiCompare(otherFi, fi)) {
@ -84,10 +86,10 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi,
/* Resolve file conflicts to prefer Elf64 (if not forced). */
if (tscolor != 0 && FColor != 0 && FColor != oFColor) {
if (oFColor & prefcolor) {
rpmfiSetFAction(fi, FA_SKIPCOLOR);
rpmfsSetAction(fs, fx, FA_SKIPCOLOR);
rConflicts = 0;
} else if (FColor & prefcolor) {
rpmfiSetFAction(fi, FA_CREATE);
rpmfsSetAction(fs, fx, FA_CREATE);
rConflicts = 0;
}
}
@ -101,7 +103,7 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi,
}
/* Save file identifier to mark as state REPLACED. */
if ( !(isCfgFile || XFA_SKIPPING(rpmfiFAction(fi))) ) {
if ( !(isCfgFile || XFA_SKIPPING(rpmfsGetAction(fs, fx))) ) {
if (!beingRemoved)
rpmfsAddReplaced(rpmteGetFileStates(p), rpmfiFX(fi),
headerGetInstance(otherHeader),
@ -114,7 +116,7 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi,
int skipMissing =
((rpmtsFlags(ts) & RPMTRANS_FLAG_ALLFILES) ? 0 : 1);
rpmFileAction action = rpmfiDecideFate(otherFi, fi, skipMissing);
rpmfiSetFAction(fi, action);
rpmfsSetAction(fs, fx, action);
}
rpmfiSetFReplacedSize(fi, rpmfiFSize(otherFi));
@ -135,6 +137,8 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
int i, j;
rpm_color_t tscolor = rpmtsColor(ts);
rpm_color_t prefcolor = rpmtsPrefColor(ts);
rpmfs fs = rpmteGetFileStates(p);
rpmfs otherFs;
ps = rpmtsProblems(ts);
fi = rpmfiInit(fi, 0);
@ -150,7 +154,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
struct rpmffi_s * recs;
int numRecs;
if (XFA_SKIPPING(rpmfiFAction(fi)))
if (XFA_SKIPPING(rpmfsGetAction(fs, i)))
continue;
fn = rpmfiFN(fi);
@ -199,6 +203,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
otherFileNum = -1; /* keep gcc quiet */
otherFi = NULL;
otherTe = NULL;
otherFs = NULL;
for (otherPkgNum = j - 1; otherPkgNum >= 0; otherPkgNum--) {
struct fingerPrint_s * otherFps;
@ -207,6 +212,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
otherTe = recs[otherPkgNum].p;
otherFi = rpmteFI(otherTe);
otherFileNum = recs[otherPkgNum].fileno;
otherFs = rpmteGetFileStates(otherTe);
/* Added packages need only look at other added packages. */
if (rpmteType(p) == TR_ADDED && rpmteType(otherTe) != TR_ADDED)
@ -218,7 +224,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
(void) rpmfiSetFX(otherFi, otherFileNum);
/* XXX Happens iff fingerprint for incomplete package install. */
if (rpmfiFAction(otherFi) != FA_UNKNOWN);
if (rpmfsGetAction(otherFs, otherFileNum) != FA_UNKNOWN);
break;
}
@ -235,7 +241,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
if (otherPkgNum < 0) {
/* XXX is this test still necessary? */
rpmFileAction action;
if (rpmfiFAction(fi) != FA_UNKNOWN)
if (rpmfsGetAction(fs, i) != FA_UNKNOWN)
break;
if (rpmfiConfigConflict(fi)) {
/* Here is a non-overlapped pre-existing config file. */
@ -244,7 +250,7 @@ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi)
} else {
action = FA_CREATE;
}
rpmfiSetFAction(fi, action);
rpmfsSetAction(fs, i, action);
break;
}
@ -258,20 +264,20 @@ assert(otherFi != NULL);
if (tscolor != 0) {
if (FColor & prefcolor) {
/* ... last file of preferred colour is installed ... */
if (!XFA_SKIPPING(rpmfiFAction(fi))) {
if (!XFA_SKIPPING(rpmfsGetAction(fs, i))) {
/* XXX static helpers are order dependent. Ick. */
if (strcmp(fn, "/usr/sbin/libgcc_post_upgrade")
&& strcmp(fn, "/usr/sbin/glibc_post_upgrade"))
rpmfiSetFAction(otherFi, FA_SKIPCOLOR);
rpmfsSetAction(otherFs, otherFileNum, FA_SKIPCOLOR);
}
rpmfiSetFAction(fi, FA_CREATE);
rpmfsSetAction(fs, i, FA_CREATE);
rConflicts = 0;
} else
if (oFColor & prefcolor) {
/* ... first file of preferred colour is installed ... */
if (XFA_SKIPPING(rpmfiFAction(fi)))
rpmfiSetFAction(otherFi, FA_CREATE);
rpmfiSetFAction(fi, FA_SKIPCOLOR);
if (XFA_SKIPPING(rpmfsGetAction(fs, i)))
rpmfsSetAction(otherFs, otherFileNum, FA_CREATE);
rpmfsSetAction(fs, i, FA_SKIPCOLOR);
rConflicts = 0;
}
done = 1;
@ -292,31 +298,31 @@ assert(otherFi != NULL);
/* Here is an overlapped pre-existing config file. */
rpmFileAction action;
action = (FFlags & RPMFILE_NOREPLACE) ? FA_ALTNAME : FA_SKIP;
rpmfiSetFAction(fi, action);
rpmfsSetAction(fs, i, action);
} else {
if (!done)
rpmfiSetFAction(fi, FA_CREATE);
rpmfsSetAction(fs, i, FA_CREATE);
}
} break;
case TR_REMOVED:
if (otherPkgNum >= 0) {
assert(otherFi != NULL);
/* Here is an overlapped added file we don't want to nuke. */
if (rpmfiFAction(otherFi) != FA_ERASE) {
assert(otherFi != NULL);
/* Here is an overlapped added file we don't want to nuke. */
if (rpmfsGetAction(otherFs, otherFileNum) != FA_ERASE) {
/* On updates, don't remove files. */
rpmfiSetFAction(fi, FA_SKIP);
rpmfsSetAction(fs, i, FA_SKIP);
break;
}
/* Here is an overlapped removed file: skip in previous. */
rpmfiSetFAction(otherFi, FA_SKIP);
rpmfsSetAction(otherFs, otherFileNum, FA_SKIP);
}
if (XFA_SKIPPING(rpmfiFAction(fi)))
if (XFA_SKIPPING(rpmfsGetAction(fs, i)))
break;
if (rpmfiFState(fi) != RPMFILE_STATE_NORMAL)
break;
if (!(S_ISREG(FMode) && (FFlags & RPMFILE_CONFIG))) {
rpmfiSetFAction(fi, FA_ERASE);
rpmfsSetAction(fs, i, FA_ERASE);
break;
}
@ -328,18 +334,18 @@ assert(otherFi != NULL);
unsigned char fdigest[diglen];
if (!rpmDoDigest(algo, fn, 0, fdigest, NULL) &&
memcmp(digest, fdigest, diglen)) {
rpmfiSetFAction(fi, FA_BACKUP);
rpmfsSetAction(fs, i, FA_BACKUP);
break;
}
}
}
rpmfiSetFAction(fi, FA_ERASE);
rpmfsSetAction(fs, i, FA_ERASE);
break;
}
/* Update disk space info for a file. */
rpmtsUpdateDSI(ts, fiFps->entry->dev, rpmfiFSize(fi),
rpmfiFReplacedSize(fi), fixupSize, rpmfiFAction(fi));
rpmfiFReplacedSize(fi), fixupSize, rpmfsGetAction(fs, i));
}
ps = rpmpsFree(ps);
@ -388,7 +394,7 @@ static int ensureOlder(rpmts ts,
* @param ts transaction set
* @param fi file info set
*/
static void skipFiles(const rpmts ts, rpmfi fi)
static void skipFiles(const rpmts ts, rpmte p)
{
rpm_color_t tscolor = rpmtsColor(ts);
rpm_color_t FColor;
@ -401,6 +407,8 @@ static void skipFiles(const rpmts ts, rpmfi fi)
char * dff;
int dc;
int i, j, ix;
rpmfi fi = rpmteFI(p);
rpmfs fs = rpmteGetFileStates(p);
if (!noDocs)
noDocs = rpmExpandNumeric("%{_excludedocs}");
@ -428,7 +436,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
drc[ix]++;
/* Don't bother with skipped files */
if (XFA_SKIPPING(rpmfiFAction(fi))) {
if (XFA_SKIPPING(rpmfsGetAction(fs, i))) {
drc[ix]--; dff[ix] = 1;
continue;
}
@ -437,7 +445,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
FColor = rpmfiFColor(fi);
if (tscolor && FColor && !(tscolor & FColor)) {
drc[ix]--; dff[ix] = 1;
rpmfiSetFAction(fi, FA_SKIPCOLOR);
rpmfsSetAction(fs, i, FA_SKIPCOLOR);
continue;
}
@ -477,7 +485,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
if (nsp && *nsp) {
drc[ix]--; dff[ix] = 1;
rpmfiSetFAction(fi, FA_SKIPNETSHARED);
rpmfsSetAction(fs, i, FA_SKIPNETSHARED);
continue;
}
@ -500,7 +508,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
}
if (*lang == NULL) {
drc[ix]--; dff[ix] = 1;
rpmfiSetFAction(fi, FA_SKIPNSTATE);
rpmfsSetAction(fs, i, FA_SKIPNSTATE);
continue;
}
}
@ -510,7 +518,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
*/
if (noConfigs && (rpmfiFFlags(fi) & RPMFILE_CONFIG)) {
drc[ix]--; dff[ix] = 1;
rpmfiSetFAction(fi, FA_SKIPNSTATE);
rpmfsSetAction(fs, i, FA_SKIPNSTATE);
continue;
}
@ -519,7 +527,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
*/
if (noDocs && (rpmfiFFlags(fi) & RPMFILE_DOC)) {
drc[ix]--; dff[ix] = 1;
rpmfiSetFAction(fi, FA_SKIPNSTATE);
rpmfsSetAction(fs, i, FA_SKIPNSTATE);
continue;
}
}
@ -553,7 +561,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
const char * fdn, * fbn;
rpm_mode_t fFMode;
if (XFA_SKIPPING(rpmfiFAction(fi)))
if (XFA_SKIPPING(rpmfsGetAction(fs, i)))
continue;
fFMode = rpmfiFMode(fi);
@ -571,7 +579,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
if (strncmp(fbn, bn, bnlen))
continue;
rpmlog(RPMLOG_DEBUG, "excluding directory %s\n", dn);
rpmfiSetFAction(fi, FA_SKIPNSTATE);
rpmfsSetAction(fs, i, FA_SKIPNSTATE);
break;
}
}
@ -664,6 +672,7 @@ void checkInstalledFiles(rpmts ts, fingerPrintCache fpc)
rpmps ps;
rpmte p;
rpmfi fi;
rpmfs fs;
rpmfi otherFi=NULL;
int j;
int xx;
@ -716,7 +725,7 @@ void checkInstalledFiles(rpmts ts, fingerPrintCache fpc)
headerGet(h, RPMTAG_FILESTATES, &ostates, hgflags);
oldDir = NULL;
/* loop over all intersting files in that package */
/* loop over all interesting files in that package */
do {
int gotRecs;
struct rpmffi_s * recs;
@ -747,6 +756,7 @@ void checkInstalledFiles(rpmts ts, fingerPrintCache fpc)
for (j=0; (j<numRecs)&&gotRecs; j++) {
p = recs[j].p;
fi = rpmteFI(p);
fs = rpmteGetFileStates(p);
/* Determine the fate of each file. */
switch (rpmteType(p)) {
@ -762,7 +772,7 @@ void checkInstalledFiles(rpmts ts, fingerPrintCache fpc)
if (!beingRemoved) {
rpmfiSetFX(fi, recs[j].fileno);
if (*rpmtdGetChar(&ostates) == RPMFILE_STATE_NORMAL)
rpmfiSetFAction(fi, FA_SKIP);
rpmfsSetAction(fs, recs[j].fileno, FA_SKIP);
}
break;
}
@ -1089,7 +1099,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
numAdded++;
/* Skip netshared paths, not our i18n files, and excluded docs */
if (fc > 0)
skipFiles(ts, fi);
skipFiles(ts, p);
break;
case TR_REMOVED:
numRemoved++;
@ -1139,7 +1149,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
struct rpmffi_s ffi;
ffi.p = p;
ffi.fileno = i;
if (XFA_SKIPPING(rpmfiFAction(fi)))
if (XFA_SKIPPING(rpmfsGetAction(rpmteGetFileStates(p), i)))
continue;
rpmFpHashAddEntry(ts->ht, fi->fps + i, ffi);
}
@ -1163,7 +1173,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
(void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0);
if (fi != NULL) /* XXX lclint */
while ((i = rpmfiNext(fi)) >= 0) {
if (XFA_SKIPPING(rpmfiFAction(fi)))
if (XFA_SKIPPING(rpmfsGetAction(rpmteGetFileStates(p), i)))
continue;
fpLookupSubdir(ts->ht, newht, fpc, p, i);
}