for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
{
unsigned int j;
- printf("%s has %d keys, %d schemata", data->location ? data->location : "**EMBED**", data->nkeys, data->nschemata);
+ printf("%s has %d keys, %d schemata\n", data->location ? data->location : "**EMBED**", data->nkeys, data->nschemata);
for (j = 1; j < data->nkeys; j++)
- printf("\n %s (type %s size %d storage %d)", id2str(repo->pool, data->keys[j].name), id2str(repo->pool, data->keys[j].type), data->keys[j].size, data->keys[j].storage);
+ printf(" %s (type %s size %d storage %d)\n", id2str(repo->pool, data->keys[j].name), id2str(repo->pool, data->keys[j].type), data->keys[j].size, data->keys[j].storage);
+ if (data->localpool)
+ printf(" localpool has %d strings, size is %d\n", data->spool.nstrings, data->spool.sstrings);
+ if (data->dirpool.ndirs)
+ printf(" localpool has %d directories\n", data->dirpool.ndirs);
printf("\n");
}
printf("\n");
repo = repo_create(pool, argc != 1 ? argv[1] : "<stdin>");
if (repo_add_solv(repo, stdin))
printf("could not read repository\n");
- dump_repodata (repo);
+ printf("pool contains %d strings, %d rels, string size is %d\n", pool->ss.nstrings, pool->nrels, pool->ss.sstrings);
+ dump_repodata(repo);
printf("repo contains %d solvables\n", repo->nsolvables);
for (i = repo->start, n = 1; i < repo->end; i++)
{
#define TAG_CONFLICTNAME 1054
#define TAG_CONFLICTVERSION 1055
#define TAG_OBSOLETENAME 1090
+#define TAG_FILEDEVICES 1095
+#define TAG_FILEINODES 1096
#define TAG_PROVIDEFLAGS 1112
#define TAG_PROVIDEVERSION 1113
#define TAG_OBSOLETEFLAGS 1114
{
Id entry, did;
int i, fszc;
- unsigned int *fkb, *fn, *fsz, *fm;
+ unsigned int *fkb, *fn, *fsz, *fm, *fino;
+ unsigned int inotest[256], inotestok;
+ if (!fc)
+ return;
fsz = headint32array(rpmhead, TAG_FILESIZES, &fszc);
if (!fsz || fc != fszc)
{
sat_free(fm);
return;
}
+ fino = headint32array(rpmhead, TAG_FILEINODES, &fszc);
+ if (!fino || fc != fszc)
+ {
+ sat_free(fsz);
+ sat_free(fm);
+ sat_free(fino);
+ return;
+ }
+ inotestok = 0;
+ if (fc < sizeof(inotest))
+ {
+ memset(inotest, 0, sizeof(inotest));
+ for (i = 0; i < fc; i++)
+ {
+ int off, bit;
+ if (fsz[i] == 0 || !S_ISREG(fm[i]))
+ continue;
+ off = (fino[i] >> 5) & (sizeof(inotest)/sizeof(*inotest) - 1);
+ bit = 1 << (fino[i] & 31);
+ if ((inotest[off] & bit) != 0)
+ break;
+ inotest[off] |= bit;
+ }
+ if (i == fc)
+ inotestok = 1;
+ }
+ if (!inotestok)
+ {
+ unsigned int *fdev = headint32array(rpmhead, TAG_FILEDEVICES, &fszc);
+ unsigned int *fx, j;
+ unsigned int mask, hash, hh;
+ if (!fdev || fc != fszc)
+ {
+ sat_free(fsz);
+ sat_free(fm);
+ sat_free(fdev);
+ sat_free(fino);
+ return;
+ }
+ mask = fc;
+ while ((mask & (mask - 1)) != 0)
+ mask = mask & (mask - 1);
+ mask <<= 2;
+ if (mask > sizeof(inotest)/sizeof(*inotest))
+ fx = sat_calloc(mask, sizeof(unsigned int));
+ else
+ {
+ fx = inotest;
+ memset(fx, 0, mask * sizeof(unsigned int));
+ }
+ mask--;
+ for (i = 0; i < fc; i++)
+ {
+ if (fsz[i] == 0 || !S_ISREG(fm[i]))
+ continue;
+ hash = (fino[i] + fdev[i] * 31) & mask;
+ hh = 7;
+ while ((j = fx[hash]) != 0)
+ {
+ if (fino[j - 1] == fino[i] && fdev[j - 1] == fdev[i])
+ {
+ fsz[i] = 0; /* kill entry */
+ break;
+ }
+ hash = (hash + hh++) & mask;
+ }
+ if (!j)
+ fx[hash] = i + 1;
+ }
+ if (fx != inotest)
+ sat_free(fx);
+ sat_free(fdev);
+ }
+ sat_free(fino);
fn = sat_calloc(dic, sizeof(unsigned int));
fkb = sat_calloc(dic, sizeof(unsigned int));
for (i = 0; i < fc; i++)
if (di[i] >= dic)
continue;
fn[di[i]]++;
- /* does not consider hard links. tough luck. */
fkb[di[i]] += fsz[i] / 1024 + 1;
}
sat_free(fsz);
int bnc, dnc, dic;
int i, j;
struct filefilter *ff;
+#if 0
char *fn = 0;
int fna = 0;
+#endif
if (!repodata)
return olddeps;
}
if (j == sizeof(filefilters)/sizeof(*filefilters))
continue;
+#if 0
j = strlen(bn[i]) + strlen(dn[di[i]]) + 1;
if (j > fna)
{
}
strcpy(fn, dn[di[i]]);
strcat(fn, bn[i]);
-#if 0
olddeps = repo_addid_dep(repo, olddeps, str2id(pool, fn, 1), SOLVABLE_FILEMARKER);
#endif
if (repodata)
repodata_add_dirstr(repodata, entry, SOLVABLE_FILELIST, did, bn[i]);
}
}
+#if 0
if (fn)
sat_free(fn);
+#endif
sat_free(bn);
sat_free(dn);
sat_free(di);