From: Ales Kozumplik Date: Tue, 24 Jan 2012 15:57:01 +0000 (+0100) Subject: Fix compilation on Fedora. X-Git-Tag: BASE-SuSE-Code-12_2-Branch~187^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c29144158049f981cfe5fd3f5aa0d76bb508ee7e;p=thirdparty%2Flibsolv.git Fix compilation on Fedora. if ENABLED_SUSEREPO is disabled, repo_add_products() is not part of the libsolv_ext. This fails linking for rpmdb2solv.c. Also treat unused-variable warnings occurring with the conditional blocks. --- diff --git a/examples/solv.c b/examples/solv.c index 7ba2749a..01ea65aa 100644 --- a/examples/solv.c +++ b/examples/solv.c @@ -1611,8 +1611,10 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos) const char *filename; const unsigned char *filechksum; Id filechksumtype; +#ifdef ENABLE_SUSEREPO const char *descrdir; int defvendor; +#endif struct stat stb; Pool *sigpool = 0; Repodata *data; diff --git a/tools/rpmdb2solv.c b/tools/rpmdb2solv.c index 85a9cc63..17895c8f 100644 --- a/tools/rpmdb2solv.c +++ b/tools/rpmdb2solv.c @@ -58,7 +58,9 @@ main(int argc, char **argv) const char *root = 0; const char *basefile = 0; const char *refname = 0; +#ifdef ENABLE_SUSEREPO char *proddir = 0; +#endif char *outfile = 0; /* @@ -84,7 +86,9 @@ main(int argc, char **argv) percent = 1; break; case 'p': +#ifdef ENABLE_SUSEREPO proddir = optarg; +#endif break; case 'x': extrapool = 1; @@ -143,6 +147,7 @@ main(int argc, char **argv) if (!nopacks) repo_add_rpmdb(repo, ref, root, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE | (percent ? RPMDB_REPORT_PROGRESS : 0)); +#ifdef ENABLE_SUSEREPO if (proddir && *proddir) { char *buf = proddir; @@ -163,7 +168,7 @@ main(int argc, char **argv) if (buf != proddir) solv_free(buf); } - +#endif repodata_internalize(data); if (ref)