solv example: add autopackages on SUSE systems
authorMichael Schroeder <mls@suse.de>
Fri, 6 Dec 2013 14:36:11 +0000 (15:36 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 6 Dec 2013 14:36:11 +0000 (15:36 +0100)
examples/solv.c

index 09258cb..d9b03a1 100644 (file)
@@ -84,6 +84,9 @@
 #include "repo_susetags.h"
 #include "repo_content.h"
 #endif
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
 #include "solv_xfopen.h"
 
 #ifdef FEDORA
@@ -2385,6 +2388,17 @@ addfileprovides(Pool *pool)
 
 #endif
 
+#ifdef SUSE
+static void
+add_autopackages(Pool *pool)
+{
+  int i;
+  Repo *repo;
+  FOR_REPOS(i, repo)
+    repo_add_autopattern(repo, 0);
+}
+#endif
+
 #if defined(SUSE) || defined(FEDORA)
 static void
 add_patchjobs(Pool *pool, Queue *job)
@@ -2928,6 +2942,9 @@ main(int argc, char **argv)
   if (pool->disttype == DISTTYPE_RPM)
     addfileprovides(pool);
 #endif
+#ifdef SUSE
+  add_autopackages(pool);
+#endif
   pool_createwhatprovides(pool);
 
   if (keyname)