summaryrefslogtreecommitdiff
path: root/examples/solv
diff options
context:
space:
mode:
Diffstat (limited to 'examples/solv')
-rw-r--r--examples/solv/repoinfo_type_mdk.c21
-rw-r--r--examples/solv/repoinfo_type_rpmmd.c1
-rw-r--r--examples/solv/repoinfo_type_susetags.c3
3 files changed, 17 insertions, 8 deletions
diff --git a/examples/solv/repoinfo_type_mdk.c b/examples/solv/repoinfo_type_mdk.c
index 96b005f..69287b3 100644
--- a/examples/solv/repoinfo_type_mdk.c
+++ b/examples/solv/repoinfo_type_mdk.c
@@ -103,6 +103,18 @@ mdk_load_ext(Repo *repo, Repodata *data)
return 1;
}
+static void
+mdk_add_ext(Repo *repo, Repodata *data, const char *what, const char *ext, const char *filename, Id chksumtype, const unsigned char *chksum)
+{
+ Id handle = repodata_new_handle(data);
+ /* we mis-use the repomd ids here... need something generic in the future */
+ repodata_set_poolstr(data, handle, REPOSITORY_REPOMD_TYPE, what);
+ repodata_set_str(data, handle, REPOSITORY_REPOMD_LOCATION, filename);
+ repodata_set_bin_checksum(data, handle, REPOSITORY_REPOMD_CHECKSUM, chksumtype, chksum);
+ add_ext_keys(data, handle, ext);
+ repodata_add_flexarray(data, SOLVID_META, REPOSITORY_EXTERNAL, handle);
+}
+
int
mdk_load(struct repoinfo *cinfo, Pool **sigpoolp)
{
@@ -195,13 +207,8 @@ mdk_load(struct repoinfo *cinfo, Pool **sigpoolp)
/* setup on-demand loading of filelist data */
if (mdk_find(md5sums, "files.xml.lzma", md5))
{
- Id handle = repodata_new_handle(data);
- /* we mis-use the repomd ids here... need something generic in the future */
- repodata_set_poolstr(data, handle, REPOSITORY_REPOMD_TYPE, "filelists");
- repodata_set_str(data, handle, REPOSITORY_REPOMD_LOCATION, "media_info/files.xml.lzma");
- repodata_set_bin_checksum(data, handle, REPOSITORY_REPOMD_CHECKSUM, REPOKEY_TYPE_MD5, md5);
- add_ext_keys(data, handle, "FL");
- repodata_add_flexarray(data, SOLVID_META, REPOSITORY_EXTERNAL, handle);
+ repodata_extend_block(data, repo->start, repo->end - repo->start);
+ mdk_add_ext(repo, data, "filelists", "FL", "media_info/files.xml.lzma", REPOKEY_TYPE_MD5, md5);
}
solv_free(md5sums);
repodata_internalize(data);
diff --git a/examples/solv/repoinfo_type_rpmmd.c b/examples/solv/repoinfo_type_rpmmd.c
index 98c5d36..2a5cd7f 100644
--- a/examples/solv/repoinfo_type_rpmmd.c
+++ b/examples/solv/repoinfo_type_rpmmd.c
@@ -196,6 +196,7 @@ repomd_load(struct repoinfo *cinfo, Pool **sigpoolp)
}
#endif
data = repo_add_repodata(repo, 0);
+ repodata_extend_block(data, repo->start, repo->end - repo->start);
repomd_add_ext(repo, data, "deltainfo", "DL");
repomd_add_ext(repo, data, "filelists", "FL");
repodata_internalize(data);
diff --git a/examples/solv/repoinfo_type_susetags.c b/examples/solv/repoinfo_type_susetags.c
index 596171c..c22c736 100644
--- a/examples/solv/repoinfo_type_susetags.c
+++ b/examples/solv/repoinfo_type_susetags.c
@@ -47,7 +47,7 @@ susetags_find(Repo *repo, const char *what, const unsigned char **chksump, Id *c
return filename;
}
-void
+static void
susetags_add_ext(Repo *repo, Repodata *data)
{
Pool *pool = repo->pool;
@@ -264,6 +264,7 @@ susetags_load(struct repoinfo *cinfo, Pool **sigpoolp)
#endif
repo_internalize(repo);
data = repo_add_repodata(repo, 0);
+ repodata_extend_block(data, repo->start, repo->end - repo->start);
susetags_add_ext(repo, data);
repodata_internalize(data);
writecachedrepo(cinfo, 0, 0);