[ostree/wip/metalinks: 1/2] A few more metalink updates
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree/wip/metalinks: 1/2] A few more metalink updates
- Date: Tue, 19 Aug 2014 18:57:07 +0000 (UTC)
commit 8755977b80e7e6a5a5c49d6bf8169c3c698766c9
Author: Colin Walters <walters verbum org>
Date: Tue Aug 19 09:44:40 2014 -0400
A few more metalink updates
Makefile-tests.am | 1 +
src/libostree/ostree-repo-pull.c | 2 ++
src/libostree/ostree-repo.c | 8 ++++++--
src/libotutil/ot-variant-utils.c | 2 +-
tests/test-pull-metalink.sh | 8 +++-----
5 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/Makefile-tests.am b/Makefile-tests.am
index 5c86841..dc344cf 100644
--- a/Makefile-tests.am
+++ b/Makefile-tests.am
@@ -30,6 +30,7 @@ testfiles = test-basic \
test-pull-archive-z \
test-pull-corruption \
test-pull-large-metadata \
+ test-pull-metalink \
test-pull-resume \
test-gpg-signed-commit \
test-admin-deploy-syslinux \
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 000a225..6df3688 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1101,6 +1101,8 @@ ostree_repo_pull (OstreeRepo *self,
&metalink_data,
cancellable, error))
goto out;
+
+
}
#ifdef HAVE_GPGME
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index ec281a4..6ef5397 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -2296,7 +2296,7 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
commits = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
- refs_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{s(aya{sv})}"));
+ refs_builder = g_variant_builder_new (G_VARIANT_TYPE ("a(s(aya{sv}))"));
ordered_keys = g_hash_table_get_keys (refs);
ordered_keys = g_list_sort (ordered_keys, (GCompareFunc)strcmp);
@@ -2338,13 +2338,17 @@ ostree_repo_regenerate_summary (OstreeRepo *self,
const char *commit = iter->data;
GVariant *commit_content = g_hash_table_lookup (commits, commit);
gs_unref_variant GVariant *csum_v = NULL;
+ gs_unref_bytes GBytes *commit_data;
+ gs_unref_variant GVariant *commit_data_v;
g_assert (commit_content);
csum_v = ostree_checksum_to_bytes_v (commit);
+ commit_data = g_variant_get_data_as_bytes (commit_content);
+ commit_data_v = g_variant_new_from_bytes (G_VARIANT_TYPE ("ay"), commit_data, TRUE);
g_variant_builder_add_value (commits_builder,
- g_variant_new ("(@ay ay))", csum_v, commit_content));
+ g_variant_new ("(@ay ay)", csum_v, commit_data_v));
}
{
diff --git a/src/libotutil/ot-variant-utils.c b/src/libotutil/ot-variant-utils.c
index 4355829..db79616 100644
--- a/src/libotutil/ot-variant-utils.c
+++ b/src/libotutil/ot-variant-utils.c
@@ -33,7 +33,7 @@
GVariant *
ot_gvariant_new_empty_string_dict (void)
{
- return g_variant_builder_end (g_variant_builder_new ("a{sv}"));
+ return g_variant_builder_end (g_variant_builder_new (G_VARIANT_TYPE ("a{sv}")));
}
GVariant *
diff --git a/tests/test-pull-metalink.sh b/tests/test-pull-metalink.sh
index fcadd19..56769b5 100755
--- a/tests/test-pull-metalink.sh
+++ b/tests/test-pull-metalink.sh
@@ -38,7 +38,7 @@ summary_path=${test_tmpdir}/ostree-srv/gnomerepo/summary
echo '1..1'
cd ${test_tmpdir}
-cat <<EOF
+cat > ${test_tmpdir}/metalink-data/metalink.xml <<EOF
<?xml version="1.0" encoding="utf-8"?>
<metalink version="3.0" xmlns="http://www.metalinker.org/">
<files>
@@ -60,9 +60,7 @@ EOF
cd ${test_tmpdir}
mkdir repo
${CMD_PREFIX} ostree --repo=repo init
-${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin metalink=$(cat
httpd-address)/ostree/gnomerepo
-# Try both syntaxes
-${CMD_PREFIX} ostree --repo=repo pull origin main
+${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin metalink=$(cat
metalink-httpd-address)/metalink.xml
${CMD_PREFIX} ostree --repo=repo pull origin:main
${CMD_PREFIX} ostree --repo=repo fsck
-echo "ok pull"
+echo "ok pull via metalink"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]