[packages/Limba] - added appstream0.10 patch (from git); release 2

qboosh qboosh at pld-linux.org
Wed Oct 5 18:26:51 CEST 2016


commit 4664bae63b754b402301adef8896cbdb2ccb7214
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Oct 5 18:28:52 2016 +0200

    - added appstream0.10 patch (from git); release 2

 Limba-appstream0.10.patch | 198 ++++++++++++++++++++++++++++++++++++++++++++++
 Limba.spec                |   9 ++-
 2 files changed, 204 insertions(+), 3 deletions(-)
---
diff --git a/Limba.spec b/Limba.spec
index 227deec..019906e 100644
--- a/Limba.spec
+++ b/Limba.spec
@@ -3,13 +3,15 @@ Summary:	Experimental software installation system
 Summary(pl.UTF-8):	Eksperymentalny system do instalowania oprogramowania
 Name:		Limba
 Version:	0.5.6
-Release:	1
+Release:	2
 License:	LGPL v2.1+
 Group:		Libraries
 Source0:	https://people.freedesktop.org/~mak/limba/releases/%{name}-%{version}.tar.xz
 # Source0-md5:	aa3fbfef65087e26079510e409d4c443
+# https://github.com/ximion/limba/commit/55c1cdda6766a01d6004aa16955ddf59f9f0c6c9.patch
+Patch0:		%{name}-appstream0.10.patch
 URL:		https://people.freedesktop.org/~mak/limba/
-BuildRequires:	AppStream-devel >= 0.9.0
+BuildRequires:	AppStream-devel >= 0.10.0
 BuildRequires:	cmake >= 2.8.6
 BuildRequires:	curl-devel
 BuildRequires:	gettext-tools
@@ -29,7 +31,7 @@ BuildRequires:	xmlto
 BuildRequires:	xz
 BuildRequires:	yaml-devel >= 0.1
 Requires:	%{name}-libs = %{version}-%{release}
-Requires:	AppStream >= 0.9.0
+Requires:	AppStream >= 0.10.0
 Requires:	polkit >= 0.104
 # requires overlayfs
 Requires:	uname(release) >= 4.0
@@ -99,6 +101,7 @@ Pliki nagłówkowe biblioteki Limba.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env perl,/usr/bin/perl,' contrib/licompile/{lig++,ligcc}
 
diff --git a/Limba-appstream0.10.patch b/Limba-appstream0.10.patch
new file mode 100644
index 0000000..9115758
--- /dev/null
+++ b/Limba-appstream0.10.patch
@@ -0,0 +1,198 @@
+From 55c1cdda6766a01d6004aa16955ddf59f9f0c6c9 Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias at tenstral.net>
+Date: Wed, 31 Aug 2016 00:21:11 +0200
+Subject: [PATCH] Add support for AppStream 0.10
+
+---
+ CMakeLists.txt                      |  2 +-
+ src/li-package.c                    | 10 ++++++----
+ src/li-pkg-builder.c                |  7 +++++--
+ src/li-pkg-cache.c                  | 12 ++++++++----
+ src/li-repository.c                 | 17 +++++++++++++----
+ tools/buildcli/li-build-conf.c      |  5 ++++-
+ tools/buildcli/li-build-templates.c |  4 +++-
+ 7 files changed, 40 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 83755bf..0530a9d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ add_custom_target(uninstall
+ #
+ find_package(Gettext REQUIRED)
+ find_package(GLIB 2.44 REQUIRED COMPONENTS "gio" "gobject" "gio-unix")
+-pkg_check_modules(APPSTREAM REQUIRED appstream>=0.9.0)
++pkg_check_modules(APPSTREAM REQUIRED appstream>=0.10)
+ pkg_check_modules(UUID REQUIRED uuid>=2.0)
+ pkg_check_modules (POLKIT REQUIRED polkit-gobject-1>=0.104)
+ pkg_check_modules(LIBCAP REQUIRED libcap>=2.24)
+diff --git a/src/li-package.c b/src/li-package.c
+index 7e2bd7d..e78a7f5 100644
+--- a/src/li-package.c
++++ b/src/li-package.c
+@@ -417,7 +417,10 @@ li_package_read_component_data (LiPackage *pkg, const gchar *data, GError **erro
+ 	/* do not filter languages */
+ 	as_metadata_set_locale (mdata, "ALL");
+ 
+-	as_metadata_parse_xml (mdata, data, &tmp_error);
++	as_metadata_parse (mdata,
++			   data,
++			   AS_FORMAT_KIND_XML,
++			   &tmp_error);
+ 	priv->cpt = g_object_ref (as_metadata_get_component (mdata));
+ 	g_object_unref (mdata);
+ 	if (tmp_error != NULL) {
+@@ -1416,7 +1419,7 @@ li_package_has_embedded_packages (LiPackage *pkg)
+ gchar*
+ li_package_get_appstream_data (LiPackage *pkg)
+ {
+-	AsMetadata *metad;
++	g_autoptr(AsMetadata) metad = NULL;
+ 	gchar *xml;
+ 	LiPackagePrivate *priv = GET_PRIVATE (pkg);
+ 	if (priv->cpt == NULL)
+@@ -1424,8 +1427,7 @@ li_package_get_appstream_data (LiPackage *pkg)
+ 
+ 	metad = as_metadata_new ();
+ 	as_metadata_add_component (metad, priv->cpt);
+-	xml = as_metadata_component_to_upstream_xml (metad);
+-	g_object_unref (metad);
++	xml = as_metadata_component_to_metainfo (metad, AS_FORMAT_KIND_XML, NULL);
+ 
+ 	return xml;
+ }
+diff --git a/src/li-pkg-builder.c b/src/li-pkg-builder.c
+index 078c93e..1e3c43d 100644
+--- a/src/li-pkg-builder.c
++++ b/src/li-pkg-builder.c
+@@ -787,7 +787,10 @@ li_pkg_builder_build_package_with_details (LiPkgBuilder *builder, LiPkgInfo *ctl
+ 	}
+ 
+ 	as_metadata_add_component (metad, cpt);
+-	as_metadata_save_upstream_xml (metad, asdata_fname, &tmp_error);
++	as_metadata_save_metainfo (metad,
++				   asdata_fname,
++				   AS_FORMAT_KIND_XML,
++				   &tmp_error);
+ 	as_component_set_id (cpt, cpt_orig_id);
+ 	if (tmp_error != NULL) {
+ 		g_propagate_error (error, tmp_error);
+@@ -936,7 +939,7 @@ li_pkg_builder_create_package_from_dir (LiPkgBuilder *builder, const gchar *dir,
+ 	mdata = as_metadata_new ();
+ 	as_metadata_set_locale (mdata, "ALL");
+ 
+-	as_metadata_parse_file (mdata, asfile, &tmp_error);
++	as_metadata_parse_file (mdata, asfile, AS_FORMAT_KIND_XML, &tmp_error);
+ 	if (tmp_error != NULL) {
+ 		g_propagate_error (error, tmp_error);
+ 		return FALSE;
+diff --git a/src/li-pkg-cache.c b/src/li-pkg-cache.c
+index 290c7dd..32bf484 100644
+--- a/src/li-pkg-cache.c
++++ b/src/li-pkg-cache.c
+@@ -560,7 +560,10 @@ li_pkg_cache_download_repodata (LiPkgCache *cache, LiRepoEntry *re, const gchar
+ 
+ 	/* add AppStream metadata to the pool */
+ 	asfile = g_file_new_for_path (dest_asfname);
+-	as_metadata_parse_file (metad, asfile, &tmp_error);
++	as_metadata_parse_file (metad,
++				asfile,
++				AS_FORMAT_KIND_XML,
++				&tmp_error);
+ 	if (tmp_error != NULL) {
+ 		g_propagate_prefixed_error (error, tmp_error, "Unable to load AppStream data for: %s", li_repo_entry_get_url (re));
+ 		return;
+@@ -712,9 +715,10 @@ li_pkg_cache_update (LiPkgCache *cache, GError **error)
+ 		}
+ 
+ 		/* save AppStream XML data */
+-		as_metadata_save_distro_xml (metad,
+-						li_repo_entry_get_appstream_fname (re),
+-						&tmp_error);
++		as_metadata_save_collection (metad,
++					     li_repo_entry_get_appstream_fname (re),
++					     AS_FORMAT_KIND_XML,
++					     &tmp_error);
+ 		if (tmp_error != NULL) {
+ 			g_propagate_prefixed_error (error, tmp_error, "Unable to save metadata.");
+ 			return;
+diff --git a/src/li-repository.c b/src/li-repository.c
+index 82b6388..f18dfd9 100644
+--- a/src/li-repository.c
++++ b/src/li-repository.c
+@@ -238,7 +238,10 @@ li_repository_load_indices (LiRepository *repo, const gchar* dir, GError **error
+ 				/* we do not want to filter languages */
+ 				as_metadata_set_locale (metad, "ALL");
+ 
+-				as_metadata_parse_file (metad, file, &tmp_error);
++				as_metadata_parse_file (metad,
++							file,
++							AS_FORMAT_KIND_XML,
++							&tmp_error);
+ 				if (tmp_error == NULL)
+ 					g_hash_table_insert (priv->asmeta, g_strdup (arch), metad);
+ 			}
+@@ -543,7 +546,10 @@ li_repository_save_asmeta (gchar *arch, AsMetadata *metad, LiIndexSaveHelper *he
+ 	g_mkdir_with_parents (dir, 0755);
+ 
+ 	fname = g_build_filename (dir, "Metadata.xml.gz", NULL);
+-	as_metadata_save_distro_xml (metad, fname, &helper->error);
++	as_metadata_save_collection (metad,
++				     fname,
++				     AS_FORMAT_KIND_XML,
++				     &helper->error);
+ 	if (helper->error != NULL)
+ 		return;
+ 
+@@ -755,6 +761,7 @@ li_repository_add_package (LiRepository *repo, const gchar *pkg_fname, GError **
+ 
+ 	/* don't add to AppStream index, development packages don't belong there */
+ 	if (kind != LI_PACKAGE_KIND_DEVEL) {
++		g_autoptr(AsBundle) bundle = NULL;
+ 		AsComponent *cpt;
+ 
+ 		cpt = li_package_get_appstream_cpt (pkg);
+@@ -773,8 +780,10 @@ li_repository_add_package (LiRepository *repo, const gchar *pkg_fname, GError **
+ 		}
+ 
+ 		/* set a unique AppStream bundle name */
+-		as_component_add_bundle_id (cpt, AS_BUNDLE_KIND_LIMBA,
+-						li_pkg_info_get_id (pki));
++		bundle = as_bundle_new ();
++		as_bundle_set_kind (bundle, AS_BUNDLE_KIND_LIMBA);
++		as_bundle_set_id (bundle, li_pkg_info_get_id (pki));
++		as_component_add_bundle (cpt, bundle);
+ 		/* remove all package names - just in case */
+ 		as_component_set_pkgnames (cpt, NULL);
+ 
+diff --git a/tools/buildcli/li-build-conf.c b/tools/buildcli/li-build-conf.c
+index 730b95e..ea46bfa 100644
+--- a/tools/buildcli/li-build-conf.c
++++ b/tools/buildcli/li-build-conf.c
+@@ -467,7 +467,10 @@ li_build_conf_open_from_dir (LiBuildConf *bconf, const gchar *dir, GError **erro
+ 
+ 	mdata = as_metadata_new ();
+ 	as_metadata_set_locale (mdata, "C");
+-	as_metadata_parse_file (mdata, file, &tmp_error);
++	as_metadata_parse_file (mdata,
++				file,
++				AS_FORMAT_KIND_XML,
++				&tmp_error);
+ 	g_object_unref (file);
+ 	if (tmp_error != NULL) {
+ 		g_propagate_error (error, tmp_error);
+diff --git a/tools/buildcli/li-build-templates.c b/tools/buildcli/li-build-templates.c
+index 1acb8e6..2ba4c80 100644
+--- a/tools/buildcli/li-build-templates.c
++++ b/tools/buildcli/li-build-templates.c
+@@ -153,7 +153,9 @@ libuild_make_template (const gchar *dir)
+ 		asfile = g_build_filename (res_dir, "metainfo.xml", NULL);
+ 		metad = as_metadata_new ();
+ 		as_metadata_add_component (metad, cpt);
+-		tmp = as_metadata_component_to_upstream_xml (metad);
++		tmp = as_metadata_component_to_metainfo (metad,
++							 AS_FORMAT_KIND_XML,
++							 NULL);
+ 		g_object_unref (metad);
+ 		g_file_set_contents (asfile, tmp, -1, &error);
+ 		g_free (tmp);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/Limba.git/commitdiff/4664bae63b754b402301adef8896cbdb2ccb7214



More information about the pld-cvs-commit mailing list