summaryrefslogtreecommitdiff
path: root/lib/fsm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-12-11 09:54:29 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-12-11 09:54:29 +0200
commitf32e6c9d05db10122166d15694ad91a68268a9d5 (patch)
tree0bb8ab765379cab730764a46f01ee449c143dfae /lib/fsm.c
parent284de053fdbc7cd9de2614dc4af042d29abfd190 (diff)
downloadrpm-f32e6c9d05db10122166d15694ad91a68268a9d5.tar.gz
rpm-f32e6c9d05db10122166d15694ad91a68268a9d5.tar.bz2
rpm-f32e6c9d05db10122166d15694ad91a68268a9d5.zip
Avoid most of direct rpmfi accesses in dnlInitIterator()
- need to add an accessor function for fi->dil info
Diffstat (limited to 'lib/fsm.c')
-rw-r--r--lib/fsm.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index d5dfb475c..2c9c23251 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -307,22 +307,23 @@ void * dnlInitIterator(const FSM_t fsm,
if (dc) {
dnli->active = xcalloc(dc, sizeof(*dnli->active));
+ int fc = rpmfiFC(fi);
/* Identify parent directories not skipped. */
- for (i = 0; i < fi->fc; i++)
+ for (i = 0; i < fc; i++)
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++) {
+ for (i = 0; i < fc; i++) {
int dil;
size_t dnlen, bnlen;
- if (!S_ISDIR(fi->fmodes[i]))
+ if (!S_ISDIR(rpmfiFModeIndex(fi, i)))
continue;
dil = fi->dil[i];
- dnlen = strlen(fi->dnl[dil]);
- bnlen = strlen(fi->bnl[i]);
+ dnlen = strlen(rpmfiDNIndex(fi, dil));
+ bnlen = strlen(rpmfiBNIndex(fi, i));
for (j = 0; j < dc; j++) {
const char * dnl;
@@ -330,13 +331,13 @@ void * dnlInitIterator(const FSM_t fsm,
if (!dnli->active[j] || j == dil)
continue;
- dnl = fi->dnl[j];
+ dnl = rpmfiDNIndex(fi, j);
jlen = strlen(dnl);
if (jlen != (dnlen+bnlen+1))
continue;
- if (strncmp(dnl, fi->dnl[dil], dnlen))
+ if (strncmp(dnl, rpmfiDNIndex(fi, dil), dnlen))
continue;
- if (strncmp(dnl+dnlen, fi->bnl[i], bnlen))
+ if (strncmp(dnl+dnlen, rpmfiBNIndex(fi, i), bnlen))
continue;
if (dnl[dnlen+bnlen] != '/' || dnl[dnlen+bnlen+1] != '\0')
continue;
@@ -356,7 +357,7 @@ void * dnlInitIterator(const FSM_t fsm,
rpmlog(RPMLOG_DEBUG,
"========== Directories not explicitly included in package:\n");
}
- rpmlog(RPMLOG_DEBUG, "%10d %s\n", i, fi->dnl[i]);
+ rpmlog(RPMLOG_DEBUG, "%10d %s\n", i, rpmfiDNIndex(fi, i));
}
if (j)
rpmlog(RPMLOG_DEBUG, "==========\n");