diffstat for flatpak-xdg-utils-1.0.0 flatpak-xdg-utils-0.1 Makefile.am | 7 NEWS | 4 README.md | 19 autogen.sh | 38 configure.ac | 42 debian/changelog | 6 debian/compat | 1 debian/control | 76 debian/copyright | 74 debian/flatpak-xdg-utils-tests.install | 2 debian/flatpak-xdg-utils.install | 1 debian/gbp.conf | 7 debian/patches/Add-backports-of-g_autoptr-for-compatibility-with-older-G.patch | 283 -- debian/patches/Add-test-and-installed-test-coverage-for-xdg-tools.patch | 1059 ---------- debian/patches/series | 2 debian/rules | 31 debian/source/format | 2 debian/tests/control | 4 debian/tests/gnome-desktop-testing | 6 debian/upstream/metadata | 8 debian/watch | 2 meson.build | 20 src/Makefile.am | 12 src/flatpak-spawn.c | 541 ----- src/meson.build | 23 src/xdg-email.c | 6 26 files changed, 158 insertions(+), 2118 deletions(-) diff -Nru flatpak-xdg-utils-1.0.0/Makefile.am flatpak-xdg-utils-0.1/Makefile.am --- flatpak-xdg-utils-1.0.0/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ flatpak-xdg-utils-0.1/Makefile.am 2018-03-07 07:11:06.000000000 +0000 @@ -0,0 +1,7 @@ +SUBDIRS = src po + +EXTRA_DIST = \ + autogen.sh \ + COPYING \ + NEWS \ + $(NULL) diff -Nru flatpak-xdg-utils-1.0.0/NEWS flatpak-xdg-utils-0.1/NEWS --- flatpak-xdg-utils-1.0.0/NEWS 2019-01-15 17:52:13.000000000 +0000 +++ flatpak-xdg-utils-0.1/NEWS 2018-03-07 07:11:06.000000000 +0000 @@ -1,4 +0,0 @@ -Changes in 1.0.0 -================ - -This is the first official release of flatpak-xdg-utils. diff -Nru flatpak-xdg-utils-1.0.0/README.md flatpak-xdg-utils-0.1/README.md --- flatpak-xdg-utils-1.0.0/README.md 2019-01-15 17:52:13.000000000 +0000 +++ flatpak-xdg-utils-0.1/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -This repository contains a number of commandline utilities for use -inside Flatpak sandboxes. They work by talking to portals. - -Currently, there is flatpak-spawn for running commands in sandboxes -as well as xdg-open and xdg-email, which are compatible with the -well-known scripts of the same name. - -See http://flatpak.org/ for more information. - -# Installation - -This repository uses meson to build. Just do -``` - meson [args] build - ninja -Cbuild - ninja -Cbuild install -``` - -The tools in flatpak-xdg-utils are only useful inside a Flatpak sandbox. diff -Nru flatpak-xdg-utils-1.0.0/autogen.sh flatpak-xdg-utils-0.1/autogen.sh --- flatpak-xdg-utils-1.0.0/autogen.sh 1970-01-01 00:00:00.000000000 +0000 +++ flatpak-xdg-utils-0.1/autogen.sh 2018-03-07 07:11:06.000000000 +0000 @@ -0,0 +1,38 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. +test -n "$srcdir" || srcdir=$(dirname "$0") +test -n "$srcdir" || srcdir=. + +olddir=$(pwd) + +cd $srcdir + +(test -f configure.ac) || { + echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***" + exit 1 +} + +# shellcheck disable=SC2016 +PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac) + +if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then + echo "*** WARNING: I am going to run 'configure' with no arguments." >&2 + echo "*** If you wish to pass any to it, please specify them on the" >&2 + echo "*** '$0' command line." >&2 + echo "" >&2 +fi + +mkdir -p m4 + +autoreconf --verbose --force --install || exit 1 + +cd "$olddir" +if [ "$NOCONFIGURE" = "" ]; then + $srcdir/configure "$@" || exit 1 + + if [ "$1" = "--help" ]; then exit 0 else + echo "Now type 'make' to compile $PKG_NAME" || exit 1 + fi +else + echo "Skipping configure process." +fi diff -Nru flatpak-xdg-utils-1.0.0/configure.ac flatpak-xdg-utils-0.1/configure.ac --- flatpak-xdg-utils-1.0.0/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ flatpak-xdg-utils-0.1/configure.ac 2018-03-07 07:11:06.000000000 +0000 @@ -0,0 +1,42 @@ +AC_PREREQ([2.63]) + +AC_INIT([flatpak-xdg-utils],[0.0.1]) + +AX_IS_RELEASE([micro-version]) + +AC_CONFIG_SRCDIR([src/xdg-open.c]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([1.11 foreign subdir-objects tar-ustar no-dist-gzip dist-xz]) + +# Enable silent rules if available +AM_SILENT_RULES([yes]) +AM_MAINTAINER_MODE([enable]) + +AX_CHECK_ENABLE_DEBUG([yes]) +AC_USE_SYSTEM_EXTENSIONS +AX_COMPILER_FLAGS() + +# i18n +GETTEXT_PACKAGE=AC_PACKAGE_TARNAME +AC_SUBST([GETTEXT_PACKAGE]) +AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name]) + +AM_GNU_GETTEXT_VERSION([0.18.3]) +AM_GNU_GETTEXT([external]) + +# required programs +AC_PROG_CC +AC_PROG_INSTALL +PKG_PROG_PKG_CONFIG([0.24]) + +LT_PREREQ([2.2.6]) +LT_INIT([disable-static]) + +PKG_CHECK_MODULES(FLATPAK_XDG_UTILS, [gio-2.0 >= 2.50 gio-unix-2.0]) + +AC_CONFIG_FILES([ + Makefile + src/Makefile + po/Makefile.in +]) +AC_OUTPUT diff -Nru flatpak-xdg-utils-1.0.0/debian/changelog flatpak-xdg-utils-0.1/debian/changelog --- flatpak-xdg-utils-1.0.0/debian/changelog 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/changelog 2018-03-07 07:11:20.000000000 +0000 @@ -1,5 +1,5 @@ -flatpak-xdg-utils (1.0.0-1) unstable; urgency=medium +flatpak-xdg-utils (0.1) unstable; urgency=medium - * Initial release (Closes: #919299) + * Initial Release. - -- Simon McVittie Fri, 18 Jan 2019 10:29:06 +0000 + -- Deepin Packages Builder Wed, 07 Mar 2018 15:11:20 +0800 diff -Nru flatpak-xdg-utils-1.0.0/debian/compat flatpak-xdg-utils-0.1/debian/compat --- flatpak-xdg-utils-1.0.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/compat 2018-03-07 07:11:20.000000000 +0000 @@ -0,0 +1 @@ +9 diff -Nru flatpak-xdg-utils-1.0.0/debian/control flatpak-xdg-utils-0.1/debian/control --- flatpak-xdg-utils-1.0.0/debian/control 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/control 2018-03-07 07:11:20.000000000 +0000 @@ -1,75 +1,13 @@ Source: flatpak-xdg-utils -Section: admin +Section: devel Priority: optional -Maintainer: Utopia Maintenance Team -Uploaders: - Simon McVittie , -Build-Depends: - dbus , - debhelper-compat (= 12), - libglib2.0-dev, - meson (>= 0.46.0), -Rules-Requires-Root: no -Standards-Version: 4.3.0 +Maintainer: Deepin Packages Builder +Build-Depends: debhelper (>= 9), gnome-common, libglib2.0-dev +Standards-Version: 3.9.8 Homepage: https://github.com/flatpak/flatpak-xdg-utils -Vcs-Git: https://salsa.debian.org/debian/flatpak-xdg-utils.git -Vcs-Browser: https://salsa.debian.org/debian/flatpak-xdg-utils Package: flatpak-xdg-utils Architecture: any -Multi-Arch: foreign -Depends: - ${misc:Depends}, - ${shlibs:Depends}, -Suggests: - default-dbus-session-bus | dbus-session-bus, - xdg-desktop-portal, -Description: xdg-open and xdg-email reimplementation for containerized apps - Applications running in a Flatpak sandbox cannot normally launch arbitrary - subprocesses outside the container to open files and URLs. This - package provides reimplementations of the standard xdg-open(1) and - xdg-email(1) command-line tools intended to be run inside the container. - They use the D-Bus session bus to communicate with the xdg-desktop-portal - service outside the container. - . - To avoid conflicting with the standard xdg-utils package, these tools - are installed in /usr/libexec/flatpak-xdg-utils. This directory can be - added to the PATH when preparing a container, or used as a target for - container-specific symbolic links in /usr/bin. - . - This package also contains flatpak-spawn, which can be used by Flatpak - applications to launch processes outside the container. Unprivileged - applications can use this mechanism to launch a helper tool such as a - thumbnailer in a version of their sandbox with more restrictive - permissions, and specially-privileged applications with the 'devel' flag - (such as GNOME Builder) can use this mechanism to bypass the sandbox and - run commands on the host system. - . - This package is normally only useful if you are using Debian packages to - construct a Flatpak runtime or a similar container, and should not be - installed on a normal Debian desktop system. On desktop systems please - install the reference implementation of the xdg-open and xdg-email tools, - which can be found in the xdg-utils package. - . - If this package is installed in a non-Flatpak environment for testing, - it will require the dbus-session-bus and xdg-desktop-portal packages - (which would not be useful to install in a container). - -Package: flatpak-xdg-utils-tests -Architecture: any -Multi-Arch: foreign -Depends: - dbus, - flatpak-xdg-utils, - ${misc:Depends}, - ${shlibs:Depends}, -Recommends: - gnome-desktop-testing, -Description: as-installed tests for flatpak-xdg-utils - flatpak-xdg-utils provides reimplementations of the standard xdg-open(1) - and xdg-email(1) command-line tools intended to be run inside a Flatpak - container. They use the D-Bus session bus to communicate with the - xdg-desktop-portal service outside the container - . - This package contains as-installed tests, for use with autopkgtest and - similar frameworks. They use a mock implementation of xdg-desktop-portal. +Breaks: xdg-utils +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: flatpak for xdg-utils diff -Nru flatpak-xdg-utils-1.0.0/debian/copyright flatpak-xdg-utils-0.1/debian/copyright --- flatpak-xdg-utils-1.0.0/debian/copyright 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/copyright 2018-03-07 07:11:20.000000000 +0000 @@ -1,58 +1,34 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: flatpak-xdg-utils -Source: https://github.com/flatpak/flatpak-xdg-utils/releases -License: LGPL-2.1+ +Source: -Files: - * -Copyright: - © 2017-2018 Red Hat, Inc -License: LGPL-2.1+ +Files: * +Copyright: + +License: GPL-3.0+ -Files: - src/xdg-email.c - src/xdg-open.c -Copyright: - © 2017 Red Hat, Inc. -License: LGPL-2+ +Files: debian/* +Copyright: 2018 Deepin Packages Builder +License: GPL-3.0+ -Files: - debian/* -Copyright: - © 2016-2018 Simon McVittie - © 2016-2019 Collabora Ltd. -License: LGPL-2+ - -License: LGPL-2+ - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -Comment: - On Debian systems, the full text of the GNU Lesser General Public License - version 2.1 can be found in the file '/usr/share/common-licenses/LGPL-2.1'. - -License: LGPL-2.1+ - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + You should have received a copy of the GNU General Public License + along with this program. If not, see . . - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - . - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -Comment: - On Debian systems, the full text of the GNU Lesser General Public License - version 2.1 can be found in the file '/usr/share/common-licenses/LGPL-2.1'. + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid picking licenses with terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. diff -Nru flatpak-xdg-utils-1.0.0/debian/flatpak-xdg-utils-tests.install flatpak-xdg-utils-0.1/debian/flatpak-xdg-utils-tests.install --- flatpak-xdg-utils-1.0.0/debian/flatpak-xdg-utils-tests.install 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/flatpak-xdg-utils-tests.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/libexec/installed-tests -usr/share/installed-tests diff -Nru flatpak-xdg-utils-1.0.0/debian/flatpak-xdg-utils.install flatpak-xdg-utils-0.1/debian/flatpak-xdg-utils.install --- flatpak-xdg-utils-1.0.0/debian/flatpak-xdg-utils.install 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/flatpak-xdg-utils.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/libexec/flatpak-xdg-utils diff -Nru flatpak-xdg-utils-1.0.0/debian/gbp.conf flatpak-xdg-utils-0.1/debian/gbp.conf --- flatpak-xdg-utils-1.0.0/debian/gbp.conf 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -[DEFAULT] -pristine-tar = True -compression = xz -debian-branch = debian/master -upstream-branch = upstream/latest -patch-numbers = False -upstream-vcs-tag = %(version)s diff -Nru flatpak-xdg-utils-1.0.0/debian/patches/Add-backports-of-g_autoptr-for-compatibility-with-older-G.patch flatpak-xdg-utils-0.1/debian/patches/Add-backports-of-g_autoptr-for-compatibility-with-older-G.patch --- flatpak-xdg-utils-1.0.0/debian/patches/Add-backports-of-g_autoptr-for-compatibility-with-older-G.patch 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/patches/Add-backports-of-g_autoptr-for-compatibility-with-older-G.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,283 +0,0 @@ -From: Simon McVittie -Date: Thu, 17 Jan 2019 16:49:13 +0000 -Subject: Add backports of g_autoptr for compatibility with older GLib - -I'm not sure how backwards-compatible these tools are meant to be, but -it seems to be straightforward to make them work on Ubuntu 14.04 LTS -(GLib 2.40). - -These backports resemble the ones in xdg-dbus-proxy, with the addition -of GUnixFDList and GDBusMessageInvocation, both of which I used when -adding some unit tests. - -Signed-off-by: Simon McVittie -Forwarded: https://github.com/flatpak/flatpak-xdg-utils/pull/21 -Applied-upstream: 1.0.1, commit:8914b518ebea67a560270a98d7e24f1bbc7c9026 ---- - src/backport-autoptr.h | 243 +++++++++++++++++++++++++++++++++++++++++++++++++ - src/flatpak-spawn.c | 2 + - 2 files changed, 245 insertions(+) - create mode 100644 src/backport-autoptr.h - -diff --git a/src/backport-autoptr.h b/src/backport-autoptr.h -new file mode 100644 -index 0000000..675c59f ---- /dev/null -+++ b/src/backport-autoptr.h -@@ -0,0 +1,243 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * -+ * Copyright (C) 2015 Colin Walters -+ * -+ * GLIB - Library of useful routines for C programming -+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the -+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -+ * Boston, MA 02111-1307, USA. -+ */ -+ -+#pragma once -+ -+#include -+ -+G_BEGIN_DECLS -+ -+#ifdef G_OS_UNIX -+#include -+#endif -+ -+#if !GLIB_CHECK_VERSION(2, 43, 4) -+ -+#define _GLIB_AUTOPTR_FUNC_NAME(TypeName) glib_autoptr_cleanup_##TypeName -+#define _GLIB_AUTOPTR_TYPENAME(TypeName) TypeName##_autoptr -+#define _GLIB_AUTO_FUNC_NAME(TypeName) glib_auto_cleanup_##TypeName -+#define _GLIB_CLEANUP(func) __attribute__((cleanup(func))) -+#define _GLIB_DEFINE_AUTOPTR_CHAINUP(ModuleObjName, ParentName) \ -+ typedef ModuleObjName *_GLIB_AUTOPTR_TYPENAME(ModuleObjName); \ -+ static inline void _GLIB_AUTOPTR_FUNC_NAME(ModuleObjName) (ModuleObjName **_ptr) { \ -+ _GLIB_AUTOPTR_FUNC_NAME(ParentName) ((ParentName **) _ptr); } \ -+ -+ -+/* these macros are API */ -+#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func) \ -+ typedef TypeName *_GLIB_AUTOPTR_TYPENAME(TypeName); \ -+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ -+ static inline void _GLIB_AUTOPTR_FUNC_NAME(TypeName) (TypeName **_ptr) { if (*_ptr) (func) (*_ptr); } \ -+ G_GNUC_END_IGNORE_DEPRECATIONS -+#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func) \ -+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ -+ static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { (func) (_ptr); } \ -+ G_GNUC_END_IGNORE_DEPRECATIONS -+#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none) \ -+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ -+ static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { if (*_ptr != none) (func) (*_ptr); } \ -+ G_GNUC_END_IGNORE_DEPRECATIONS -+#define g_autoptr(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_TYPENAME(TypeName) -+#define g_auto(TypeName) _GLIB_CLEANUP(_GLIB_AUTO_FUNC_NAME(TypeName)) TypeName -+#define g_autofree _GLIB_CLEANUP(g_autoptr_cleanup_generic_gfree) -+ -+/** -+ * g_steal_pointer: -+ * @pp: a pointer to a pointer -+ * -+ * Sets @pp to %NULL, returning the value that was there before. -+ * -+ * Conceptually, this transfers the ownership of the pointer from the -+ * referenced variable to the "caller" of the macro (ie: "steals" the -+ * reference). -+ * -+ * The return value will be properly typed, according to the type of -+ * @pp. -+ * -+ * This can be very useful when combined with g_autoptr() to prevent the -+ * return value of a function from being automatically freed. Consider -+ * the following example (which only works on GCC and clang): -+ * -+ * |[ -+ * GObject * -+ * create_object (void) -+ * { -+ * g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL); -+ * -+ * if (early_error_case) -+ * return NULL; -+ * -+ * return g_steal_pointer (&obj); -+ * } -+ * ]| -+ * -+ * It can also be used in similar ways for 'out' parameters and is -+ * particularly useful for dealing with optional out parameters: -+ * -+ * |[ -+ * gboolean -+ * get_object (GObject **obj_out) -+ * { -+ * g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL); -+ * -+ * if (early_error_case) -+ * return FALSE; -+ * -+ * if (obj_out) -+ * *obj_out = g_steal_pointer (&obj); -+ * -+ * return TRUE; -+ * } -+ * ]| -+ * -+ * In the above example, the object will be automatically freed in the -+ * early error case and also in the case that %NULL was given for -+ * @obj_out. -+ * -+ * Since: 2.44 -+ */ -+static inline gpointer -+(g_steal_pointer) (gpointer pp) -+{ -+ gpointer *ptr = (gpointer *) pp; -+ gpointer ref; -+ -+ ref = *ptr; -+ *ptr = NULL; -+ -+ return ref; -+} -+ -+/* type safety */ -+#define g_steal_pointer(pp) \ -+ (0 ? (*(pp)) : (g_steal_pointer) (pp)) -+ -+static inline void -+g_autoptr_cleanup_generic_gfree (void *p) -+{ -+ void **pp = (void**)p; -+ if (*pp) -+ g_free (*pp); -+} -+ -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncQueue, g_async_queue_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBookmarkFile, g_bookmark_file_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBytes, g_bytes_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GChecksum, g_checksum_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDateTime, g_date_time_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDir, g_dir_close) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GError, g_error_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHashTable, g_hash_table_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHmac, g_hmac_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOChannel, g_io_channel_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GKeyFile, g_key_file_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GList, g_list_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GArray, g_array_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPtrArray, g_ptr_array_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContext, g_main_context_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainLoop, g_main_loop_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSource, g_source_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMappedFile, g_mapped_file_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMarkupParseContext, g_markup_parse_context_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(gchar, g_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNode, g_node_destroy) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionContext, g_option_context_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionGroup, g_option_group_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPatternSpec, g_pattern_spec_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GQueue, g_queue_free) -+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GQueue, g_queue_clear) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRegex, g_regex_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo, g_match_info_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GScanner, g_scanner_destroy) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSequence, g_sequence_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSList, g_slist_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GStringChunk, g_string_chunk_free) -+G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThread, g_thread_unref) -+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GMutex, g_mutex_clear) -+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GCond, g_cond_clear) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimer, g_timer_destroy) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimeZone, g_time_zone_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTree, g_tree_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariant, g_variant_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantBuilder, g_variant_builder_unref) -+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantBuilder, g_variant_builder_clear) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantIter, g_variant_iter_free) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref) -+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free) -+ -+/* Add GObject-based types as needed. */ -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncResult, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GCancellable, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverter, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GConverterOutputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDataInputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFile, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileEnumerator, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileIOStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileInfo, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileInputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileMonitor, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GFileOutputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMemoryInputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMemoryOutputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMount, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOutputStream, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocket, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSocketAddress, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocess, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSubprocessLauncher, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTask, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsCertificate, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsDatabase, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTlsInteraction, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusConnection, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMessage, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDBusMethodInvocation, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVolumeMonitor, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibCompressor, g_object_unref) -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GZlibDecompressor, g_object_unref) -+ -+#ifdef G_OS_UNIX -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixFDList, g_object_unref) -+#endif -+ -+#endif /* !GLIB_CHECK_VERSION(2, 43, 3) */ -+ -+#if !GLIB_CHECK_VERSION(2, 45, 8) -+ -+static inline void -+g_autoptr_cleanup_gstring_free (GString *string) -+{ -+ if (string) -+ g_string_free (string, TRUE); -+} -+ -+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free) -+ -+#endif -+ -+G_END_DECLS -diff --git a/src/flatpak-spawn.c b/src/flatpak-spawn.c -index 282d9fb..139d5e9 100644 ---- a/src/flatpak-spawn.c -+++ b/src/flatpak-spawn.c -@@ -26,6 +26,8 @@ - #include - #include - -+#include "backport-autoptr.h" -+ - typedef enum { - FLATPAK_SPAWN_FLAGS_CLEAR_ENV = 1 << 0, - FLATPAK_SPAWN_FLAGS_LATEST_VERSION = 1 << 1, diff -Nru flatpak-xdg-utils-1.0.0/debian/patches/Add-test-and-installed-test-coverage-for-xdg-tools.patch flatpak-xdg-utils-0.1/debian/patches/Add-test-and-installed-test-coverage-for-xdg-tools.patch --- flatpak-xdg-utils-1.0.0/debian/patches/Add-test-and-installed-test-coverage-for-xdg-tools.patch 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/patches/Add-test-and-installed-test-coverage-for-xdg-tools.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1059 +0,0 @@ -From: Simon McVittie -Date: Thu, 17 Jan 2019 16:49:20 +0000 -Subject: Add test and installed-test coverage for xdg-* tools - -This doesn't cover anything particularly fancy yet, and also doesn't yet -cover flatpak-spawn, but it's a good starting point for not regressing. - -Signed-off-by: Simon McVittie -Forwarded: https://github.com/flatpak/flatpak-xdg-utils/pull/21 -Applied-upstream: 1.0.1, commit:451d90e424e49d2b861b4111b4bf94ef34c73e0c ---- - meson.build | 15 ++ - meson_options.txt | 4 + - tests/common.c | 99 +++++++++++ - tests/common.h | 37 +++++ - tests/meson.build | 44 +++++ - tests/template-tap.test.in | 4 + - tests/test-email.c | 369 +++++++++++++++++++++++++++++++++++++++++ - tests/test-open.c | 400 +++++++++++++++++++++++++++++++++++++++++++++ - 8 files changed, 972 insertions(+) - create mode 100644 meson_options.txt - create mode 100644 tests/common.c - create mode 100644 tests/common.h - create mode 100644 tests/meson.build - create mode 100644 tests/template-tap.test.in - create mode 100644 tests/test-email.c - create mode 100644 tests/test-open.c - -diff --git a/meson.build b/meson.build -index 3689aa0..8d0525b 100644 ---- a/meson.build -+++ b/meson.build -@@ -9,12 +9,27 @@ project( - meson_version: '>= 0.46.0', - ) - -+bindir = join_paths(get_option('prefix'), get_option('bindir')) -+installed_tests_metadir = join_paths(get_option('prefix'), -+ get_option('datadir'), -+ 'installed-tests', -+ meson.project_name()) -+installed_tests_execdir = join_paths(get_option('prefix'), -+ get_option('libexecdir'), -+ 'installed-tests', -+ meson.project_name()) -+installed_tests_enabled = get_option('installed_tests') -+ - conf = configuration_data() - conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) - conf.set_quoted('PACKAGE_VERSION', meson.project_version()) -+conf.set_quoted('BINDIR', bindir) - conf.set('_GNU_SOURCE', 1) - config_h = configure_file(output: 'config.h', configuration: conf) - - gio_unix = dependency('gio-unix-2.0') - -+srcinc = include_directories('src') -+ - subdir('src') -+subdir('tests') -diff --git a/meson_options.txt b/meson_options.txt -new file mode 100644 -index 0000000..dfba31a ---- /dev/null -+++ b/meson_options.txt -@@ -0,0 +1,4 @@ -+option('installed_tests', -+ type : 'boolean', -+ value : false, -+ description : 'enable installed tests') -diff --git a/tests/common.c b/tests/common.c -new file mode 100644 -index 0000000..4d7566f ---- /dev/null -+++ b/tests/common.c -@@ -0,0 +1,99 @@ -+/* -+ * Copyright © 2018-2019 Collabora Ltd. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library. If not, see . -+ */ -+ -+#include "common.h" -+ -+#include -+ -+#include -+ -+#include "backport-autoptr.h" -+ -+void -+setup_dbus_daemon (GSubprocess **dbus_daemon, -+ gchar **dbus_address) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autoptr(GError) error = NULL; -+ GInputStream *address_pipe; -+ gchar address_buffer[4096] = { 0 }; -+ g_autofree gchar *escaped = NULL; -+ char *newline; -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE); -+ *dbus_daemon = g_subprocess_launcher_spawn (launcher, &error, -+ "dbus-daemon", -+ "--session", -+ "--print-address=1", -+ "--nofork", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (*dbus_daemon); -+ -+ address_pipe = g_subprocess_get_stdout_pipe (*dbus_daemon); -+ -+ /* Crash if it takes too long to get the address */ -+ alarm (30); -+ -+ while (strchr (address_buffer, '\n') == NULL) -+ { -+ if (strlen (address_buffer) >= sizeof (address_buffer) - 1) -+ g_error ("Read %" G_GSIZE_FORMAT " bytes from dbus-daemon with " -+ "no newline", -+ sizeof (address_buffer) - 1); -+ -+ g_input_stream_read (address_pipe, -+ address_buffer + strlen (address_buffer), -+ sizeof (address_buffer) - strlen (address_buffer), -+ NULL, &error); -+ g_assert_no_error (error); -+ } -+ -+ /* Disable alarm */ -+ alarm (0); -+ -+ newline = strchr (address_buffer, '\n'); -+ g_assert_nonnull (newline); -+ *newline = '\0'; -+ *dbus_address = g_strdup (address_buffer); -+} -+ -+void -+own_name_sync (GDBusConnection *conn, -+ const char *name) -+{ -+ g_autoptr(GVariant) variant = NULL; -+ g_autoptr(GError) error = NULL; -+ guint32 result; -+ -+ /* We don't use g_bus_own_name() here because it's easier to be -+ * synchronous */ -+ variant = g_dbus_connection_call_sync (conn, -+ DBUS_SERVICE_DBUS, -+ DBUS_PATH_DBUS, -+ DBUS_IFACE_DBUS, -+ "RequestName", -+ g_variant_new ("(su)", -+ name, -+ DBUS_NAME_FLAG_DO_NOT_QUEUE), -+ G_VARIANT_TYPE ("(u)"), -+ G_DBUS_CALL_FLAGS_NONE, -1, -+ NULL, &error); -+ g_assert_no_error (error); -+ g_variant_get (variant, "(u)", &result); -+ g_assert_cmpuint (result, ==, DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); -+} -diff --git a/tests/common.h b/tests/common.h -new file mode 100644 -index 0000000..cb9e19d ---- /dev/null -+++ b/tests/common.h -@@ -0,0 +1,37 @@ -+/* -+ * Copyright © 2018-2019 Collabora Ltd. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library. If not, see . -+ */ -+ -+#pragma once -+ -+#include -+ -+/* GDBus interface info contains padding for future expansion, silence -+ * warnings about this */ -+#ifdef __GNUC__ -+#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -+#endif -+ -+#define DBUS_SERVICE_DBUS "org.freedesktop.DBus" -+#define DBUS_PATH_DBUS "/org/freedesktop/DBus" -+#define DBUS_IFACE_DBUS DBUS_SERVICE_DBUS -+#define DBUS_NAME_FLAG_DO_NOT_QUEUE 4 -+#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 -+ -+void setup_dbus_daemon (GSubprocess **dbus_daemon, -+ gchar **dbus_address); -+void own_name_sync (GDBusConnection *conn, -+ const char *name); -diff --git a/tests/meson.build b/tests/meson.build -new file mode 100644 -index 0000000..6518546 ---- /dev/null -+++ b/tests/meson.build -@@ -0,0 +1,44 @@ -+test_env = environment() -+test_env.set('G_DEBUG', 'gc-friendly') -+test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) -+test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) -+test_env.set('GIO_USE_VFS', 'local') -+test_env.set('XDG_EMAIL', xdg_email.full_path()) -+test_env.set('XDG_OPEN', xdg_open.full_path()) -+test_env.set('MALLOC_CHECK_', '2') -+ -+tests = [ -+ 'test-email', -+ 'test-open', -+] -+ -+test_timeout = 60 -+ -+installed_tests_template_tap = files('template-tap.test.in') -+ -+foreach test_name : tests -+ template = installed_tests_template_tap -+ -+ if installed_tests_enabled -+ test_conf = configuration_data() -+ test_conf.set('installed_tests_dir', installed_tests_execdir) -+ test_conf.set('program', test_name) -+ configure_file( -+ input: template, -+ output: test_name + '.test', -+ install_dir: installed_tests_metadir, -+ configuration: test_conf -+ ) -+ endif -+ -+ exe = executable(test_name, [test_name + '.c', 'common.c', 'common.h'], -+ c_args: ['-include', '@0@'.format(config_h)], -+ dependencies: [gio_unix], -+ include_directories : [srcinc], -+ install_dir: installed_tests_execdir, -+ install: installed_tests_enabled, -+ ) -+ -+ test(test_name, exe, env : test_env, timeout : test_timeout, -+ suite : ['flatpak-xdg-utils'], args : ['--tap']) -+endforeach -diff --git a/tests/template-tap.test.in b/tests/template-tap.test.in -new file mode 100644 -index 0000000..6adf73f ---- /dev/null -+++ b/tests/template-tap.test.in -@@ -0,0 +1,4 @@ -+[Test] -+Type=session -+Exec=@installed_tests_dir@/@program@ --tap -+Output=TAP -diff --git a/tests/test-email.c b/tests/test-email.c -new file mode 100644 -index 0000000..82a4b69 ---- /dev/null -+++ b/tests/test-email.c -@@ -0,0 +1,369 @@ -+/* -+ * Copyright © 2018-2019 Collabora Ltd. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include "backport-autoptr.h" -+#include "common.h" -+ -+#define PORTAL_BUS_NAME "org.freedesktop.portal.Desktop" -+#define PORTAL_OBJECT_PATH "/org/freedesktop/portal/desktop" -+#define PORTAL_IFACE_NAME "org.freedesktop.portal.Email" -+ -+typedef struct -+{ -+ GSubprocess *dbus_daemon; -+ gchar *dbus_address; -+ GSubprocess *xdg_email; -+ gchar *xdg_email_path; -+ GDBusConnection *mock_conn; -+ guint mock_object; -+ GQueue invocations; -+} Fixture; -+ -+typedef struct -+{ -+ int dummy; -+} Config; -+ -+static void -+mock_method_call (GDBusConnection *conn G_GNUC_UNUSED, -+ const gchar *sender G_GNUC_UNUSED, -+ const gchar *object_path G_GNUC_UNUSED, -+ const gchar *interface_name, -+ const gchar *method_name, -+ GVariant *parameters G_GNUC_UNUSED, -+ GDBusMethodInvocation *invocation, -+ gpointer user_data) -+{ -+ Fixture *f = user_data; -+ g_autofree gchar *params = NULL; -+ -+ params = g_variant_print (parameters, TRUE); -+ -+ g_test_message ("Method called: %s.%s%s", interface_name, method_name, -+ params); -+ -+ g_queue_push_tail (&f->invocations, g_object_ref (invocation)); -+ g_dbus_method_invocation_return_value (invocation, -+ g_variant_new ("(o)", "/foo")); -+} -+ -+static GDBusArgInfo arg_parent_window = -+{ -+ -1, -+ "parent_window", -+ "s", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo arg_options = -+{ -+ -1, -+ "options", -+ "a{sv}", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo arg_out_handle = -+{ -+ -1, -+ "handle", -+ "o", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo *in_args[] = -+{ -+ &arg_parent_window, -+ &arg_options, -+ NULL -+}; -+ -+static GDBusArgInfo *out_args[] = -+{ -+ &arg_out_handle, -+ NULL -+}; -+ -+static GDBusMethodInfo compose_email_info = -+{ -+ -1, -+ "ComposeEmail", -+ in_args, -+ out_args, -+ NULL /* annotations */ -+}; -+ -+static GDBusMethodInfo *method_info[] = -+{ -+ &compose_email_info, -+ NULL -+}; -+ -+static GDBusInterfaceInfo iface_info = -+{ -+ -1, -+ PORTAL_IFACE_NAME, -+ method_info, -+ NULL, /* signals */ -+ NULL, /* properties */ -+ NULL /* annotations */ -+}; -+ -+static const GDBusInterfaceVTable vtable = -+{ -+ mock_method_call, -+ NULL, /* get */ -+ NULL /* set */ -+}; -+ -+static void -+setup (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GError) error = NULL; -+ -+ g_queue_init (&f->invocations); -+ -+ setup_dbus_daemon (&f->dbus_daemon, &f->dbus_address); -+ -+ f->xdg_email_path = g_strdup (g_getenv ("XDG_EMAIL")); -+ -+ if (f->xdg_email_path == NULL) -+ f->xdg_email_path = g_strdup (BINDIR "/xdg-email"); -+ -+ f->mock_conn = g_dbus_connection_new_for_address_sync (f->dbus_address, -+ (G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | -+ G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION), -+ NULL, NULL, &error); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->mock_conn); -+ -+ f->mock_object = g_dbus_connection_register_object (f->mock_conn, -+ PORTAL_OBJECT_PATH, -+ &iface_info, -+ &vtable, -+ f, -+ NULL, -+ &error); -+ g_assert_no_error (error); -+ g_assert_cmpuint (f->mock_object, !=, 0); -+ -+ own_name_sync (f->mock_conn, PORTAL_BUS_NAME); -+} -+ -+static void -+test_help (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autofree gchar *stdout_buf; -+ g_autofree gchar *stderr_buf; -+ g_autoptr(GError) error = NULL; -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE | -+ G_SUBPROCESS_FLAGS_STDERR_PIPE); -+ g_subprocess_launcher_setenv (launcher, -+ "DBUS_SESSION_BUS_ADDRESS", -+ f->dbus_address, -+ TRUE); -+ -+ f->xdg_email = g_subprocess_launcher_spawn (launcher, &error, -+ f->xdg_email_path, -+ "--help", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->xdg_email); -+ -+ g_subprocess_communicate_utf8 (f->xdg_email, NULL, NULL, &stdout_buf, -+ &stderr_buf, &error); -+ g_assert_cmpstr (stderr_buf, ==, ""); -+ g_assert_nonnull (stdout_buf); -+ g_test_message ("xdg-open --help: %s", stdout_buf); -+ g_assert_true (strstr (stdout_buf, "--version") != NULL); -+ -+ g_subprocess_wait_check (f->xdg_email, NULL, &error); -+ g_assert_no_error (error); -+} -+ -+static void -+test_minimal (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autoptr(GError) error = NULL; -+ g_autoptr(GDBusMethodInvocation) invocation = NULL; -+ g_autoptr(GVariant) asv = NULL; -+ g_autoptr(GVariantDict) dict = NULL; -+ GVariant *parameters; -+ const gchar *window; -+ const gchar *address; -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE); -+ g_subprocess_launcher_setenv (launcher, -+ "DBUS_SESSION_BUS_ADDRESS", -+ f->dbus_address, -+ TRUE); -+ -+ f->xdg_email = g_subprocess_launcher_spawn (launcher, &error, -+ f->xdg_email_path, -+ "me@example.com", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->xdg_email); -+ -+ while (g_queue_get_length (&f->invocations) < 1) -+ g_main_context_iteration (NULL, TRUE); -+ -+ g_subprocess_wait_check (f->xdg_email, NULL, &error); -+ g_assert_no_error (error); -+ -+ g_assert_cmpuint (g_queue_get_length (&f->invocations), ==, 1); -+ invocation = g_queue_pop_head (&f->invocations); -+ -+ g_assert_cmpstr (g_dbus_method_invocation_get_interface_name (invocation), -+ ==, PORTAL_IFACE_NAME); -+ g_assert_cmpstr (g_dbus_method_invocation_get_method_name (invocation), -+ ==, "ComposeEmail"); -+ -+ parameters = g_dbus_method_invocation_get_parameters (invocation); -+ g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(sa{sv})"); -+ g_variant_get (parameters, "(&s@a{sv})", -+ &window, &asv); -+ g_assert_cmpstr (window, ==, ""); -+ -+ dict = g_variant_dict_new (asv); -+ g_assert_true (g_variant_dict_lookup (dict, "address", "&s", &address)); -+ g_assert_cmpstr (address, ==, "me@example.com"); -+ g_assert_false (g_variant_dict_contains (dict, "subject")); -+ g_assert_false (g_variant_dict_contains (dict, "body")); -+ g_assert_false (g_variant_dict_contains (dict, "attachments")); -+} -+ -+static void -+test_maximal (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autoptr(GError) error = NULL; -+ g_autoptr(GDBusMethodInvocation) invocation = NULL; -+ g_autoptr(GVariant) asv = NULL; -+ g_autoptr(GVariantDict) dict = NULL; -+ g_autoptr(GVariant) attachments = NULL; -+ GVariant *parameters; -+ const gchar *window; -+ const gchar *address; -+ const gchar *subject; -+ const gchar *body; -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE); -+ g_subprocess_launcher_setenv (launcher, -+ "DBUS_SESSION_BUS_ADDRESS", -+ f->dbus_address, -+ TRUE); -+ -+ f->xdg_email = g_subprocess_launcher_spawn (launcher, &error, -+ f->xdg_email_path, -+ "--subject", "Make Money Fast", -+ "--body", "Your spam here", -+ "--attach", "/dev/null", -+ "me@example.com", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->xdg_email); -+ -+ while (g_queue_get_length (&f->invocations) < 1) -+ g_main_context_iteration (NULL, TRUE); -+ -+ g_subprocess_wait_check (f->xdg_email, NULL, &error); -+ g_assert_no_error (error); -+ -+ g_assert_cmpuint (g_queue_get_length (&f->invocations), ==, 1); -+ invocation = g_queue_pop_head (&f->invocations); -+ -+ g_assert_cmpstr (g_dbus_method_invocation_get_interface_name (invocation), -+ ==, PORTAL_IFACE_NAME); -+ g_assert_cmpstr (g_dbus_method_invocation_get_method_name (invocation), -+ ==, "ComposeEmail"); -+ -+ parameters = g_dbus_method_invocation_get_parameters (invocation); -+ g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(sa{sv})"); -+ g_variant_get (parameters, "(&s@a{sv})", -+ &window, &asv); -+ g_assert_cmpstr (window, ==, ""); -+ -+ dict = g_variant_dict_new (asv); -+ g_assert_true (g_variant_dict_lookup (dict, "address", "&s", &address)); -+ g_assert_cmpstr (address, ==, "me@example.com"); -+ g_assert_true (g_variant_dict_lookup (dict, "subject", "&s", &subject)); -+ g_assert_cmpstr (subject, ==, "Make Money Fast"); -+ g_assert_true (g_variant_dict_lookup (dict, "body", "&s", &body)); -+ g_assert_cmpstr (body, ==, "Your spam here"); -+ /* TODO: Also test that the attachment went through correctly (this -+ * doesn't seem to work at the moment) */ -+} -+ -+static void -+teardown (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GError) error = NULL; -+ gpointer free_me; -+ -+ for (free_me = g_queue_pop_head (&f->invocations); -+ free_me != NULL; -+ free_me = g_queue_pop_head (&f->invocations)) -+ g_object_unref (free_me); -+ -+ if (f->mock_object != 0) -+ g_dbus_connection_unregister_object (f->mock_conn, f->mock_object); -+ -+ if (f->dbus_daemon != NULL) -+ { -+ g_subprocess_send_signal (f->dbus_daemon, SIGTERM); -+ g_subprocess_wait (f->dbus_daemon, NULL, &error); -+ g_assert_no_error (error); -+ } -+ -+ g_clear_object (&f->dbus_daemon); -+ g_clear_object (&f->xdg_email); -+ g_clear_object (&f->mock_conn); -+ g_free (f->dbus_address); -+ g_free (f->xdg_email_path); -+ alarm (0); -+} -+ -+int -+main (int argc, -+ char **argv) -+{ -+ g_test_init (&argc, &argv, NULL); -+ -+ g_test_add ("/help", Fixture, NULL, setup, test_help, teardown); -+ g_test_add ("/minimal", Fixture, NULL, setup, test_minimal, teardown); -+ g_test_add ("/maximal", Fixture, NULL, setup, test_maximal, teardown); -+ -+ return g_test_run (); -+} -diff --git a/tests/test-open.c b/tests/test-open.c -new file mode 100644 -index 0000000..6d891db ---- /dev/null -+++ b/tests/test-open.c -@@ -0,0 +1,400 @@ -+/* -+ * Copyright © 2018-2019 Collabora Ltd. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include "backport-autoptr.h" -+#include "common.h" -+ -+#define PORTAL_BUS_NAME "org.freedesktop.portal.Desktop" -+#define PORTAL_OBJECT_PATH "/org/freedesktop/portal/desktop" -+#define PORTAL_IFACE_NAME "org.freedesktop.portal.OpenURI" -+ -+typedef struct -+{ -+ GSubprocess *dbus_daemon; -+ gchar *dbus_address; -+ GSubprocess *xdg_open; -+ gchar *xdg_open_path; -+ GDBusConnection *mock_conn; -+ guint mock_object; -+ GQueue invocations; -+} Fixture; -+ -+typedef struct -+{ -+ int dummy; -+} Config; -+ -+static void -+mock_method_call (GDBusConnection *conn G_GNUC_UNUSED, -+ const gchar *sender G_GNUC_UNUSED, -+ const gchar *object_path G_GNUC_UNUSED, -+ const gchar *interface_name, -+ const gchar *method_name, -+ GVariant *parameters G_GNUC_UNUSED, -+ GDBusMethodInvocation *invocation, -+ gpointer user_data) -+{ -+ Fixture *f = user_data; -+ g_autofree gchar *params = NULL; -+ -+ params = g_variant_print (parameters, TRUE); -+ -+ g_test_message ("Method called: %s.%s%s", interface_name, method_name, -+ params); -+ -+ g_queue_push_tail (&f->invocations, g_object_ref (invocation)); -+ g_dbus_method_invocation_return_value (invocation, -+ g_variant_new ("(o)", "/foo")); -+} -+ -+static GDBusArgInfo arg_parent_window = -+{ -+ -1, -+ "parent_window", -+ "s", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo arg_uri = -+{ -+ -1, -+ "uri", -+ "s", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo arg_options = -+{ -+ -1, -+ "options", -+ "a{sv}", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo arg_fd = -+{ -+ -1, -+ "fd", -+ "h", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo arg_out_handle = -+{ -+ -1, -+ "handle", -+ "o", -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo *open_uri_in_args[] = -+{ -+ &arg_parent_window, -+ &arg_uri, -+ &arg_options, -+ NULL -+}; -+ -+static GDBusArgInfo *open_uri_out_args[] = -+{ -+ &arg_out_handle, -+ NULL -+}; -+ -+static GDBusMethodInfo open_uri_info = -+{ -+ -1, -+ "OpenURI", -+ open_uri_in_args, -+ open_uri_out_args, -+ NULL /* annotations */ -+}; -+ -+static GDBusArgInfo *open_file_in_args[] = -+{ -+ &arg_parent_window, -+ &arg_fd, -+ &arg_options, -+ NULL -+}; -+ -+static GDBusMethodInfo open_file_info = -+{ -+ -1, -+ "OpenFile", -+ open_file_in_args, -+ open_uri_out_args, /* the same */ -+ NULL /* annotations */ -+}; -+ -+static GDBusMethodInfo *method_info[] = -+{ -+ &open_uri_info, -+ &open_file_info, -+ NULL -+}; -+ -+static GDBusInterfaceInfo iface_info = -+{ -+ -1, -+ PORTAL_IFACE_NAME, -+ method_info, -+ NULL, /* signals */ -+ NULL, /* properties */ -+ NULL /* annotations */ -+}; -+ -+static const GDBusInterfaceVTable vtable = -+{ -+ mock_method_call, -+ NULL, /* get */ -+ NULL /* set */ -+}; -+ -+static void -+setup (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GError) error = NULL; -+ -+ g_queue_init (&f->invocations); -+ -+ setup_dbus_daemon (&f->dbus_daemon, &f->dbus_address); -+ -+ f->xdg_open_path = g_strdup (g_getenv ("XDG_OPEN")); -+ -+ if (f->xdg_open_path == NULL) -+ f->xdg_open_path = g_strdup (BINDIR "/xdg-open"); -+ -+ f->mock_conn = g_dbus_connection_new_for_address_sync (f->dbus_address, -+ (G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | -+ G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION), -+ NULL, NULL, &error); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->mock_conn); -+ -+ f->mock_object = g_dbus_connection_register_object (f->mock_conn, -+ PORTAL_OBJECT_PATH, -+ &iface_info, -+ &vtable, -+ f, -+ NULL, -+ &error); -+ g_assert_no_error (error); -+ g_assert_cmpuint (f->mock_object, !=, 0); -+ -+ own_name_sync (f->mock_conn, PORTAL_BUS_NAME); -+} -+ -+static void -+test_help (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autofree gchar *stdout_buf; -+ g_autofree gchar *stderr_buf; -+ g_autoptr(GError) error = NULL; -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE | -+ G_SUBPROCESS_FLAGS_STDERR_PIPE); -+ g_subprocess_launcher_setenv (launcher, -+ "DBUS_SESSION_BUS_ADDRESS", -+ f->dbus_address, -+ TRUE); -+ -+ f->xdg_open = g_subprocess_launcher_spawn (launcher, &error, -+ f->xdg_open_path, -+ "--help", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->xdg_open); -+ -+ g_subprocess_communicate_utf8 (f->xdg_open, NULL, NULL, &stdout_buf, -+ &stderr_buf, &error); -+ g_assert_cmpstr (stderr_buf, ==, ""); -+ g_assert_nonnull (stdout_buf); -+ g_test_message ("xdg-open --help: %s", stdout_buf); -+ g_assert_true (strstr (stdout_buf, "--version") != NULL); -+ -+ g_subprocess_wait_check (f->xdg_open, NULL, &error); -+ g_assert_no_error (error); -+} -+ -+static void -+test_uri (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autoptr(GError) error = NULL; -+ g_autoptr(GDBusMethodInvocation) invocation = NULL; -+ GVariant *parameters; -+ const gchar *window; -+ const gchar *uri; -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE); -+ g_subprocess_launcher_setenv (launcher, -+ "DBUS_SESSION_BUS_ADDRESS", -+ f->dbus_address, -+ TRUE); -+ -+ f->xdg_open = g_subprocess_launcher_spawn (launcher, &error, -+ f->xdg_open_path, -+ "http://example.com/", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->xdg_open); -+ -+ while (g_queue_get_length (&f->invocations) < 1) -+ g_main_context_iteration (NULL, TRUE); -+ -+ g_subprocess_wait_check (f->xdg_open, NULL, &error); -+ g_assert_no_error (error); -+ -+ g_assert_cmpuint (g_queue_get_length (&f->invocations), ==, 1); -+ invocation = g_queue_pop_head (&f->invocations); -+ -+ g_assert_cmpstr (g_dbus_method_invocation_get_interface_name (invocation), -+ ==, PORTAL_IFACE_NAME); -+ g_assert_cmpstr (g_dbus_method_invocation_get_method_name (invocation), -+ ==, "OpenURI"); -+ -+ parameters = g_dbus_method_invocation_get_parameters (invocation); -+ g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(ssa{sv})"); -+ g_variant_get (parameters, "(&s&sa{sv})", -+ &window, &uri, NULL); -+ g_assert_cmpstr (window, ==, ""); -+ g_assert_cmpstr (uri, ==, "http://example.com/"); -+} -+ -+static void -+test_file (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GSubprocessLauncher) launcher = NULL; -+ g_autoptr(GError) error = NULL; -+ g_autoptr(GDBusMethodInvocation) invocation = NULL; -+ GVariant *parameters; -+ const gchar *window; -+ gint32 handle; -+ GDBusMessage *message; -+ GUnixFDList *fd_list; -+ const int *fds; -+ struct stat ours, theirs; -+ -+ if (stat ("/dev/null", &ours) < 0) -+ g_error ("stat(/dev/null): %s", g_strerror (errno)); -+ -+ launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE); -+ g_subprocess_launcher_setenv (launcher, -+ "DBUS_SESSION_BUS_ADDRESS", -+ f->dbus_address, -+ TRUE); -+ -+ f->xdg_open = g_subprocess_launcher_spawn (launcher, &error, -+ f->xdg_open_path, -+ "/dev/null", -+ NULL); -+ g_assert_no_error (error); -+ g_assert_nonnull (f->xdg_open); -+ -+ while (g_queue_get_length (&f->invocations) < 1) -+ g_main_context_iteration (NULL, TRUE); -+ -+ g_subprocess_wait_check (f->xdg_open, NULL, &error); -+ g_assert_no_error (error); -+ -+ g_assert_cmpuint (g_queue_get_length (&f->invocations), ==, 1); -+ invocation = g_queue_pop_head (&f->invocations); -+ -+ g_assert_cmpstr (g_dbus_method_invocation_get_interface_name (invocation), -+ ==, PORTAL_IFACE_NAME); -+ g_assert_cmpstr (g_dbus_method_invocation_get_method_name (invocation), -+ ==, "OpenFile"); -+ -+ parameters = g_dbus_method_invocation_get_parameters (invocation); -+ g_assert_cmpstr (g_variant_get_type_string (parameters), ==, "(sha{sv})"); -+ g_variant_get (parameters, "(&sha{sv})", -+ &window, &handle, NULL); -+ g_assert_cmpstr (window, ==, ""); -+ g_assert_cmpint (handle, ==, 0); -+ -+ message = g_dbus_method_invocation_get_message (invocation); -+ g_assert_cmpuint (g_dbus_message_get_num_unix_fds (message), ==, 1); -+ fd_list = g_dbus_message_get_unix_fd_list (message); -+ fds = g_unix_fd_list_peek_fds (fd_list, NULL); -+ g_assert_cmpint (fds[0], >=, 0); -+ g_assert_cmpint (fds[1], ==, -1); -+ -+ if (fstat (fds[0], &theirs) < 0) -+ g_error ("stat(their fd): %s", g_strerror (errno)); -+ -+ /* It's really /dev/null */ -+ g_assert_cmpuint (ours.st_dev, ==, theirs.st_dev); -+ g_assert_cmpuint (ours.st_ino, ==, theirs.st_ino); -+} -+ -+static void -+teardown (Fixture *f, -+ gconstpointer context G_GNUC_UNUSED) -+{ -+ g_autoptr(GError) error = NULL; -+ gpointer free_me; -+ -+ for (free_me = g_queue_pop_head (&f->invocations); -+ free_me != NULL; -+ free_me = g_queue_pop_head (&f->invocations)) -+ g_object_unref (free_me); -+ -+ if (f->mock_object != 0) -+ g_dbus_connection_unregister_object (f->mock_conn, f->mock_object); -+ -+ if (f->dbus_daemon != NULL) -+ { -+ g_subprocess_send_signal (f->dbus_daemon, SIGTERM); -+ g_subprocess_wait (f->dbus_daemon, NULL, &error); -+ g_assert_no_error (error); -+ } -+ -+ g_clear_object (&f->dbus_daemon); -+ g_clear_object (&f->xdg_open); -+ g_clear_object (&f->mock_conn); -+ g_free (f->dbus_address); -+ g_free (f->xdg_open_path); -+ alarm (0); -+} -+ -+int -+main (int argc, -+ char **argv) -+{ -+ g_test_init (&argc, &argv, NULL); -+ -+ g_test_add ("/help", Fixture, NULL, setup, test_help, teardown); -+ g_test_add ("/uri", Fixture, NULL, setup, test_uri, teardown); -+ g_test_add ("/file", Fixture, NULL, setup, test_file, teardown); -+ -+ return g_test_run (); -+} diff -Nru flatpak-xdg-utils-1.0.0/debian/patches/series flatpak-xdg-utils-0.1/debian/patches/series --- flatpak-xdg-utils-1.0.0/debian/patches/series 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Add-backports-of-g_autoptr-for-compatibility-with-older-G.patch -Add-test-and-installed-test-coverage-for-xdg-tools.patch diff -Nru flatpak-xdg-utils-1.0.0/debian/rules flatpak-xdg-utils-0.1/debian/rules --- flatpak-xdg-utils-1.0.0/debian/rules 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/rules 2018-03-07 07:11:20.000000000 +0000 @@ -1,20 +1,27 @@ #!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 -export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-O1 -export LC_ALL=C.UTF-8 -include /usr/share/dpkg/default.mk +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + %: dh $@ -override_dh_auto_configure: - dh_auto_configure -- \ - --bindir=/usr/libexec/flatpak-xdg-utils \ - --libexecdir=/usr/libexec \ - -Dinstalled_tests=true \ - $(NULL) -override_dh_missing: - dh_missing --fail-missing +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + +override_dh_auto_configure: + ./autogen.sh --prefix=/usr diff -Nru flatpak-xdg-utils-1.0.0/debian/source/format flatpak-xdg-utils-0.1/debian/source/format --- flatpak-xdg-utils-1.0.0/debian/source/format 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/source/format 2018-03-07 07:11:20.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru flatpak-xdg-utils-1.0.0/debian/tests/control flatpak-xdg-utils-0.1/debian/tests/control --- flatpak-xdg-utils-1.0.0/debian/tests/control 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -Tests: gnome-desktop-testing -Depends: - flatpak-xdg-utils-tests, - gnome-desktop-testing, diff -Nru flatpak-xdg-utils-1.0.0/debian/tests/gnome-desktop-testing flatpak-xdg-utils-0.1/debian/tests/gnome-desktop-testing --- flatpak-xdg-utils-1.0.0/debian/tests/gnome-desktop-testing 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/tests/gnome-desktop-testing 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -exec 2>&1 - -exec gnome-desktop-testing-runner flatpak-xdg-utils diff -Nru flatpak-xdg-utils-1.0.0/debian/upstream/metadata flatpak-xdg-utils-0.1/debian/upstream/metadata --- flatpak-xdg-utils-1.0.0/debian/upstream/metadata 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ ---- -Name: flatpak-xdg-utils -Repository: https://github.com/flatpak/flatpak-xdg-utils -Repository-Browse: https://github.com/flatpak/flatpak-xdg-utils -Bug-Database: https://github.com/flatpak/flatpak-xdg-utils/issues -Bug-Submit: https://github.com/flatpak/flatpak-xdg-utils/issues/new -... -# vim:set ft=yaml: diff -Nru flatpak-xdg-utils-1.0.0/debian/watch flatpak-xdg-utils-0.1/debian/watch --- flatpak-xdg-utils-1.0.0/debian/watch 2019-01-18 10:29:06.000000000 +0000 +++ flatpak-xdg-utils-0.1/debian/watch 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -version=4 -https://github.com/flatpak/flatpak-xdg-utils/releases .*/flatpak-xdg-utils-(\d\S*)\.tar\.xz diff -Nru flatpak-xdg-utils-1.0.0/meson.build flatpak-xdg-utils-0.1/meson.build --- flatpak-xdg-utils-1.0.0/meson.build 2019-01-15 17:52:13.000000000 +0000 +++ flatpak-xdg-utils-0.1/meson.build 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -project( - 'flatpak-xdg-utils', 'c', - version: '1.0.0', - license: 'LGPL-2.1+', - default_options: [ - 'buildtype=debugoptimized', - 'warning_level=2', - ], - meson_version: '>= 0.46.0', -) - -conf = configuration_data() -conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) -conf.set_quoted('PACKAGE_VERSION', meson.project_version()) -conf.set('_GNU_SOURCE', 1) -config_h = configure_file(output: 'config.h', configuration: conf) - -gio_unix = dependency('gio-unix-2.0') - -subdir('src') diff -Nru flatpak-xdg-utils-1.0.0/src/Makefile.am flatpak-xdg-utils-0.1/src/Makefile.am --- flatpak-xdg-utils-1.0.0/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ flatpak-xdg-utils-0.1/src/Makefile.am 2018-03-07 07:11:06.000000000 +0000 @@ -0,0 +1,12 @@ +bin_PROGRAMS = xdg-open xdg-email + +xdg_open_SOURCES = xdg-open.c + +xdg_open_CFLAGS = $(FLATPAK_XDG_UTILS_CFLAGS) +xdg_open_LDADD = $(FLATPAK_XDG_UTILS_LIBS) + + +xdg_email_SOURCES = xdg-email.c + +xdg_email_CFLAGS = $(FLATPAK_XDG_UTILS_CFLAGS) +xdg_email_LDADD = $(FLATPAK_XDG_UTILS_LIBS) diff -Nru flatpak-xdg-utils-1.0.0/src/flatpak-spawn.c flatpak-xdg-utils-0.1/src/flatpak-spawn.c --- flatpak-xdg-utils-1.0.0/src/flatpak-spawn.c 2019-01-15 17:52:13.000000000 +0000 +++ flatpak-xdg-utils-0.1/src/flatpak-spawn.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,541 +0,0 @@ -/* - * Copyright © 2018 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Authors: - * Alexander Larsson - */ - -#include -#include -#include -#include -#include -#include -#include - -typedef enum { - FLATPAK_SPAWN_FLAGS_CLEAR_ENV = 1 << 0, - FLATPAK_SPAWN_FLAGS_LATEST_VERSION = 1 << 1, - FLATPAK_SPAWN_FLAGS_SANDBOX = 1 << 2, - FLATPAK_SPAWN_FLAGS_NO_NETWORK = 1 << 3, - FLATPAK_SPAWN_FLAGS_WATCH_BUS = 1 << 4, /* Since 1.2 */ -} FlatpakSpawnFlags; - -typedef enum { - FLATPAK_HOST_COMMAND_FLAGS_CLEAR_ENV = 1 << 0, - FLATPAK_HOST_COMMAND_FLAGS_WATCH_BUS = 1 << 1, /* Since 1.2 */ -} FlatpakHostCommandFlags; - -static GDBusConnection *session_bus = NULL; - -guint child_pid = 0; -gboolean opt_host; - -const char *service_iface; -const char *service_obj_path; -const char *service_bus_name; - -static void -spawn_exited_cb (G_GNUC_UNUSED GDBusConnection *connection, - G_GNUC_UNUSED const gchar *sender_name, - G_GNUC_UNUSED const gchar *object_path, - G_GNUC_UNUSED const gchar *interface_name, - G_GNUC_UNUSED const gchar *signal_name, - GVariant *parameters, - G_GNUC_UNUSED gpointer user_data) -{ - guint32 client_pid = 0; - guint32 exit_status = 0; - - if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(uu)"))) - return; - - g_variant_get (parameters, "(uu)", &client_pid, &exit_status); - g_debug ("child exited %d: %d", client_pid, exit_status); - - if (child_pid == client_pid) - { - int exit_code = 0; - - if (WIFEXITED (exit_status)) - { - exit_code = WEXITSTATUS (exit_status); - } - else if (WIFSIGNALED (exit_status)) - { - /* Smush the signal into an unsigned byte, as the shell does. This is - * not quite right from the perspective of whatever ran flatpak-spawn - * — it will get WIFEXITED() not WIFSIGNALED() — but the - * alternative is to disconnect all signal() handlers then send this - * signal to ourselves and hope it kills us. - */ - exit_code = 128 + WTERMSIG (exit_status); - } - else - { - /* wait(3p) claims that if the waitpid() call that returned the exit - * code specified neither WUNTRACED nor WIFSIGNALED, then exactly one - * of WIFEXITED() or WIFSIGNALED() will be true. - */ - g_warning ("exit status %d is neither WIFEXITED() nor WIFSIGNALED()", - exit_status); - /* EX_SOFTWARE "internal software error" from sysexits.h, for want of - * a better code. - */ - exit_status = 70; - } - - g_debug ("child exit code %d: %d", client_pid, exit_code); - exit (exit_code); - } -} - -static void -message_handler (G_GNUC_UNUSED const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - G_GNUC_UNUSED gpointer user_data) -{ - /* Make this look like normal console output */ - if (log_level & G_LOG_LEVEL_DEBUG) - g_printerr ("F: %s\n", message); - else - g_printerr ("%s: %s\n", g_get_prgname (), message); -} - -static gboolean -forward_signal_idle_cb (gpointer user_data) -{ - int sig = GPOINTER_TO_INT(user_data); - g_autoptr(GVariant) reply = NULL; - gboolean to_process_group = FALSE; - g_autoptr(GError) error = NULL; - - g_debug ("Forwarding signal: %d", sig); - - /* We forward stop requests as real stop, because the default doesn't - seem to be to stop for non-kernel sent TSTP??? */ - if (sig == SIGTSTP) - sig = SIGSTOP; - - /* ctrl-c/z is typically for the entire process group */ - if (sig == SIGINT || sig == SIGSTOP || sig == SIGCONT) - to_process_group = TRUE; - - reply = g_dbus_connection_call_sync (session_bus, - service_bus_name, - service_obj_path, - service_iface, - opt_host ? "HostCommandSignal" : "SpawnSignal", - g_variant_new ("(uub)", - child_pid, sig, to_process_group), - G_VARIANT_TYPE ("()"), - G_DBUS_CALL_FLAGS_NONE, - -1, NULL, &error); - - if (error) - g_debug ("Failed to forward signal: %s", error->message); - - if (sig == SIGSTOP) - { - g_debug ("SIGSTOP:ing flatpak-spawn"); - raise (SIGSTOP); - } - - return G_SOURCE_REMOVE; -} - -static void -forward_signal_handler (int sig) -{ - g_idle_add (forward_signal_idle_cb, GINT_TO_POINTER(sig)); -} - -static void -forward_signals (void) -{ - int forward[] = { - SIGHUP, SIGINT, SIGQUIT, SIGTERM, SIGCONT, SIGTSTP, SIGUSR1, SIGUSR2 - }; - guint i; - - for (i = 0; i < G_N_ELEMENTS(forward); i++) - signal (forward[i], forward_signal_handler); -} - -static void -name_owner_changed (G_GNUC_UNUSED GDBusConnection *connection, - G_GNUC_UNUSED const gchar *sender_name, - G_GNUC_UNUSED const gchar *object_path, - G_GNUC_UNUSED const gchar *interface_name, - G_GNUC_UNUSED const gchar *signal_name, - GVariant *parameters, - G_GNUC_UNUSED gpointer user_data) -{ - const char *name, *from, *to; - g_variant_get (parameters, "(sss)", &name, &from, &to); - - /* Check if the service dies, then we exit, because we can't track it anymore */ - if (strcmp (name, service_bus_name) == 0 && - strcmp (to, "") == 0) - { - g_debug ("portal exited"); - exit (1); - } -} - -static gboolean -command_specified (GPtrArray *child_argv, - GError **error) -{ - if (child_argv->len > 1) - return TRUE; - - g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, - "No command specified"); - return FALSE; -} - -static void -session_bus_closed_cb (G_GNUC_UNUSED GDBusConnection *bus, - G_GNUC_UNUSED gboolean remote_peer_vanished, - G_GNUC_UNUSED GError *error, - GMainLoop *loop) -{ - g_debug ("Session bus connection closed, quitting"); - g_main_loop_quit (loop); -} - -int -main (int argc, - char **argv) -{ - GMainLoop *loop; - g_autoptr(GError) error = NULL; - GOptionContext *context; - g_autoptr(GPtrArray) child_argv = NULL; - int i, opt_argc; - gboolean verbose = FALSE; - char **forward_fds = NULL; - char **opt_envs = NULL; - guint spawn_flags; - gboolean opt_clear_env = FALSE; - gboolean opt_watch_bus = FALSE; - gboolean opt_latest_version = FALSE; - gboolean opt_sandbox = FALSE; - gboolean opt_no_network = FALSE; - char **opt_sandbox_expose = NULL; - char **opt_sandbox_expose_ro = NULL; - g_autofree char *cwd = NULL; - GVariantBuilder options_builder; - const GOptionEntry options[] = { - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Enable debug output", NULL }, - { "forward-fd", 0, 0, G_OPTION_ARG_STRING_ARRAY, &forward_fds, "Forward file descriptor", "FD" }, - { "clear-env", 0, 0, G_OPTION_ARG_NONE, &opt_clear_env, "Run with clean environment", NULL }, - { "watch-bus", 0, 0, G_OPTION_ARG_NONE, &opt_watch_bus, "Make the spawned command exit if we do", NULL }, - { "env", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_envs, "Set environment variable", "VAR=VALUE" }, - { "latest-version", 0, 0, G_OPTION_ARG_NONE, &opt_latest_version, "Run latest version", NULL }, - { "sandbox", 0, 0, G_OPTION_ARG_NONE, &opt_sandbox, "Run sandboxed", NULL }, - { "no-network", 0, 0, G_OPTION_ARG_NONE, &opt_no_network, "Run without network access", NULL }, - { "sandbox-expose", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_sandbox_expose, "Expose access to named file", "NAME" }, - { "sandbox-expose-ro", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_sandbox_expose_ro, "Expose readonly access to named file", "NAME" }, - { "host", 0, 0, G_OPTION_ARG_NONE, &opt_host, "Start the command on the host", NULL }, - { NULL } - }; - - setlocale (LC_ALL, ""); - - g_setenv ("GIO_USE_VFS", "local", TRUE); - - g_set_prgname (argv[0]); - - child_argv = g_ptr_array_new (); - - cwd = g_get_current_dir (); - - i = 1; - while (i < argc && argv[i][0] == '-') - i++; - - opt_argc = i; - - while (i < argc) - { - g_ptr_array_add (child_argv, argv[i]); - i++; - } - g_ptr_array_add (child_argv, NULL); - - context = g_option_context_new ("COMMAND [ARGUMENT…]"); - - g_option_context_set_summary (context, "Run a command in a sandbox"); - g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); - - if (!g_option_context_parse (context, &opt_argc, &argv, &error) || - !command_specified (child_argv, &error)) - { - g_printerr ("%s: %s", g_get_application_name(), error->message); - g_printerr ("\n"); - g_printerr ("Try \"%s --help\" for more information.", - g_get_prgname ()); - g_printerr ("\n"); - g_option_context_free (context); - return 1; - } - - if (verbose) - g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL); - - session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); - if (session_bus == NULL) - { - g_printerr ("Can't find bus: %s\n", error->message); - return 1; - } - - if (opt_host) - { - service_iface = "org.freedesktop.Flatpak.Development"; - service_obj_path = "/org/freedesktop/Flatpak/Development"; - service_bus_name = "org.freedesktop.Flatpak"; - } - else - { - service_iface = "org.freedesktop.portal.Flatpak"; - service_obj_path = "/org/freedesktop/portal/Flatpak"; - service_bus_name = "org.freedesktop.portal.Flatpak"; - } - - g_dbus_connection_signal_subscribe (session_bus, - NULL, - service_iface, - opt_host ? "HostCommandExited" : "SpawnExited", - service_obj_path, - NULL, - G_DBUS_SIGNAL_FLAGS_NONE, - spawn_exited_cb, - NULL, NULL); - - g_autoptr(GVariantBuilder) fd_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{uh}")); - g_autoptr(GVariantBuilder) env_builder = g_variant_builder_new (G_VARIANT_TYPE ("a{ss}")); - g_autoptr(GUnixFDList) fd_list = g_unix_fd_list_new (); - gint stdin_handle = -1; - gint stdout_handle = -1; - gint stderr_handle = -1; - - stdin_handle = g_unix_fd_list_append (fd_list, 0, &error); - if (stdin_handle == -1) - { - g_printerr ("Can't append fd: %s\n", error->message); - return 1; - } - stdout_handle = g_unix_fd_list_append (fd_list, 1, &error); - if (stdout_handle == -1) - { - g_printerr ("Can't append fd: %s\n", error->message); - return 1; - } - stderr_handle = g_unix_fd_list_append (fd_list, 2, &error); - if (stderr_handle == -1) - { - g_printerr ("Can't append fd: %s\n", error->message); - return 1; - } - - g_variant_builder_add (fd_builder, "{uh}", 0, stdin_handle); - g_variant_builder_add (fd_builder, "{uh}", 1, stdout_handle); - g_variant_builder_add (fd_builder, "{uh}", 2, stderr_handle); - g_autoptr(GVariant) reply = NULL; - - for (i = 0; forward_fds != NULL && forward_fds[i] != NULL; i++) - { - int fd = strtol (forward_fds[i], NULL, 10); - gint handle = -1; - - if (fd == 0) - { - g_printerr ("Invalid fd '%s'\n", forward_fds[i]); - return 1; - } - - if (fd >= 0 && fd <= 2) - continue; // We always forward these - - handle = g_unix_fd_list_append (fd_list, fd, &error); - if (handle == -1) - { - g_printerr ("Can't append fd: %s\n", error->message); - return 1; - } - g_variant_builder_add (fd_builder, "{uh}", fd, handle); - } - - for (i = 0; opt_envs != NULL && opt_envs[i] != NULL; i++) - { - const char *opt_env = opt_envs[i]; - g_auto(GStrv) split = g_strsplit (opt_env, "=", 2); - - if (split == NULL || split[0] == NULL || split[0][0] == 0 || split[1] == NULL) - { - g_printerr ("Invalid env format %s\n", opt_env); - return 1; - } - g_variant_builder_add (env_builder, "{ss}", split[0], split[1]); - } - - spawn_flags = 0; - - if (opt_clear_env) - spawn_flags |= opt_host ? FLATPAK_HOST_COMMAND_FLAGS_CLEAR_ENV : FLATPAK_SPAWN_FLAGS_CLEAR_ENV; - - if (opt_watch_bus) - spawn_flags |= opt_host ? FLATPAK_HOST_COMMAND_FLAGS_WATCH_BUS : FLATPAK_SPAWN_FLAGS_WATCH_BUS; - - if (opt_latest_version) - { - if (opt_host) - { - g_printerr ("--host not compatible with --latest-version"); - return 1; - } - spawn_flags |= FLATPAK_SPAWN_FLAGS_LATEST_VERSION; - } - - if (opt_sandbox) - { - if (opt_host) - { - g_printerr ("--host not compatible with --sandbox"); - return 1; - } - spawn_flags |= FLATPAK_SPAWN_FLAGS_SANDBOX; - } - - if (opt_no_network) - { - if (opt_host) - { - g_printerr ("--host not compatible with --no-network"); - return 1; - } - spawn_flags |= FLATPAK_SPAWN_FLAGS_NO_NETWORK; - } - - g_variant_builder_init (&options_builder, G_VARIANT_TYPE ("a{sv}")); - - if (opt_sandbox_expose) - { - if (opt_host) - { - g_printerr ("--host not compatible with --sandbox-expose"); - return 1; - } - g_variant_builder_add (&options_builder, "{s@v}", "sandbox-expose", - g_variant_new_variant (g_variant_new_strv ((const char * const *)opt_sandbox_expose, -1))); - } - - if (opt_sandbox_expose_ro) - { - if (opt_host) - { - g_printerr ("--host not compatible with --sandbox-expose-ro"); - return 1; - } - g_variant_builder_add (&options_builder, "{s@v}", "sandbox-expose-ro", - g_variant_new_variant (g_variant_new_strv ((const char * const *)opt_sandbox_expose_ro, -1))); - } - - g_dbus_connection_signal_subscribe (session_bus, - "org.freedesktop.DBus", - "org.freedesktop.DBus", - "NameOwnerChanged", - "/org/freedesktop/DBus", - NULL, - G_DBUS_SIGNAL_FLAGS_NONE, - name_owner_changed, - NULL, NULL); - - { - g_autoptr(GVariant) fds = NULL; - g_autoptr(GVariant) env = NULL; - g_autoptr(GVariant) opts = NULL; - - fds = g_variant_ref_sink (g_variant_builder_end (g_steal_pointer (&fd_builder))); - env = g_variant_ref_sink (g_variant_builder_end (g_steal_pointer (&env_builder))); - opts = g_variant_ref_sink (g_variant_builder_end (&options_builder)); - -retry: - reply = g_dbus_connection_call_with_unix_fd_list_sync (session_bus, - service_bus_name, - service_obj_path, - service_iface, - opt_host ? "HostCommand" : "Spawn", - opt_host ? - g_variant_new ("(^ay^aay@a{uh}@a{ss}u)", - cwd, - (const char * const *) child_argv->pdata, - fds, - env, - spawn_flags) - : - g_variant_new ("(^ay^aay@a{uh}@a{ss}u@a{sv})", - cwd, - (const char * const *) child_argv->pdata, - fds, - env, - spawn_flags, - opts), - G_VARIANT_TYPE ("(u)"), - G_DBUS_CALL_FLAGS_NONE, - -1, - fd_list, - NULL, - NULL, &error); - - if (reply == NULL) - { - if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS) && - opt_watch_bus) - { - g_debug ("Got an invalid argument error; trying again without --watch-bus"); - - opt_watch_bus = FALSE; - spawn_flags &= opt_host ? ~FLATPAK_HOST_COMMAND_FLAGS_WATCH_BUS : ~FLATPAK_SPAWN_FLAGS_WATCH_BUS; - g_clear_error (&error); - - goto retry; - } - - g_dbus_error_strip_remote_error (error); - g_printerr ("Portal call failed: %s\n", error->message); - return 1; - } - - g_variant_get (reply, "(u)", &child_pid); - } - - g_debug ("child_pid: %d", child_pid); - - forward_signals (); - - loop = g_main_loop_new (NULL, FALSE); - - g_signal_connect (session_bus, "closed", G_CALLBACK (session_bus_closed_cb), loop); - - g_main_loop_run (loop); - - return 0; -} diff -Nru flatpak-xdg-utils-1.0.0/src/meson.build flatpak-xdg-utils-0.1/src/meson.build --- flatpak-xdg-utils-1.0.0/src/meson.build 2019-01-15 17:52:13.000000000 +0000 +++ flatpak-xdg-utils-0.1/src/meson.build 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -flatpak_spawn = executable( - 'flatpak-spawn', - sources: 'flatpak-spawn.c', - dependencies: [gio_unix], - c_args: ['-include', '@0@'.format(config_h)], - install: true, -) - -xdg_email = executable( - 'xdg-email', - sources: 'xdg-email.c', - dependencies: [gio_unix], - c_args: ['-include', '@0@'.format(config_h)], - install: true, -) - -xdg_open = executable( - 'xdg-open', - sources: 'xdg-open.c', - dependencies: [gio_unix], - c_args: ['-include', '@0@'.format(config_h)], - install: true, -) diff -Nru flatpak-xdg-utils-1.0.0/src/xdg-email.c flatpak-xdg-utils-0.1/src/xdg-email.c --- flatpak-xdg-utils-1.0.0/src/xdg-email.c 2019-01-15 17:52:13.000000000 +0000 +++ flatpak-xdg-utils-0.1/src/xdg-email.c 2018-03-07 07:11:06.000000000 +0000 @@ -43,7 +43,7 @@ static gboolean warn_ignored_parameter (const char *option_name, const char *value, - G_GNUC_UNUSED gpointer data, + gpointer data, GError **error); static GOptionEntry entries[] = { @@ -70,8 +70,8 @@ static gboolean warn_ignored_parameter (const char *option_name, const char *value, - G_GNUC_UNUSED gpointer data, - G_GNUC_UNUSED GError **error) + gpointer data, + GError **error) { g_printerr ("Option %s is not supported, ignoring value \"%s\"\n", option_name, value);