summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2011-03-23 15:58:39 +0100
committerMichael Schroeder <mls@suse.de>2011-03-23 15:58:39 +0100
commit2f35865fae7dfa98055e658ddc292cca584ced58 (patch)
tree227e80b2766ffcbe8ab51b7550c2ea179050e235 /ext
parente670a733cb4059485b0963984d75528589281f72 (diff)
downloadlibsolv-2f35865fae7dfa98055e658ddc292cca584ced58.tar.gz
libsolv-2f35865fae7dfa98055e658ddc292cca584ced58.tar.bz2
libsolv-2f35865fae7dfa98055e658ddc292cca584ced58.zip
- add repo_add_debdb() helper
Diffstat (limited to 'ext')
-rw-r--r--ext/repo_deb.c16
-rw-r--r--ext/repo_deb.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/ext/repo_deb.c b/ext/repo_deb.c
index 2c0574b..d2d31e3 100644
--- a/ext/repo_deb.c
+++ b/ext/repo_deb.c
@@ -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;
diff --git a/ext/repo_deb.h b/ext/repo_deb.h
index ff19536..ded3675 100644
--- a/ext/repo_deb.h
+++ b/ext/repo_deb.h
@@ -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);