From a55fbeca42e4a3e40517bb627e6c888720c06269 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 27 Jul 2017 00:13:27 -0400 Subject: [PATCH] Add a patch to fix OCI refname annotation --- ...pencontainers.ref.name-to-org.openco.patch | 64 +++++++++++++++++++ flatpak.spec | 9 ++- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 OCI-Update-org.opencontainers.ref.name-to-org.openco.patch diff --git a/OCI-Update-org.opencontainers.ref.name-to-org.openco.patch b/OCI-Update-org.opencontainers.ref.name-to-org.openco.patch new file mode 100644 index 0000000..45625cc --- /dev/null +++ b/OCI-Update-org.opencontainers.ref.name-to-org.openco.patch @@ -0,0 +1,64 @@ +From 0853089457a3e2ca343ea467dfc703bf99c416b9 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" +Date: Thu, 6 Jul 2017 17:07:08 -0400 +Subject: [PATCH] OCI: Update org.opencontainers.ref.name to + org.opencontainers.image.ref.name + +This annotation was changed in later versions of the OCI Image specification. +(See https://github.com/projectatomic/skopeo/issues/369#issuecomment-310158211) +--- + common/flatpak-json-oci.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/common/flatpak-json-oci.c b/common/flatpak-json-oci.c +index a64a0e0..718e0dc 100644 +--- a/common/flatpak-json-oci.c ++++ b/common/flatpak-json-oci.c +@@ -426,7 +426,7 @@ flatpak_oci_index_add_manifest (FlatpakOciIndex *self, + int count; + + if (desc->annotations != NULL) +- m_ref = g_hash_table_lookup (desc->annotations, "org.opencontainers.ref.name"); ++ m_ref = g_hash_table_lookup (desc->annotations, "org.opencontainers.image.ref.name"); + + if (m_ref != NULL) + flatpak_oci_index_remove_manifest (self, m_ref); +@@ -449,7 +449,7 @@ flatpak_oci_manifest_descriptor_get_ref (FlatpakOciManifestDescriptor *m) + if (m->parent.annotations == NULL) + return NULL; + +- return g_hash_table_lookup (m->parent.annotations, "org.opencontainers.ref.name"); ++ return g_hash_table_lookup (m->parent.annotations, "org.opencontainers.image.ref.name"); + } + + static int +@@ -703,7 +703,7 @@ flatpak_oci_export_annotations (GHashTable *source, + GHashTable *dest) + { + const char *keys[] = { +- "org.opencontainers.ref.name", ++ "org.opencontainers.image.ref.name", + "org.flatpak.installed-size", + "org.flatpak.download-size", + "org.flatpak.metadata", +@@ -750,7 +750,7 @@ flatpak_oci_add_annotations_for_commit (GHashTable *annotations, + GVariant *commit_data) + { + if (ref) +- add_annotation (annotations,"org.opencontainers.ref.name", ref); ++ add_annotation (annotations,"org.opencontainers.image.ref.name", ref); + + if (commit) + add_annotation (annotations,"org.flatpak.commit", commit); +@@ -809,7 +809,7 @@ flatpak_oci_parse_commit_annotations (GHashTable *annotations, + GHashTableIter iter; + gpointer _key, _value; + +- oci_ref = g_hash_table_lookup (annotations, "org.opencontainers.ref.name"); ++ oci_ref = g_hash_table_lookup (annotations, "org.opencontainers.image.ref.name"); + if (oci_ref != NULL && out_ref != NULL && *out_ref == NULL) + *out_ref = g_strdup (oci_ref); + +-- +2.13.0 + diff --git a/flatpak.spec b/flatpak.spec index 470c662..8935977 100644 --- a/flatpak.spec +++ b/flatpak.spec @@ -3,7 +3,7 @@ Name: flatpak Version: 0.9.7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Application deployment framework for desktop apps Group: Development/Tools @@ -11,6 +11,8 @@ License: LGPLv2+ URL: http://flatpak.org/ Source0: https://github.com/flatpak/flatpak/releases/download/%{version}/%{name}-%{version}.tar.xz +Patch0: OCI-Update-org.opencontainers.ref.name-to-org.openco.patch + BuildRequires: pkgconfig(fuse) BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.40.0 @@ -104,7 +106,7 @@ This package contains libflatpak. %prep -%setup -q +%autosetup -S git %build @@ -197,6 +199,9 @@ flatpak remote-list --system &> /dev/null || : %changelog +* Thu Jul 27 2017 Owen Taylor - 0.9.7-3 +- Add a patch to fix OCI refname annotation + * Wed Jul 26 2017 Fedora Release Engineering - 0.9.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild