Imported Upstream version 0.6.23
[platform/upstream/libsolv.git] / examples / solv / repoinfo_system_rpm.c
index b385d72..4926ecd 100644 (file)
@@ -27,7 +27,8 @@
 # define PRODUCTS_PATH "/etc/products.d"
 #endif
 #ifdef ENABLE_APPDATA
-# define APPDATA_PATH "/usr/share/appdata"
+# define APPDATA_PATH "/usr/share/metainfo"
+# define APPDATA_LEGACY_PATH "/usr/share/appdata"
 #endif
 
 static void
@@ -101,6 +102,12 @@ read_installed_rpm(struct repoinfo *cinfo)
       fprintf(stderr, "appdata reading failed: %s\n", pool_errstr(pool));
       return 0;
     }
+#elif defined(ENABLE_APPDATA) && defined(APPDATA_LEGACY_PATH)
+  if (repo_add_appdata_dir(repo, APPDATA_LEGACY_PATH, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE | REPO_USE_ROOTDIR))
+    {
+      fprintf(stderr, "appdata reading from legacy dir failed: %s\n", pool_errstr(pool));
+      return 0;
+    }
 #endif
   ofp = fopen(calc_cachepath(repo, 0, 0), "r");
   if (repo_add_rpmdb_reffp(repo, ofp, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE | REPO_USE_ROOTDIR))