- add repo_add_debdb() helper
authorMichael Schroeder <mls@suse.de>
Wed, 23 Mar 2011 14:58:39 +0000 (15:58 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 23 Mar 2011 14:58:39 +0000 (15:58 +0100)
ext/repo_deb.c
ext/repo_deb.h

index 2c0574b..d2d31e3 100644 (file)
@@ -412,6 +412,22 @@ repo_add_debpackages(Repo *repo, FILE *fp, int flags)
 }
 
 void
+repo_add_debdb(Repo *repo, const char *rootdir, int flags)
+{
+  FILE *fp;
+  const char *path = "/var/lib/dpkg/status";
+  if (rootdir)
+    path = pool_tmpjoin(repo->pool, rootdir, path, 0);
+  if ((fp = fopen(path, "r")) == 0)
+    {
+      perror(path);
+      exit(1);
+    }
+  repo_add_debpackages(repo, fp, flags);
+  fclose(fp);
+}
+
+void
 repo_add_debs(Repo *repo, const char **debs, int ndebs, int flags)
 {
   Pool *pool = repo->pool;
index ff19536..ded3675 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 extern void repo_add_debpackages(Repo *repo, FILE *fp, int flags);
+extern void repo_add_debdb(Repo *repo, const char *rootdir, int flags);
 extern void repo_add_debs(Repo *repo, const char **debs, int ndebs, int flags);
 extern Id repo_add_deb(Repo *repo, const char *deb, int flags);