Remove useless default flags and action fields from rpmfi
- fi->actions is always allocated so fi->action is never used for anything - fi->flags is just as unused and unnecessary
This commit is contained in:
parent
f41bd90c2a
commit
9444f2d7f5
|
@ -14,7 +14,7 @@
|
|||
#include "lib/cpio.h"
|
||||
#include "lib/fsm.h"
|
||||
#define fsmUNSAFE fsmStage
|
||||
#include "lib/rpmfi_internal.h" /* XXX fi->apath, fi->action... */
|
||||
#include "lib/rpmfi_internal.h" /* XXX fi->apath, ... */
|
||||
#include "lib/misc.h" /* XXX unameToUid() and gnameToGid() */
|
||||
|
||||
#include "debug.h"
|
||||
|
@ -152,7 +152,7 @@ mapInitIterator(rpmts ts, rpmfi fi)
|
|||
iter = xcalloc(1, sizeof(*iter));
|
||||
iter->ts = rpmtsLink(ts, RPMDBG_M("mapIterator"));
|
||||
iter->fi = rpmfiLink(fi, RPMDBG_M("mapIterator"));
|
||||
iter->reverse = (rpmteType(fi->te) == TR_REMOVED && fi->action != FA_COPYOUT);
|
||||
iter->reverse = (rpmteType(fi->te) == TR_REMOVED);
|
||||
iter->i = (iter->reverse ? (fi->fc - 1) : 0);
|
||||
iter->isave = iter->i;
|
||||
return iter;
|
||||
|
@ -626,8 +626,9 @@ static int fsmMapPath(FSM_t fsm)
|
|||
|
||||
i = fsm->ix;
|
||||
if (fi && i >= 0 && i < fi->fc) {
|
||||
fsm->action = (fi->actions ? fi->actions[i] : fi->action);
|
||||
fsm->fflags = (fi->fflags ? fi->fflags[i] : fi->flags);
|
||||
/* XXX these should use rpmfiFFlags() etc */
|
||||
fsm->action = (fi->actions ? fi->actions[i] : FA_UNKNOWN);
|
||||
fsm->fflags = (fi->fflags ? fi->fflags[i] : RPMFILE_NONE);
|
||||
|
||||
/* src rpms have simple base name in payload. */
|
||||
fsm->dirName = fi->dnl[fi->dil[i]];
|
||||
|
|
|
@ -388,7 +388,7 @@ rpmFileAction rpmfiFAction(rpmfi fi)
|
|||
if (fi != NULL && fi->actions != NULL && fi->i >= 0 && fi->i < fi->fc) {
|
||||
action = fi->actions[fi->i];
|
||||
} else {
|
||||
action = fi ? fi->action : FA_UNKNOWN;
|
||||
action = FA_UNKNOWN;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
|
@ -1290,9 +1290,6 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags)
|
|||
|
||||
_hgfi(h, RPMTAG_FILECAPS, &td, defFlags, fi->fcaps);
|
||||
|
||||
fi->action = FA_UNKNOWN;
|
||||
fi->flags = 0;
|
||||
|
||||
/* For build and src.rpm's the file actions are known at this point */
|
||||
fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
|
||||
if (isBuild) {
|
||||
|
|
|
@ -81,8 +81,6 @@ struct rpmfi_s {
|
|||
rpmfiFlags fiflags; /*!< file info set control flags */
|
||||
headerGetFlags scareFlags; /*!< headerGet flags wrt scareMem */
|
||||
/*-----------------------------*/
|
||||
rpmfileAttrs flags; /*!< File flags (default). */
|
||||
rpmFileAction action; /*!< File disposition (default). */
|
||||
rpmFileAction * actions; /*!< File disposition(s). */
|
||||
struct fingerPrint_s * fps; /*!< File fingerprint(s). */
|
||||
|
||||
|
|
Loading…
Reference in New Issue