summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Akulich <akulichalexander@gmail.com>2021-01-26 18:23:28 +0300
committerAlexander Akulich <akulichalexander@gmail.com>2021-01-26 18:23:28 +0300
commitc5c0ed20267d530da5f8084d4fac664d95f31111 (patch)
tree5ca44db1e8a71058ceacfff7869c740c905cae6c
parent2ec2564642ca3c3e84cc7fc0c29c5da2567201dd (diff)
parent9c6c6fb5203d8cb73064a02cc6b147aa91908952 (diff)
downloadtelepathy-glib-c5c0ed20267d530da5f8084d4fac664d95f31111.tar.gz
Merge 'master' into telepathy-glib-0.24 (the branch has only fixes)
-rw-r--r--NEWS18
-rwxr-xr-xautogen.sh11
-rw-r--r--configure.ac2
-rw-r--r--telepathy-glib/Makefile.am2
-rw-r--r--telepathy-glib/base-password-channel.c3
-rw-r--r--telepathy-glib/call-channel.c2
-rw-r--r--telepathy-glib/debug-sender.c7
-rw-r--r--telepathy-glib/protocol.c4
-rw-r--r--telepathy-glib/util.h5
-rw-r--r--telepathy-glib/verify.h146
-rwxr-xr-xtests/all-errors-documented.py2
-rw-r--r--tests/dbus/Makefile.am2
-rw-r--r--tests/dbus/account.c8
-rw-r--r--tests/dbus/cm.c2
-rw-r--r--tests/dbus/contact-list-client.c4
-rw-r--r--tests/dbus/contact-lists.c2
-rw-r--r--tests/tools/expected-gtypes-body.h24
-rw-r--r--tests/tools/expected-gtypes.h10
-rw-r--r--tools/glib-gtypes-generator.py8
-rw-r--r--tools/make-release-mail.py10
-rw-r--r--tools/manager-file.py35
-rw-r--r--tools/xincludator.py9
22 files changed, 104 insertions, 212 deletions
diff --git a/NEWS b/NEWS
index b4ae41bb1..338245601 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,21 @@
+telepathy-glib 0.25.0 (UNRELEASED)
+==================================
+
+Fixes:
+
+• stop hardcoding python's path in .py scripts (fd.o #76495, Guillaume)
+• fixed some code issues discovered by compiling with clang
+ (fd.o #79006, Guillaume)
+• replaced tp_verify_* with G_STATIC_ASSERTs, fixing the build with
+ more recent gtk-doc (Simon)
+• autogen.sh: run gtkdocize from $srcdir in out-of-source builds
+ (fd.o #94391, Philip Withnall)
+• tests: fix build failure with glib >= 2.46 due to duplicate test paths
+ (fd.o #92245, George Kiagiadakis)
+• tests: Fix a service file path to fix the build with installed tests
+ (fd.o #90991, Philip Withnall)
+
+
telepathy-glib 0.24.1 (2014-08-25)
==================================
diff --git a/autogen.sh b/autogen.sh
index 3184e69a7..a47248cc4 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,8 @@
#!/bin/sh
set -e
-gtkdocize
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
if test -n "$AUTOMAKE"; then
: # don't override an explicit user request
@@ -16,7 +17,11 @@ elif automake-1.11 --version >/dev/null 2>/dev/null && \
export ACLOCAL
fi
-autoreconf -i -f
+(
+ cd "$srcdir"
+ gtkdocize
+ autoreconf -i -f
+)
# Honor NOCONFIGURE for compatibility with gnome-autogen.sh
if test x"$NOCONFIGURE" = x; then
@@ -35,5 +40,5 @@ else
fi
if test $run_configure = true; then
- ./configure "$@"
+ "$srcdir/configure" "$@"
fi
diff --git a/configure.ac b/configure.ac
index 9b19c5c0f..24fd10854 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,7 @@ AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 -Wno-portability subdir-objects])
AC_CONFIG_HEADERS(config.h)
-AM_SILENT_RULES
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl check for tools
AC_PROG_CC
diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am
index ce60d7d0b..fe642b29b 100644
--- a/telepathy-glib/Makefile.am
+++ b/telepathy-glib/Makefile.am
@@ -144,7 +144,7 @@ our_headers = \
tpginclude_HEADERS = \
$(our_headers) \
- verify.h
+ $(NULL)
BUILT_SOURCES = $(codegen_sources)
diff --git a/telepathy-glib/base-password-channel.c b/telepathy-glib/base-password-channel.c
index 7ca4ca270..93d37db85 100644
--- a/telepathy-glib/base-password-channel.c
+++ b/telepathy-glib/base-password-channel.c
@@ -387,11 +387,12 @@ tp_base_password_channel_class_init (TpBasePasswordChannelClass *tp_base_passwor
/**
* TpBasePasswordChannel::finished:
+ * @self: the #TpBasePasswordChannel
* @password: the password provided by the user, or %NULL if the
* authentication has been aborted
* @domain: domain of a #GError indicating why the authentication has been
* aborted, or 0
- * @code: error code of a GError indicating why the authentication has been
+ * @code: error code of a #GError indicating why the authentication has been
* aborted, or 0
* @message: a message associated with the error, or %NULL
*
diff --git a/telepathy-glib/call-channel.c b/telepathy-glib/call-channel.c
index 8ed76323b..2a1fa203d 100644
--- a/telepathy-glib/call-channel.c
+++ b/telepathy-glib/call-channel.c
@@ -525,6 +525,8 @@ update_call_members (TpCallChannel *self,
_tp_channel_contacts_queue_prepare_async ((TpChannel *) self,
contacts, update_call_members_prepared_cb, data);
+
+ g_ptr_array_unref (contacts);
}
static void
diff --git a/telepathy-glib/debug-sender.c b/telepathy-glib/debug-sender.c
index 599d9672a..1a5047109 100644
--- a/telepathy-glib/debug-sender.c
+++ b/telepathy-glib/debug-sender.c
@@ -82,6 +82,7 @@ struct _TpDebugSenderPrivate
gboolean enabled;
gboolean timestamps;
GQueue *messages;
+ GMutex messages_lock;
};
typedef struct {
@@ -192,7 +193,9 @@ tp_debug_sender_finalize (GObject *object)
{
TpDebugSender *self = TP_DEBUG_SENDER (object);
+ g_mutex_lock (&self->priv->messages_lock);
g_queue_foreach (self->priv->messages, (GFunc) debug_message_free, NULL);
+ g_mutex_unlock (&self->priv->messages_lock);
g_queue_free (self->priv->messages);
self->priv->messages = NULL;
@@ -288,6 +291,7 @@ get_messages (TpSvcDebug *self,
GList *i;
guint j;
+ g_mutex_lock (&dbg->priv->messages_lock);
messages = g_ptr_array_sized_new (g_queue_get_length (dbg->priv->messages));
for (i = dbg->priv->messages->head; i; i = i->next)
@@ -306,6 +310,7 @@ get_messages (TpSvcDebug *self,
G_MAXUINT);
g_ptr_array_add (messages, g_value_get_boxed (&gvalue));
}
+ g_mutex_unlock (&dbg->priv->messages_lock);
tp_svc_debug_return_from_get_messages (context, messages);
@@ -360,6 +365,7 @@ _tp_debug_sender_take (TpDebugSender *self,
DebugMessage *new_msg)
{
#ifdef ENABLE_DEBUG_CACHE
+ g_mutex_lock (&self->priv->messages_lock);
if (g_queue_get_length (self->priv->messages) >= DEBUG_MESSAGE_LIMIT)
{
DebugMessage *old_head =
@@ -369,6 +375,7 @@ _tp_debug_sender_take (TpDebugSender *self,
}
g_queue_push_tail (self->priv->messages, new_msg);
+ g_mutex_unlock (&self->priv->messages_lock);
#endif
if (self->priv->enabled)
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index b63730cd1..88fdff382 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -1791,7 +1791,7 @@ _tp_protocol_parse_manager_file (GKeyFile *file,
i++;
}
- param_specs = g_ptr_array_sized_new (i);
+ param_specs = g_ptr_array_new_full (i, tp_value_array_free);
for (key = keys; key != NULL && *key != NULL; key++)
{
@@ -1886,6 +1886,8 @@ _tp_protocol_parse_manager_file (GKeyFile *file,
TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST, param_specs,
NULL);
+ g_ptr_array_unref(param_specs);
+
tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_INTERFACES, G_TYPE_STRV,
g_key_file_get_string_list (file, group, "Interfaces", NULL, NULL));
tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_CONNECTION_INTERFACES,
diff --git a/telepathy-glib/util.h b/telepathy-glib/util.h
index af63a3a99..4c26d733c 100644
--- a/telepathy-glib/util.h
+++ b/telepathy-glib/util.h
@@ -30,9 +30,10 @@
#include <gio/gio.h>
#include <telepathy-glib/defs.h>
-#include <telepathy-glib/verify.h>
-#define tp_verify_statement(R) ((void) tp_verify_true (R))
+#define tp_verify_statement(R) ((void) G_STATIC_ASSERT_EXPR (R))
+#define tp_verify_true(R) (((void) G_STATIC_ASSERT_EXPR (R)), 1)
+#define tp_verify(R) G_STATIC_ASSERT (R)
G_BEGIN_DECLS
diff --git a/telepathy-glib/verify.h b/telepathy-glib/verify.h
deleted file mode 100644
index d46a46013..000000000
--- a/telepathy-glib/verify.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/* Compile-time assert-like macros.
-
- Imported from gnulib 20090701 and adapted to Telepathy namespace.
-
- Copyright (C) 2005, 2006 Free Software Foundation, 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 program 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 program. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
-
-#ifndef __TP_IN_UTIL_H__
-#error Not to be used directly, #include <telepathy-glib/util.h> instead
-#endif
-
-#ifndef TP_VERIFY_H
-# define TP_VERIFY_H 1
-
-/* Each of these macros verifies that its argument R is nonzero. To
- be portable, R should be an integer constant expression. Unlike
- assert (R), there is no run-time overhead.
-
- There are two macros, since no single macro can be used in all
- contexts in C. verify_true (R) is for scalar contexts, including
- integer constant expression contexts. verify (R) is for declaration
- contexts, e.g., the top level.
-
- Symbols ending in "__" are private to this header.
-
- The code below uses several ideas.
-
- * The first step is ((R) ? 1 : -1). Given an expression R, of
- integral or boolean or floating-point type, this yields an
- expression of integral type, whose value is later verified to be
- constant and nonnegative.
-
- * Next this expression W is wrapped in a type
- struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
- If W is negative, this yields a compile-time error. No compiler can
- deal with a bit-field of negative size.
-
- One might think that an array size check would have the same
- effect, that is, that the type struct { unsigned int dummy[W]; }
- would work as well. However, inside a function, some compilers
- (such as C++ compilers and GNU C) allow local parameters and
- variables inside array size expressions. With these compilers,
- an array size check would not properly diagnose this misuse of
- the verify macro:
-
- void function (int n) { verify (n < 0); }
-
- * For the verify macro, the struct verify_type__ will need to
- somehow be embedded into a declaration. To be portable, this
- declaration must declare an object, a constant, a function, or a
- typedef name. If the declared entity uses the type directly,
- such as in
-
- struct dummy {...};
- typedef struct {...} dummy;
- extern struct {...} *dummy;
- extern void dummy (struct {...} *);
- extern struct {...} *dummy (void);
-
- two uses of the verify macro would yield colliding declarations
- if the entity names are not disambiguated. A workaround is to
- attach the current line number to the entity name:
-
- #define GL_CONCAT0(x, y) x##y
- #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
- extern struct {...} * GL_CONCAT(dummy,__LINE__);
-
- But this has the problem that two invocations of verify from
- within the same macro would collide, since the __LINE__ value
- would be the same for both invocations.
-
- A solution is to use the sizeof operator. It yields a number,
- getting rid of the identity of the type. Declarations like
-
- extern int dummy [sizeof (struct {...})];
- extern void dummy (int [sizeof (struct {...})]);
- extern int (*dummy (void)) [sizeof (struct {...})];
-
- can be repeated.
-
- * Should the implementation use a named struct or an unnamed struct?
- Which of the following alternatives can be used?
-
- extern int dummy [sizeof (struct {...})];
- extern int dummy [sizeof (struct verify_type__ {...})];
- extern void dummy (int [sizeof (struct {...})]);
- extern void dummy (int [sizeof (struct verify_type__ {...})]);
- extern int (*dummy (void)) [sizeof (struct {...})];
- extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
-
- In the second and sixth case, the struct type is exported to the
- outer scope; two such declarations therefore collide. GCC warns
- about the first, third, and fourth cases. So the only remaining
- possibility is the fifth case:
-
- extern int (*dummy (void)) [sizeof (struct {...})];
-
- * This implementation exploits the fact that GCC does not warn about
- the last declaration mentioned above. If a future version of GCC
- introduces a warning for this, the problem could be worked around
- by using code specialized to GCC, e.g.,:
-
- #if 4 <= __GNUC__
- # define verify(R) \
- extern int (* verify_function__ (void)) \
- [__builtin_constant_p (R) && (R) ? 1 : -1]
- #endif
-
- * In C++, any struct definition inside sizeof is invalid.
- Use a template type to work around the problem. */
-
-
-/* Verify requirement R at compile-time, as an integer constant expression.
- Return 1. */
-
-# ifdef __cplusplus
-template <int w>
- struct tp_verify_type__ { unsigned int verify_error_if_negative_size__: w; };
-# define tp_verify_true(R) \
- (!!sizeof (tp_verify_type__<(R) ? 1 : -1>))
-# else
-# define tp_verify_true(R) \
- (!!sizeof \
- (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
-# endif
-
-/* Verify requirement R at compile-time, as a declaration without a
- trailing ';'. */
-
-# define tp_verify(R) extern int (* tp_verify_function__ (void)) [tp_verify_true (R)]
-
-#endif
diff --git a/tests/all-errors-documented.py b/tests/all-errors-documented.py
index ae66df55f..ad7d52d11 100755
--- a/tests/all-errors-documented.py
+++ b/tests/all-errors-documented.py
@@ -24,7 +24,7 @@ def check_all_errors_documented(abs_top_srcdir):
error.getAttribute('name').replace('.', '_').replace(' ', '_').upper())
if '%s\n' % name not in sections:
- print "'%s' is missing in %s" % (name, sections_path)
+ print("'%s' is missing in %s" % (name, sections_path))
sys.exit(1)
if __name__ == '__main__':
diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am
index 71f974c82..8cd47ca03 100644
--- a/tests/dbus/Makefile.am
+++ b/tests/dbus/Makefile.am
@@ -342,7 +342,7 @@ run-test.sh: run-test.sh.in
$< > $@
@chmod +x $@
-service_files = services/dbus-1/spurious.service
+service_files = dbus-1/services/spurious.service
if ENABLE_INSTALLED_TESTS
dbusservicedir = @tpglibtestsdir@/dbus-1/services
diff --git a/tests/dbus/account.c b/tests/dbus/account.c
index 1df043ab5..c10497869 100644
--- a/tests/dbus/account.c
+++ b/tests/dbus/account.c
@@ -980,7 +980,7 @@ main (int argc,
g_test_add ("/account/reconnect", Test, NULL, setup_service, test_reconnect,
teardown_service);
- g_test_add ("/account/reconnect", Test, "vardict", setup_service,
+ g_test_add ("/account/reconnect/vardict", Test, "vardict", setup_service,
test_reconnect, teardown_service);
g_test_add ("/account/prepare/success", Test, NULL, setup_service,
@@ -991,15 +991,15 @@ main (int argc,
g_test_add ("/account/storage", Test, "first", setup_service, test_storage,
teardown_service);
- g_test_add ("/account/storage", Test, "later", setup_service, test_storage,
- teardown_service);
+ g_test_add ("/account/storage/later", Test, "later", setup_service,
+ test_storage, teardown_service);
g_test_add ("/account/avatar", Test, NULL, setup_service, test_avatar,
teardown_service);
g_test_add ("/account/addressing", Test, "first", setup_service,
test_addressing, teardown_service);
- g_test_add ("/account/addressing", Test, "later", setup_service,
+ g_test_add ("/account/addressing/later", Test, "later", setup_service,
test_addressing, teardown_service);
return tp_tests_run_with_bus ();
diff --git a/tests/dbus/cm.c b/tests/dbus/cm.c
index ad4285475..e0f18eaa5 100644
--- a/tests/dbus/cm.c
+++ b/tests/dbus/cm.c
@@ -1187,7 +1187,7 @@ main (int argc,
g_test_add ("/cm/list", Test, GINT_TO_POINTER (0),
setup, test_list, teardown);
- g_test_add ("/cm/list", Test, GINT_TO_POINTER (USE_OLD_LIST),
+ g_test_add ("/cm/list/old", Test, GINT_TO_POINTER (USE_OLD_LIST),
setup, test_list, teardown);
return tp_tests_run_with_bus ();
diff --git a/tests/dbus/contact-list-client.c b/tests/dbus/contact-list-client.c
index a3f878a16..99c7a875c 100644
--- a/tests/dbus/contact-list-client.c
+++ b/tests/dbus/contact-list-client.c
@@ -505,7 +505,7 @@ test_is_blocked (Test *test,
static void
test_contact_list_properties (Test *test,
- gconstpointer data G_GNUC_UNUSED)
+ gconstpointer data)
{
gboolean props_only = GPOINTER_TO_UINT (data);
GQuark conn_features[] = { 0, 0 };
@@ -577,7 +577,7 @@ main (int argc,
g_test_add ("/contact-list-client/contact-list/properties", Test,
GUINT_TO_POINTER (FALSE), setup, test_contact_list_properties, teardown);
- g_test_add ("/contact-list-client/contact-list/properties", Test,
+ g_test_add ("/contact-list-client/contact-list/properties/props-only", Test,
GUINT_TO_POINTER (TRUE), setup, test_contact_list_properties, teardown);
return tp_tests_run_with_bus ();
diff --git a/tests/dbus/contact-lists.c b/tests/dbus/contact-lists.c
index 43ab26280..5e88a1829 100644
--- a/tests/dbus/contact-lists.c
+++ b/tests/dbus/contact-lists.c
@@ -2788,7 +2788,7 @@ main (int argc,
g_test_add ("/contact-lists/cancelled-publish-request",
Test, NULL, setup, test_cancelled_publish_request, teardown);
- g_test_add ("/contact-lists/cancelled-publish-request",
+ g_test_add ("/contact-lists/cancelled-publish-request/remove-after",
Test, "remove-after", setup, test_cancelled_publish_request, teardown);
g_test_add ("/contact-lists/add-to-stored",
diff --git a/tests/tools/expected-gtypes-body.h b/tests/tools/expected-gtypes-body.h
index ab1d7e99a..e575c818e 100644
--- a/tests/tools/expected-gtypes-body.h
+++ b/tests/tools/expected-gtypes-body.h
@@ -5,12 +5,12 @@
*/
GType
-the_prefix_type_dbus_hash_ss (void)
+the_prefix_type_dbus_hash_saa_7bsv_7d (void)
{
static GType t = 0;
if (G_UNLIKELY (t == 0))
- t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING);
+ t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_collection ("GPtrArray", (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)))));
return t;
}
@@ -25,22 +25,22 @@ the_prefix_type_dbus_hash_sa_7bsv_7d (void)
}
GType
-the_prefix_type_dbus_hash_sv (void)
+the_prefix_type_dbus_hash_ss (void)
{
static GType t = 0;
if (G_UNLIKELY (t == 0))
- t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE);
+ t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING);
return t;
}
GType
-the_prefix_type_dbus_hash_saa_7bsv_7d (void)
+the_prefix_type_dbus_hash_sv (void)
{
static GType t = 0;
if (G_UNLIKELY (t == 0))
- t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_collection ("GPtrArray", (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)))));
+ t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE);
return t;
}
@@ -69,32 +69,32 @@ the_prefix_type_dbus_array_isu (void)
}
GType
-the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void)
+the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void)
{
static GType t = 0;
if (G_UNLIKELY (t == 0))
- t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sa_7bsv_7d ());
+ t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_saa_7bsv_7d ());
return t;
}
GType
-the_prefix_type_dbus_array_of_a_7bsv_7d (void)
+the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void)
{
static GType t = 0;
if (G_UNLIKELY (t == 0))
- t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sv ());
+ t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sa_7bsv_7d ());
return t;
}
GType
-the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void)
+the_prefix_type_dbus_array_of_a_7bsv_7d (void)
{
static GType t = 0;
if (G_UNLIKELY (t == 0))
- t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_saa_7bsv_7d ());
+ t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sv ());
return t;
}
diff --git a/tests/tools/expected-gtypes.h b/tests/tools/expected-gtypes.h
index 2fc94e261..5164cab18 100644
--- a/tests/tools/expected-gtypes.h
+++ b/tests/tools/expected-gtypes.h
@@ -18,13 +18,13 @@
#define THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST_MAP_LIST (the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d ())
-GType the_prefix_type_dbus_hash_ss (void);
+GType the_prefix_type_dbus_hash_saa_7bsv_7d (void);
GType the_prefix_type_dbus_hash_sa_7bsv_7d (void);
-GType the_prefix_type_dbus_hash_sv (void);
+GType the_prefix_type_dbus_hash_ss (void);
-GType the_prefix_type_dbus_hash_saa_7bsv_7d (void);
+GType the_prefix_type_dbus_hash_sv (void);
#define THE_PREFIX_STRUCT_TYPE_STRUCT (the_prefix_type_dbus_struct_isu ())
@@ -34,9 +34,9 @@ GType the_prefix_type_dbus_struct_isu (void);
GType the_prefix_type_dbus_array_isu (void);
+GType the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void);
+
GType the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void);
GType the_prefix_type_dbus_array_of_a_7bsv_7d (void);
-GType the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void);
-
diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py
index 1477bd37b..5d0bd8905 100644
--- a/tools/glib-gtypes-generator.py
+++ b/tools/glib-gtypes-generator.py
@@ -213,7 +213,7 @@ class GTypesGenerator(object):
for mapping in mappings:
self.do_mapping_header(mapping)
- for sig in self.need_mappings:
+ for sig in sorted(self.need_mappings):
self.h('GType %stype_dbus_hash_%s (void);\n\n' %
(self.prefix_, self.need_mappings[sig]))
self.c('GType\n%stype_dbus_hash_%s (void)\n{\n' %
@@ -231,7 +231,7 @@ class GTypesGenerator(object):
for struct in structs:
self.do_struct_header(struct)
- for sig in self.need_structs:
+ for sig in sorted(self.need_structs):
self.h('GType %stype_dbus_struct_%s (void);\n\n' %
(self.prefix_, self.need_structs[sig]))
self.c('GType\n%stype_dbus_struct_%s (void)\n{\n' %
@@ -247,7 +247,7 @@ class GTypesGenerator(object):
self.c(' return t;\n')
self.c('}\n\n')
- for sig in self.need_struct_arrays:
+ for sig in sorted(self.need_struct_arrays):
self.h('GType %stype_dbus_array_%s (void);\n\n' %
(self.prefix_, self.need_struct_arrays[sig]))
self.c('GType\n%stype_dbus_array_%s (void)\n{\n' %
@@ -260,7 +260,7 @@ class GTypesGenerator(object):
self.c(' return t;\n')
self.c('}\n\n')
- for sig in self.need_other_arrays:
+ for sig in sorted(self.need_other_arrays):
self.h('GType %stype_dbus_array_of_%s (void);\n\n' %
(self.prefix_, self.need_other_arrays[sig]))
self.c('GType\n%stype_dbus_array_of_%s (void)\n{\n' %
diff --git a/tools/make-release-mail.py b/tools/make-release-mail.py
index b03ebd256..33438382b 100644
--- a/tools/make-release-mail.py
+++ b/tools/make-release-mail.py
@@ -28,8 +28,8 @@ def extract_description(package, version, news_path):
break
# Skip the ====== line, and the first blank line
- lines.next()
- lines.next()
+ next(lines)
+ next(lines)
got_release_name = False
@@ -59,7 +59,7 @@ GIT_URL = 'http://cgit.freedesktop.org/telepathy'
def main(package, version, news_path):
release_name, details = extract_description(package, version, news_path)
- print """
+ print("""
%(release_name)s
tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz
@@ -73,14 +73,14 @@ git: %(git_url)s/%(package)s
'version': version,
'release_name': release_name,
'details': details,
- }
+ })
if __name__ == '__main__':
try:
package, version, news_path = sys.argv[1:]
main(package, version, news_path)
- except ValueError, e:
+ except ValueError as e:
sys.stderr.write(
'Usage: %s package-name package.version.number path/to/NEWS\n' %
sys.argv[0])
diff --git a/tools/manager-file.py b/tools/manager-file.py
index e1b51a616..5e61c7558 100644
--- a/tools/manager-file.py
+++ b/tools/manager-file.py
@@ -25,6 +25,7 @@
import re
import sys
+import os
_NOT_C_STR = re.compile(r'[^A-Za-z0-9_-]')
@@ -87,18 +88,18 @@ gflags = {
def write_manager(f, manager, protos):
# pointless backwards compat section
- print >> f, '[ConnectionManager]'
- print >> f, 'BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager
- print >> f, 'ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager
+ print('[ConnectionManager]', file=f)
+ print('BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager, file=f)
+ print('ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager, file=f)
# protocols
- for proto, params in protos.iteritems():
- print >> f
- print >> f, '[Protocol %s]' % proto
+ for proto, params in protos.items():
+ print(file=f)
+ print('[Protocol %s]' % proto, file=f)
defaults = {}
- for param, info in params.iteritems():
+ for param, info in params.items():
dtype = info['dtype']
flags = info.get('flags', '').split()
struct_field = info.get('struct_field', param.replace('-', '_'))
@@ -115,15 +116,15 @@ def write_manager(f, manager, protos):
else:
flags = ''
- print >> f, 'param-%s=%s%s' % (param, desktop_string(dtype), flags)
+ print('param-%s=%s%s' % (param, desktop_string(dtype), flags), file=f)
- for param, default in defaults.iteritems():
- print >> f, 'default-%s=%s' % (param, default)
+ for param, default in defaults.items():
+ print('default-%s=%s' % (param, default), file=f)
def write_c_params(f, manager, proto, struct, params):
- print >> f, "static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto)
+ print("static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto), file=f)
- for param, info in params.iteritems():
+ for param, info in params.items():
dtype = info['dtype']
flags = info.get('flags', '').split()
struct_field = info.get('struct_field', param.replace('-', '_'))
@@ -146,7 +147,7 @@ def write_c_params(f, manager, proto, struct, params):
else:
struct_offset = 'G_STRUCT_OFFSET (%s, %s)' % (struct, struct_field)
- print >> f, (''' { %s, %s, %s,
+ print((''' { %s, %s, %s,
%s,
%s, /* default */
%s, /* struct offset */
@@ -154,14 +155,14 @@ def write_c_params(f, manager, proto, struct, params):
%s, /* filter data */
%s /* setter data */ },''' %
(c_string(param), c_string(dtype), gtypes[dtype], flags,
- default, struct_offset, filter, filter_data, setter_data))
+ default, struct_offset, filter, filter_data, setter_data)), file=f)
- print >> f, " { NULL }"
- print >> f, "};"
+ print(" { NULL }", file=f)
+ print("};", file=f)
if __name__ == '__main__':
environment = {}
- execfile(sys.argv[1], environment)
+ exec(compile(open(sys.argv[1], "rb").read(), sys.argv[1], 'exec'), environment)
filename = '%s/%s.manager' % (sys.argv[2], environment['MANAGER'])
try:
diff --git a/tools/xincludator.py b/tools/xincludator.py
index f9ed49ce4..5f852bfd0 100644
--- a/tools/xincludator.py
+++ b/tools/xincludator.py
@@ -38,9 +38,10 @@ if __name__ == '__main__':
xincludate(dom, argv[0])
if sys.version_info[0] >= 3:
- xml = dom.toxml(encoding=None)
+ xml = dom.toxml('utf-8')
+ stdout.buffer.write(xml)
+ stdout.buffer.write(b'\n')
else:
xml = dom.toxml()
-
- stdout.write(xml)
- stdout.write('\n')
+ stdout.write(xml)
+ stdout.write('\n')