Imported Upstream version 0.7.27
[platform/upstream/libsolv.git] / examples / solv / repoinfo_download.c
index 5ba3014..2a26629 100644 (file)
@@ -13,6 +13,9 @@
 #include "repoinfo.h"
 #include "mirror.h"
 #include "checksig.h"
+#if defined(FEDORA) || defined(MAGEIA)
+#include "repoinfo_config_yum.h"
+#endif
 #include "repoinfo_download.h"
 
 static inline int
@@ -89,7 +92,7 @@ curlfopen(struct repoinfo *cinfo, const char *file, int uncompress, const unsign
          fclose(fp);
          if (!cinfo->baseurl)
            return 0;
-#ifdef FEDORA
+#if defined(FEDORA) || defined(MAGEIA)
          if (strchr(cinfo->baseurl, '$'))
            {
              char *b = yum_substitute(cinfo->repo->pool, cinfo->baseurl);
@@ -191,6 +194,10 @@ downloadpackage(Solvable *s, const char *loc)
       const char *datadir = repo_lookup_str(cinfo->repo, SOLVID_META, SUSETAGS_DATADIR);
       loc = pool_tmpjoin(s->repo->pool, datadir ? datadir : "suse", "/", loc);
     }
+  else if (cinfo->type == TYPE_PLAINDIR)
+    {
+     return fopen(loc, "r");
+    }
 #endif
   chksumtype = 0;
   chksum = solvable_lookup_bin_checksum(s, SOLVABLE_CHECKSUM, &chksumtype);