2013-01-04 01:21:03

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 1/3] build: Do not use deprecated AM_CONFIG_HEADER

From: Lucas De Marchi <[email protected]>

The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13.
Use AC_CONFIG_HEADERS instead.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index cdfc013..e8193ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_INIT(bluez, 5.0)

AM_INIT_AUTOMAKE([foreign subdir-objects color-tests silent-rules
tar-pax no-dist-gzip dist-xz])
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
AC_USE_SYSTEM_EXTENSIONS

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
--
1.8.1



2013-01-10 15:10:06

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH BlueZ 3/3] gitignore: Ignore file generated by Automake 1.13

On Fri, Jan 4, 2013 at 3:32 AM, Marcel Holtmann <[email protected]> wrote:
> Hi Lucas,
>
>> ---
>> .gitignore | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/.gitignore b/.gitignore
>> index 04c9862..619f492 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -25,6 +25,7 @@ ltmain.sh
>> missing
>> stamp-h1
>> autom4te.cache
>> +test-driver
>
> no idea what this is. I do not have that. What is it actually.


it seems to be a helper for running tests in parallel. There's this
while configuring:

parallel-tests: installing './test-driver'


Lucas De Marchi

2013-01-10 14:59:29

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH BlueZ 1/3] build: Do not use deprecated AM_CONFIG_HEADER

On Thu, Jan 10, 2013 at 12:47 PM, Vinicius Costa Gomes
<[email protected]> wrote:
> Hi Lucas,
>
> On 23:21 Thu 03 Jan, Lucas De Marchi wrote:
>> From: Lucas De Marchi <[email protected]>
>>
>> The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13.
>> Use AC_CONFIG_HEADERS instead.
>
> I think oFono and neard are still missing this fix. Would you care to
> send it?
>

Sure. Thanks for the prod.


Lucas De Marchi

2013-01-10 14:47:34

by Vinicius Costa Gomes

[permalink] [raw]
Subject: Re: [PATCH BlueZ 1/3] build: Do not use deprecated AM_CONFIG_HEADER

Hi Lucas,

On 23:21 Thu 03 Jan, Lucas De Marchi wrote:
> From: Lucas De Marchi <[email protected]>
>
> The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13.
> Use AC_CONFIG_HEADERS instead.

I think oFono and neard are still missing this fix. Would you care to
send it?


Cheers,
--
Vinicius

2013-01-04 05:32:56

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH BlueZ 3/3] gitignore: Ignore file generated by Automake 1.13

Hi Lucas,

> ---
> .gitignore | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/.gitignore b/.gitignore
> index 04c9862..619f492 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -25,6 +25,7 @@ ltmain.sh
> missing
> stamp-h1
> autom4te.cache
> +test-driver

no idea what this is. I do not have that. What is it actually.

Regards

Marcel



2013-01-04 05:32:11

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH BlueZ 2/3] gdbus: Simplify generated introspection

Hi Lucas,

> The generated introspection is not supposed to be read as is by human,
> so there's no point in printing the indentation or writing more code to
> use auto-close tags.
>
> If it's desired to read the raw xml file, user can always use other
> tools to transform the output such as "xmllint --format".
>
> This also fixes a missing </property> when property is deprecated.
> ---
> gdbus/object.c | 103 +++++++++++++++++++++------------------------------------
> 1 file changed, 38 insertions(+), 65 deletions(-)

patch has been applied.

Regards

Marcel



2013-01-04 05:29:35

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH BlueZ 1/3] build: Do not use deprecated AM_CONFIG_HEADER

Hi Lucas,

> The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13.
> Use AC_CONFIG_HEADERS instead.
> ---
> configure.ac | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied.

For extra credits, you could update the other projects as well.

Regards

Marcel



2013-01-04 01:21:05

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 3/3] gitignore: Ignore file generated by Automake 1.13

From: Lucas De Marchi <[email protected]>

---
.gitignore | 1 +
1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 04c9862..619f492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ ltmain.sh
missing
stamp-h1
autom4te.cache
+test-driver

lib/bluez.pc
lib/bluetooth
--
1.8.1


2013-01-04 01:21:04

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 2/3] gdbus: Simplify generated introspection

From: Lucas De Marchi <[email protected]>

The generated introspection is not supposed to be read as is by human,
so there's no point in printing the indentation or writing more code to
use auto-close tags.

If it's desired to read the raw xml file, user can always use other
tools to transform the output such as "xmllint --format".

This also fixes a missing </property> when property is deprecated.
---
gdbus/object.c | 103 +++++++++++++++++++++------------------------------------
1 file changed, 38 insertions(+), 65 deletions(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index b9cb284..2b6ae31 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -97,7 +97,7 @@ static void print_arguments(GString *gstr, const GDBusArgInfo *args,
{
for (; args && args->name; args++) {
g_string_append_printf(gstr,
- "\t\t\t<arg name=\"%s\" type=\"%s\"",
+ "<arg name=\"%s\" type=\"%s\"",
args->name, args->signature);

if (direction)
@@ -109,15 +109,15 @@ static void print_arguments(GString *gstr, const GDBusArgInfo *args,
}
}

-#define G_DBUS_ANNOTATE(prefix_, name_, value_) \
- prefix_ "<annotation name=\"org.freedesktop.DBus." name_ "\" " \
- "value=\"" value_ "\"/>\n"
+#define G_DBUS_ANNOTATE(name_, value_) \
+ "<annotation name=\"org.freedesktop.DBus." name_ "\" " \
+ "value=\"" value_ "\"/>"

-#define G_DBUS_ANNOTATE_DEPRECATED(prefix_) \
- G_DBUS_ANNOTATE(prefix_, "Deprecated", "true")
+#define G_DBUS_ANNOTATE_DEPRECATED \
+ G_DBUS_ANNOTATE("Deprecated", "true")

-#define G_DBUS_ANNOTATE_NOREPLY(prefix_) \
- G_DBUS_ANNOTATE(prefix_, "Method.NoReply", "true")
+#define G_DBUS_ANNOTATE_NOREPLY \
+ G_DBUS_ANNOTATE("Method.NoReply", "true")

static gboolean check_experimental(int flags, int flag)
{
@@ -134,85 +134,58 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
const GDBusPropertyTable *property;

for (method = iface->methods; method && method->name; method++) {
- gboolean deprecated = method->flags &
- G_DBUS_METHOD_FLAG_DEPRECATED;
- gboolean noreply = method->flags &
- G_DBUS_METHOD_FLAG_NOREPLY;
-
if (check_experimental(method->flags,
G_DBUS_METHOD_FLAG_EXPERIMENTAL))
continue;

- if (!deprecated && !noreply &&
- !(method->in_args && method->in_args->name) &&
- !(method->out_args && method->out_args->name))
- g_string_append_printf(gstr,
- "\t\t<method name=\"%s\"/>\n",
- method->name);
- else {
+ g_string_append_printf(gstr, "<method name=\"%s\">",
+ method->name);
+ print_arguments(gstr, method->in_args, "in");
+ print_arguments(gstr, method->out_args, "out");
+
+ if (method->flags & G_DBUS_METHOD_FLAG_DEPRECATED)
g_string_append_printf(gstr,
- "\t\t<method name=\"%s\">\n",
- method->name);
- print_arguments(gstr, method->in_args, "in");
- print_arguments(gstr, method->out_args, "out");
-
- if (deprecated)
- g_string_append_printf(gstr,
- G_DBUS_ANNOTATE_DEPRECATED("\t\t\t"));
- if (noreply)
- g_string_append_printf(gstr,
- G_DBUS_ANNOTATE_NOREPLY("\t\t\t"));
-
- g_string_append_printf(gstr, "\t\t</method>\n");
- }
+ G_DBUS_ANNOTATE_DEPRECATED);
+
+ if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY)
+ g_string_append_printf(gstr, G_DBUS_ANNOTATE_NOREPLY);
+
+ g_string_append_printf(gstr, "</method>");
}

for (signal = iface->signals; signal && signal->name; signal++) {
- gboolean deprecated = signal->flags &
- G_DBUS_SIGNAL_FLAG_DEPRECATED;
-
if (check_experimental(signal->flags,
G_DBUS_SIGNAL_FLAG_EXPERIMENTAL))
continue;

- if (!deprecated && !(signal->args && signal->args->name))
- g_string_append_printf(gstr,
- "\t\t<signal name=\"%s\"/>\n",
- signal->name);
- else {
- g_string_append_printf(gstr,
- "\t\t<signal name=\"%s\">\n",
- signal->name);
- print_arguments(gstr, signal->args, NULL);
+ g_string_append_printf(gstr, "<signal name=\"%s\">",
+ signal->name);
+ print_arguments(gstr, signal->args, NULL);

- if (deprecated)
- g_string_append_printf(gstr,
- G_DBUS_ANNOTATE_DEPRECATED("\t\t\t"));
+ if (signal->flags & G_DBUS_SIGNAL_FLAG_DEPRECATED)
+ g_string_append_printf(gstr,
+ G_DBUS_ANNOTATE_DEPRECATED);

- g_string_append_printf(gstr, "\t\t</signal>\n");
- }
+ g_string_append_printf(gstr, "</signal>\n");
}

for (property = iface->properties; property && property->name;
property++) {
- gboolean deprecated = property->flags &
- G_DBUS_PROPERTY_FLAG_DEPRECATED;
-
if (check_experimental(property->flags,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL))
continue;

- g_string_append_printf(gstr, "\t\t<property name=\"%s\""
- " type=\"%s\" access=\"%s%s\"",
+ g_string_append_printf(gstr, "<property name=\"%s\""
+ " type=\"%s\" access=\"%s%s\">",
property->name, property->type,
property->get ? "read" : "",
property->set ? "write" : "");

- if (!deprecated)
- g_string_append_printf(gstr, "/>\n");
- else
+ if (property->flags & G_DBUS_PROPERTY_FLAG_DEPRECATED)
g_string_append_printf(gstr,
- G_DBUS_ANNOTATE_DEPRECATED(">\n\t\t\t"));
+ G_DBUS_ANNOTATE_DEPRECATED);
+
+ g_string_append_printf(gstr, "</property>");
}
}

@@ -228,30 +201,30 @@ static void generate_introspection_xml(DBusConnection *conn,

gstr = g_string_new(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE);

- g_string_append_printf(gstr, "<node>\n");
+ g_string_append_printf(gstr, "<node>");

for (list = data->interfaces; list; list = list->next) {
struct interface_data *iface = list->data;

- g_string_append_printf(gstr, "\t<interface name=\"%s\">\n",
+ g_string_append_printf(gstr, "<interface name=\"%s\">",
iface->name);

generate_interface_xml(gstr, iface);

- g_string_append_printf(gstr, "\t</interface>\n");
+ g_string_append_printf(gstr, "</interface>");
}

if (!dbus_connection_list_registered(conn, path, &children))
goto done;

for (i = 0; children[i]; i++)
- g_string_append_printf(gstr, "\t<node name=\"%s\"/>\n",
+ g_string_append_printf(gstr, "<node name=\"%s\"/>",
children[i]);

dbus_free_string_array(children);

done:
- g_string_append_printf(gstr, "</node>\n");
+ g_string_append_printf(gstr, "</node>");

data->introspect = g_string_free(gstr, FALSE);
}
--
1.8.1