]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
- add repo_add_rpm() and repo_add_deb()
authorMichael Schroeder <mls@suse.de>
Tue, 1 Mar 2011 16:17:12 +0000 (17:17 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 1 Mar 2011 16:17:12 +0000 (17:17 +0100)
ext/repo_deb.c
ext/repo_deb.h
ext/repo_rpmdb.c
ext/repo_rpmdb.h

index bad3101ee76f30a0a4b910407221756f1222f445..841b580272d5f24cd7d7dadf843024c3a9d8d3e7 100644 (file)
@@ -583,3 +583,14 @@ repo_add_debs(Repo *repo, const char **debs, int ndebs, int flags)
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);
 }
+
+Id
+repo_add_deb(Repo *repo, const char *deb, int flags)
+{
+  int end = repo->end;
+  repo_add_debs(repo, &deb, 1, flags);
+  if (end == repo->end)
+    return 0;
+  else
+    return repo->end - 1;
+}
index dd79ab7fe21c9fef3171bba4ef33750ff428a5c6..ff19536f9f715e2bdb2f122eb357f0d4b0cb2c67 100644 (file)
@@ -7,5 +7,6 @@
 
 extern void repo_add_debpackages(Repo *repo, FILE *fp, 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);
 
 #define DEBS_ADD_WITH_PKGID    (1 << 8)
index 6ac9368034de009ce343f1d77386b428a5db7fd0..db7ada169e79e5380a2b6e5e016fe157fd39f7c8 100644 (file)
@@ -1926,6 +1926,17 @@ repo_add_rpms(Repo *repo, const char **rpms, int nrpms, int flags)
     repodata_internalize(data);
 }
 
+Id
+repo_add_rpm(Repo *repo, const char *rpm, int flags)
+{
+  int end = repo->end;
+  repo_add_rpms(repo, &rpm, 1, flags);
+  if (end == repo->end)
+    return 0;
+  else
+    return repo->end - 1;
+}
+
 static inline void
 linkhash(const char *lt, char *hash)
 {
index 92cd403968f3d00d15d8f870390f6d62b339ce4e..ba21c0f05a188c9ccb92a5a8dfc71c1f5c4d188e 100644 (file)
@@ -12,6 +12,7 @@ struct headerToken_s;
 
 extern void repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags);
 extern void repo_add_rpms(Repo *repo, const char **rpms, int nrpms, int flags);
+extern Id repo_add_rpm(Repo *repo, const char *rpm, int flags);
 void repo_add_rpmdb_pubkeys(Repo *repo, const char *rootdir, int flags);
 void repo_add_pubkeys(Repo *repo, const char **keys, int nkeys, int flags);