From 9444f2d7f5bf0ffcd81fac0e04f0e831ac276306 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 18 Nov 2008 17:12:55 +0200 Subject: 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 --- lib/fsm.c | 9 +++++---- lib/rpmfi.c | 5 +---- lib/rpmfi_internal.h | 2 -- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/fsm.c b/lib/fsm.c index c760665ee..2892c07e1 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -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]]; diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 97ababed1..89f3c5064 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -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) { diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index 3eb7b524b..f76e68073 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -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). */ -- cgit v1.2.3