SHA256
1
0
forked from pool/AppStream

Accepting request 862279 from KDE:Frameworks5

OBS-URL: https://build.opensuse.org/request/show/862279
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/AppStream?expand=0&rev=20
This commit is contained in:
Dominique Leuenberger 2021-01-15 18:44:21 +00:00 committed by Git OBS Bridge
commit ec778a615d
9 changed files with 76 additions and 183 deletions

View File

@ -1,53 +0,0 @@
From 7e4b99464fc9463082465f4ccdae5d69ff001682 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Thu, 12 Nov 2020 09:29:55 +0100
Subject: [PATCH] Set FD_CLOEXEC on the LMDB FD manually
Currently the FD referring to the appstreacm-cache-FOO.mdb is leaked into
child processes. The only way to fix is in a race-free way is by passing
O_CLOEXEC when opening it inside LMDB, but that's currently not done.
---
src/as-cache.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/as-cache.c b/src/as-cache.c
index 831d94a9..777b40bb 100644
--- a/src/as-cache.c
+++ b/src/as-cache.c
@@ -35,6 +35,8 @@
#include <lmdb.h>
#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
#include <glib/gstdio.h>
#include "as-utils-private.h"
@@ -723,6 +725,7 @@ as_cache_open (AsCache *cache, const gchar *fname, const gchar *locale, GError *
gboolean nosync;
gboolean readonly;
g_autoptr(GMutexLocker) locker = NULL;
+ int db_fd, db_fd_flags = -1;
/* close cache in case it was open */
as_cache_close (cache);
@@ -829,6 +832,16 @@ as_cache_open (AsCache *cache, const gchar *fname, const gchar *locale, GError *
goto fail;
}
+ /* set FD_CLOEXEC manually. LMDB should do that, but it doesn't:
+ https://www.openldap.org/lists/openldap-bugs/201702/msg00003.html */
+ rc = mdb_env_get_fd (priv->db_env, &db_fd);
+ if (rc == MDB_SUCCESS) {
+ db_fd_flags = fcntl (db_fd, F_GETFD);
+ }
+ if (db_fd_flags != -1) {
+ fcntl (db_fd, F_SETFD, db_fd_flags | FD_CLOEXEC);
+ }
+
/* unlink the file, so it gets removed as soon as we don't need it anymore */
if (priv->volatile_db_fname != NULL)
g_unlink (priv->volatile_db_fname);
--
2.20.1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:194d871ae057c6bf2b5a95e98d77da2b0107996f593b2ac0b0b88fa8ba452f11
size 2120548

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE0zo/DKFrCsxRpgc4SUyKX79N7OsFAl661F4ACgkQSUyKX79N
7Os0kRAAglKoyxLdtFenC7254dDizmsuDRKz4kGgoNDhLwt/EaXdHdiEXAXijY1z
k+eOb0bkmjzsjlLciXRdivwZTP/azIAqPujzhqMsQTxxPj+Rt3BrE5ejKG3gvJo6
vvfEZHr9ujtIANzsbuGGUdycDzGWQqkplcJ9h0r31AlS5ktCA7XH9/JqYtrB3d0C
IF0T2k7vQt+ZzXQgYNdBbVz9p+Xx3nEhZd2AxgzoMKANE2mXhFW3kqBf0yZHR67M
7C2k9BoDxtfqKXU2YkugbrAqVdgcHZMYN02ZklX5aR+MN0xk3MfMMk676v7GrfvK
TWEbq/XSsSQ85JqIErkic/PIC8wTIKecoOBp3L/2VfI/hzm3GaP1y/Cmc0kvGuFW
95//I0hES5IFRqjlX+DG63uDcnnEiohAeEMNP9qzqWIpETBAeyDHTnOhnWwn6OGP
3ocFPD7/Vfwd7FkEVdI44bdsGT6i6u9i06qtq7wO1OrNdtJ0WrmMksTv2kJfej5U
wyIscoM9RO+up1sH873Vj2qS2Sp/wpkp9keKMjpoSvClWUuVLiStdqByePS5iuCE
SsTnfWi4V41IMNspFsUCJwnPyrJjbjK+duTlsC0cwl2ewDmb+p6rWy5/Fwr5wZim
mDaQSj05Rwa4Zd0QNb1wHMuafiFXeYmUOwjfLOWTxDtOU0rqrJc=
=vNI0
-----END PGP SIGNATURE-----

3
AppStream-0.13.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ba7de61223aaa76d8c47d8857bf185c28d4c2a099f3ab02c8837091e7e8f8626
size 2221448

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE0zo/DKFrCsxRpgc4SUyKX79N7OsFAl/FcrQACgkQSUyKX79N
7Ouy5RAAgo/bD5YdUfpqYzbXQcbjoRgEi1Vvgoqd9en16utqIhFenwRnzOq3sfO7
7cjddkeNAByTdZYAgSoKZMTk2vUwCmmXZKSW+4NFxuVSXVtEyLzWQTvdBTEMNi86
+pYC+V8i21lmrdgRYoLTxkjdBU0Lt//2MLU1XAn4mNKnTqGiMW5owfWPb33f3swD
Cl6Woqkm8bFPyat2KKk1hS/sDWL+9ScrdhtfZWG7K5M0mO2hm25v7TX3ym7LhP8m
CS3HS0HJsHhfpN3XaRA2y9cynNyi2AjsRGRiK+H0rch8s+wMdRN3MmPtoE8kZ8v2
9Jrc13tNSVgeaLpxjmSzQaMEXw7HHzIEgvx6opSaqy0ZMBbh45Xnz3pJH4zxW88q
CdD3h9EeH/s2gVT/Oh0qVuiongEIgnpdJ4JY96w46bVYvKVqp+bsCNhVvcTX1eyg
wfKICIMcwTSnNnFl1GPox6NiH4jAa/NiMzF+1rRRpAFR3uv8fJaLIfO/c8PGkErQ
JDT+qJgpfHYPYbyWfQyWuuZuM1ClrjdV98BJ/6cfqEsYp6i8TzS7E1Vail/ve8tZ
dPpg0Xy+vx4vGQYIekrsD/KhISyv44DADdpzNE4idPsA/Wc5mFrGIsgV2ddMY1so
CsFqYV1WH+ZzME0+JwBjXcfmcZ92lKtF5xwQUW2Qf73PGk7m1z4=
=UPqM
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,52 @@
-------------------------------------------------------------------
Mon Jan 11 07:58:05 UTC 2021 - Fabian Vogt <fabian@ritter-vogt.de>
- Disable vala bindings, fails to build on Leap 15.2 because
g-ir-scanner emits the return type before parameters, which vapigen does not like
- Update to 0.13.1:
Bugfixes:
* Install enum types headers to the right location
* qt: Construct library using libappstream dependency object
* validator: Improve check for invalid hyperlinks to reduce false-positives
- Update to 0.13.0:
Notes:
* This release introduces a new library, libappstream-compose, designed to
provide building blocks for composing AppStream metadata. This includes GUI
stuff like font and SVG rendering, which libappstream deliberately does not
provide. The new compose library is not API/ABI stable and should - for now -
only be used by appstream-generator.
Features:
* qt: add missing Provided::KindId enum (Aleix Pol)
* Add experimental libappstream-compose (Matthias Klumpp)
* Implement support for display_length relation kind (Matthias Klumpp)
* Implement "tv-remote" input control kind (Matthias Klumpp)
* Refactor AsRelation to use GVariant internally (Matthias Klumpp)
* content-rating: Align the OARS/CSM mappings of sex-* (Philip Withnall)
* content-rating: Add content rating system APIs from gnome-software (Philip Withnall)
* content-rating: Expand translator comments to link to OARS website (Philip Withnall)
Specification:
* spec: Specify display_length requires/recommends item (Matthias Klumpp)
* spec: Add tv-remote user input control type (Matthias Klumpp)
Bugfixes:
* Use glib-mkenums to create the GType of all the available enums (Corentin Noël)
* Set FD_CLOEXEC on the LMDB FD manually (Fabian Vogt)
* Never ship with an embedded convenience copy of Highlight.js (Matthias Klumpp)
* Don't fail doc install if global highlight.js wasn't found (Matthias Klumpp)
* Properly escape markup when fixing invalid description data (Matthias Klumpp)
* validator: Don't pass NULL to vprintf, it's not an allowed value (Matthias Klumpp)
* meson: Kill deprecation warning for pkgconfig.generate (Matthias Klumpp)
* validator: Demote cid-contains-uppercase-letter from INFO to PEDANTIC (Matthias Klumpp)
* Change some AsPool GIR annotations to only transfer container,
as workaround for issue in GIR (Matthias Klumpp)
* Properly parse YAML font provides entry (Matthias Klumpp)
* content-rating: Lower the OARS/CSM mapping of sex-homosexuality/intense (Philip Withnall)
* Change return annotation of as_agreement_get_sections to "transfer none" (Rico Tzschichholz)
* contrib: Vala expects element-type of PtrArray to reflect their ownership (Rico Tzschichholz)
- Drop patches, now upstream:
* 0001-Set-FD_CLOEXEC-on-the-LMDB-FD-manually.patch
* properly-escape-markup.patch
- Refresh fix-build-gcc7.patch
-------------------------------------------------------------------
Thu Nov 12 08:39:54 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package AppStream
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,7 +19,7 @@
%define libappstream_sover 4
%define libAppStreamQt_sover 2
Name: AppStream
Version: 0.12.11
Version: 0.13.1
Release: 0
Summary: Tools and libraries to work with AppStream metadata
License: GPL-2.0-or-later AND LGPL-2.1-or-later
@ -29,10 +29,6 @@ Source0: http://www.freedesktop.org/software/appstream/releases/%{name}-%
Source1: http://www.freedesktop.org/software/appstream/releases/%{name}-%{version}.tar.xz.asc
Source2: %{name}.keyring
# PATCH-FIX-UPSTREAM
Patch1: properly-escape-markup.patch
# https://github.com/ximion/appstream/pull/287
Patch2: 0001-Set-FD_CLOEXEC-on-the-LMDB-FD-manually.patch
# PATCH-FIX-OPENSUSE
Patch100: fix-build-gcc7.patch
BuildRequires: docbook-xsl-stylesheets
BuildRequires: gettext
@ -48,7 +44,6 @@ BuildRequires: pkgconfig(glib-2.0) >= 2.58
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libsoup-2.4)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(vapigen)
BuildRequires: pkgconfig(yaml-0.1)
Recommends: curl
@ -121,7 +116,7 @@ GObject introspection bindings for interfaces provided by AppStream.
%build
%meson -Dqt=true \
-Dvapi=true \
-Dvapi=false \
-Ddocs=false \
-Dapidocs=false \
-Dstemming=false
@ -176,10 +171,6 @@ appstreamcli refresh --force || true
%{_includedir}/appstream/
%{_datadir}/gir-1.0/AppStream-1.0.gir
%{_datadir}/gettext/
%dir %{_datadir}/vala/
%dir %{_datadir}/vala/vapi/
%{_datadir}/vala/vapi/appstream.deps
%{_datadir}/vala/vapi/appstream.vapi
%files -n typelib-1_0-AppStream-1.0
%license LICENSE*

View File

@ -1,16 +1,16 @@
From: Fabian Vogt <fabian@ritter-vogt.de>
Subject: Fix build with GCC 7
Index: AppStream-0.12.11/meson.build
Index: AppStream-0.13.1/meson.build
===================================================================
--- AppStream-0.12.11.orig/meson.build
+++ AppStream-0.12.11/meson.build
@@ -54,7 +54,7 @@ endif
--- AppStream-0.13.1.orig/meson.build
+++ AppStream-0.13.1/meson.build
@@ -55,7 +55,7 @@ endif
# a few compiler warning flags we always want enabled
add_global_arguments('-Werror=implicit-function-declaration', '-Wno-unused-parameter', language: 'c')
-add_global_arguments('-Wno-unused-parameter', '-Wno-error=deprecated-copy', language: 'cpp')
+add_global_arguments('-Wno-unused-parameter', language: 'cpp')
add_global_arguments('-DAS_COMPILATION', language : 'c')
add_global_arguments('-DAS_COMPILATION', language: 'c')
#

View File

@ -1,94 +0,0 @@
From 178c01d2fa12fe8b0676e1676d0d40613f167c69 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Wed, 13 May 2020 21:45:32 +0200
Subject: [PATCH] Properly escape markup when fixing invalid description data
This resolves https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960491
and possibly more issues when AppStream was fed broken metainfo files.
---
src/as-xml.c | 26 +++++++++++++++-----------
src/as-xml.h | 2 +-
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/as-xml.c b/src/as-xml.c
index 962bdf9a..1935e37b 100644
--- a/src/as-xml.c
+++ b/src/as-xml.c
@@ -112,10 +112,10 @@ as_xml_dump_node (xmlNode *node, gchar **content, gssize *len)
}
/**
- * as_xml_dump_node_content:
+ * as_xml_dump_node_content_raw:
*/
gchar*
-as_xml_dump_node_content (xmlNode *node)
+as_xml_dump_node_content_raw (xmlNode *node)
{
g_autofree gchar *content = NULL;
gchar *tmp;
@@ -170,10 +170,10 @@ as_xml_dump_node_children (xmlNode *node)
}
/**
- * as_xml_dump_desc_para_node_content:
+ * as_xml_dump_desc_para_node_content_raw:
*/
static gchar*
-as_xml_dump_desc_para_node_content (xmlNode *node)
+as_xml_dump_desc_para_node_content_raw (xmlNode *node)
{
gboolean is_valid_markup = TRUE;
@@ -198,11 +198,15 @@ as_xml_dump_desc_para_node_content (xmlNode *node)
* was deemed valid. Otherwise we will just try to dump any string content, and hope
* people call the validator on their files to see that their metadata is broken.
* TODO: Parse the data properly, and remove only the bad nodes on error, if libxml permits
- * that somehow? */
- if (is_valid_markup)
- return as_xml_dump_node_content (node);
- else
- return as_xml_get_node_value (node);
+ * that in an efficient way? */
+ if (G_LIKELY (is_valid_markup)) {
+ return as_xml_dump_node_content_raw (node);
+ } else {
+ g_autofree gchar *tmp = as_xml_get_node_value (node);
+ if (G_UNLIKELY (tmp == NULL))
+ return NULL;
+ return g_markup_escape_text (tmp, -1);
+ }
}
/**
@@ -405,7 +409,7 @@ as_xml_parse_metainfo_description_node (AsContext *ctx, xmlNode *node, GHFunc fu
g_hash_table_insert (desc, g_strdup (lang), str);
}
- content = as_xml_dump_desc_para_node_content (iter);
+ content = as_xml_dump_desc_para_node_content_raw (iter);
if (content != NULL)
g_string_append_printf (str, "<p>%s</p>\n", content);
@@ -443,7 +447,7 @@ as_xml_parse_metainfo_description_node (AsContext *ctx, xmlNode *node, GHFunc fu
g_hash_table_insert (desc, g_strdup (lang), str);
}
- content = as_xml_dump_desc_para_node_content (iter2);
+ content = as_xml_dump_desc_para_node_content_raw (iter2);
if (content != NULL)
g_string_append_printf (str, " <%s>%s</%s>\n", (gchar*) iter2->name, content, (gchar*) iter2->name);
}
diff --git a/src/as-xml.h b/src/as-xml.h
index 50a38082..ff1efc56 100644
--- a/src/as-xml.h
+++ b/src/as-xml.h
@@ -53,7 +53,7 @@ void as_xml_parse_metainfo_description_node (AsContext *ctx,
GHFunc func,
gpointer entity);
-gchar *as_xml_dump_node_content (xmlNode *node);
+gchar *as_xml_dump_node_content_raw (xmlNode *node);
gchar *as_xml_dump_node_children (xmlNode *node);
void as_xml_add_description_node (AsContext *ctx,