Fix compilation on Fedora.
authorAles Kozumplik <akozumpl@redhat.com>
Tue, 24 Jan 2012 15:57:01 +0000 (16:57 +0100)
committerAles Kozumplik <akozumpl@redhat.com>
Tue, 24 Jan 2012 16:07:51 +0000 (17:07 +0100)
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.

examples/solv.c
tools/rpmdb2solv.c

index 7ba2749..01ea65a 100644 (file)
@@ -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;
index 85a9cc6..17895c8 100644 (file)
@@ -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)