- 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 bad3101..841b580 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 dd79ab7..ff19536 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 6ac9368..db7ada1 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 92cd403..ba21c0f 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);