From: Michael Schroeder Date: Thu, 23 Feb 2012 14:48:40 +0000 (+0100) Subject: fix spelling of ENABLE_RPMDB_PUBKEY, read susetags pattern files X-Git-Tag: BASE-SuSE-Code-12_2-Branch~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fd9c06945047b73886ded64e42ad96007d31736;p=thirdparty%2Flibsolv.git fix spelling of ENABLE_RPMDB_PUBKEY, read susetags pattern files --- diff --git a/examples/solv.c b/examples/solv.c index dd3ff5eb..7d69028e 100644 --- a/examples/solv.c +++ b/examples/solv.c @@ -1206,7 +1206,7 @@ static Pool * read_sigs() { Pool *sigpool = pool_create(); -#if defined(ENABLE_RPMDB_PUBKEYS) +#if defined(ENABLE_RPMDB_PUBKEY) Repo *repo = repo_create(sigpool, "rpmdbkeys"); repo_add_rpmdb_pubkeys(repo, 0, 0); #endif @@ -1841,6 +1841,30 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos) fclose(fp); } } + filename = susetags_find(repo, "patterns", &filechksum, &filechksumtype); + if (filename) + { + if ((fp = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0) + { + char pbuf[256]; + while (fgets(pbuf, sizeof(pbuf), fp)) + { + int l = strlen(pbuf); + FILE *fp2; + if (l && pbuf[l - 1] == '\n') + pbuf[--l] = 0; + if (!*pbuf || *pbuf == '.' || strchr(pbuf, '/') != 0) + continue; + filename = susetags_find(repo, pbuf, &filechksum, &filechksumtype); + if (filename && (fp2 = curlfopen(cinfo, pool_tmpjoin(pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, &badchecksum)) != 0) + { + repo_add_susetags(repo, fp2, defvendor, 0, REPO_NO_INTERNALIZE); + fclose(fp2); + } + } + fclose(fp); + } + } repo_internalize(repo); data = repo_add_repodata(repo, 0); susetags_add_ext(repo, data);