Imported Upstream version 0.7.0
[platform/upstream/libsolv.git] / examples / solv / repoinfo.c
index e08d160..6273972 100644 (file)
 #if defined(ENABLE_DEBIAN) && defined(DEBIAN)
 #include "repo_deb.h"
 #endif
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
+
 
 #include "repoinfo.h"
 #include "repoinfo_cache.h"
 
-#if defined(SUSE) || defined(FEDORA)
+#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA)
 #include "repoinfo_config_yum.h"
 #endif
 #if defined(DEBIAN)
 #include "repoinfo_config_debian.h"
 #endif
-#if defined(MANDRIVA) || defined(MAGEIA)
+#if defined(MANDRIVA)
 #include "repoinfo_config_urpmi.h"
 #endif
 
@@ -76,7 +80,7 @@ free_repoinfos(struct repoinfo *repoinfos, int nrepoinfos)
       solv_free(cinfo->components);
     }
   solv_free(repoinfos);
-#if defined(SUSE) || defined(FEDORA)
+#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA)
   yum_substitute((Pool *)0, 0);                /* free data */
 #endif
 }
@@ -85,10 +89,10 @@ struct repoinfo *
 read_repoinfos(Pool *pool, int *nrepoinfosp)
 {
   struct repoinfo *repoinfos = 0;
-#if defined(SUSE) || defined(FEDORA)
+#if defined(SUSE) || defined(FEDORA) || defined(MAGEIA)
   repoinfos = read_repoinfos_yum(pool, nrepoinfosp);
 #endif
-#if defined(MANDRIVA) || defined(MAGEIA)
+#if defined(MANDRIVA)
   repoinfos = read_repoinfos_urpmi(pool, nrepoinfosp);
 #endif
 #if defined(DEBIAN)
@@ -110,6 +114,9 @@ read_installed_repo(struct repoinfo *cinfo, Pool *pool)
 #if defined(ENABLE_DEBIAN) && defined(DEBIAN)
   r = read_installed_debian(cinfo);
 #endif
+#ifdef SUSE
+  repo_add_autopattern(cinfo->repo, 0);
+#endif
   pool_set_installed(pool, cinfo->repo);
   return r;
 }
@@ -235,6 +242,9 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos)
 
       if ((!cinfo->autorefresh || cinfo->metadata_expire) && usecachedrepo(cinfo, 0, 0))
        {
+#ifdef SUSE
+         repo_add_autopattern(cinfo->repo, 0);
+#endif
          printf("repo '%s':", cinfo->alias);
          printf(" cached\n");
          continue;
@@ -268,6 +278,10 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos)
          cinfo->repo = 0;
          break;
        }
+#ifdef SUSE
+      if (cinfo->repo)
+        repo_add_autopattern(cinfo->repo, 0);
+#endif
     }
   if (sigpool)
     pool_free(sigpool);