while (fgets(buf + bufl, bufa - bufl, fp) > 0)
{
bufl += strlen(buf + bufl);
- if (bufl && buf[bufl - 1] != '\n')
+ if (!bufl)
+ continue;
+ if (buf[bufl - 1] != '\n')
{
if (bufa - bufl < 256)
{
}
continue;
}
- buf[--bufl] = 0;
+ buf[bufl - 1] = 0;
bufl = 0;
if (buf[0] != '@')
{
enum state sbtab[NUMSTATES];
Solvable *solvable;
Hashtable joinhash;
- Hashmask joinhashmask;
+ Hashval joinhashmask;
};
static inline const char *
}
static Hashtable
-joinhash_init(Repo *repo, Hashmask *hmp)
+joinhash_init(Repo *repo, Hashval *hmp)
{
- Hashmask hm = mkmask(repo->nsolvables);
+ Hashval hm = mkmask(repo->nsolvables);
Hashtable ht = solv_calloc(hm + 1, sizeof(*ht));
Hashval h, hh;
Solvable *s;
}
static Solvable *
-joinhash_lookup(Repo *repo, Hashtable ht, Hashmask hm, const char *fn, const char *distepoch)
+joinhash_lookup(Repo *repo, Hashtable ht, Hashval hm, const char *fn, const char *distepoch)
{
Hashval h, hh;
const char *p, *vrstart, *vrend;
return 0;
}
-static void
-set_sourcerpm(Repodata *data, Solvable *s, Id handle, const char *sourcerpm)
-{
- const char *p, *sevr, *sarch, *name, *evr;
- Pool *pool;
-
- p = strrchr(sourcerpm, '.');
- if (!p || strcmp(p, ".rpm") != 0)
- return;
- p--;
- while (p > sourcerpm && *p != '.')
- p--;
- if (*p != '.' || p == sourcerpm)
- return;
- sarch = p-- + 1;
- while (p > sourcerpm && *p != '-')
- p--;
- if (*p != '-' || p == sourcerpm)
- return;
- p--;
- while (p > sourcerpm && *p != '-')
- p--;
- if (*p != '-' || p == sourcerpm)
- return;
- sevr = p + 1;
- pool = s->repo->pool;
- if (!strcmp(sarch, "src.rpm"))
- repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, ARCH_SRC);
- else if (!strcmp(sarch, "nosrc.rpm"))
- repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, ARCH_NOSRC);
- else
- repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, pool_strn2id(pool, sarch, strlen(sarch) - 4, 1));
- evr = pool_id2str(pool, s->evr);
- if (evr && !strncmp(sevr, evr, sarch - sevr - 1) && evr[sarch - sevr - 1] == 0)
- repodata_set_void(data, handle, SOLVABLE_SOURCEEVR);
- else
- repodata_set_id(data, handle, SOLVABLE_SOURCEEVR, pool_strn2id(pool, sevr, sarch - sevr - 1, 1));
- name = pool_id2str(pool, s->name);
- if (name && !strncmp(sourcerpm, name, sevr - sourcerpm - 1) && name[sevr - sourcerpm - 1] == 0)
- repodata_set_void(data, handle, SOLVABLE_SOURCENAME);
- else
- repodata_set_id(data, handle, SOLVABLE_SOURCENAME, pool_strn2id(pool, sourcerpm, sevr - sourcerpm - 1, 1));
-}
-
-
static void XMLCALL
startElement(void *userData, const char *name, const char **atts)
{
repodata_set_poolstr(pd->data, pd->solvable - pool->solvables, SOLVABLE_LICENSE, str);
str = find_attr("sourcerpm", atts);
if (str && *str)
- set_sourcerpm(pd->data, pd->solvable, pd->solvable - pool->solvables, str);
+ repodata_set_sourcepkg(pd->data, pd->solvable - pool->solvables, str);
break;
}
case STATE_FILES: