Gentoo Archives: gentoo-commits

From: Nirbheek Chauhan <nirbheek@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:master commit in: dev-util/anjuta/files/
Date: Mon, 30 May 2011 17:16:10
Message-Id: 05ac06e70ef96e4fea9a06400e6d825adac3e0d9.nirbheek@gentoo
1 commit: 05ac06e70ef96e4fea9a06400e6d825adac3e0d9
2 Author: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 30 17:14:55 2011 +0000
4 Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 17:14:55 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=05ac06e7
7
8 dev-util/anjuta: add latest version of patch by tetromino
9
10 ---
11 .../anjuta/files/anjuta-3.0.2.0-autogen-5.11.patch | 73 +++++++++++++++-----
12 1 files changed, 55 insertions(+), 18 deletions(-)
13
14 diff --git a/dev-util/anjuta/files/anjuta-3.0.2.0-autogen-5.11.patch b/dev-util/anjuta/files/anjuta-3.0.2.0-autogen-5.11.patch
15 index 92f9acc..04cd467 100644
16 --- a/dev-util/anjuta/files/anjuta-3.0.2.0-autogen-5.11.patch
17 +++ b/dev-util/anjuta/files/anjuta-3.0.2.0-autogen-5.11.patch
18 @@ -1,33 +1,70 @@
19 -From 21dbcf252598da91237abbbb60442f95662cd522 Mon Sep 17 00:00:00 2001
20 +From a251ee54ebe822f1d92fc9434674b22623000233 Mon Sep 17 00:00:00 2001
21 From: Alexandre Rostovtsev <tetromino@×××××.com>
22 -Date: Mon, 23 May 2011 22:02:23 -0400
23 -Subject: [PATCH] Support autogen-5.11 detection (bug #650930)
24 +Date: Tue, 24 May 2011 16:43:55 -0400
25 +Subject: [PATCH] Support autogen-5.11.x detection, v3 (bug #650930)
26
27 -Autogen-5.11 uses a different version string format that autogen-5.9:
28 +The latest versions of autogen-5.11.x use a different version string
29 +format that autogen-5.9.x or earlier releases of 5.11.x:
30 autogen (GNU AutoGen) 5.11.9
31 vs.
32 autogen (GNU AutoGen) - The Automated Program Generator - Ver. 5.9.7
33
34 -Fortunately, all versions of autogen use the longer version of the
35 -string in their usage description. So we can detect modern versions
36 -of autogen simply by replacing autogen -v with autogen -u.
37 +Replace version matching code with a regex that should, hopefully,
38 +match everything from autogen-5.5.x to the latest 5.11.x (including
39 +the releases that don't have a micro version number).
40 ---
41 - plugins/project-wizard/autogen.c | 2 +-
42 - 1 files changed, 1 insertions(+), 1 deletions(-)
43 + plugins/project-wizard/autogen.c | 38 +++++++++++++++++++++++++-------------
44 + 1 files changed, 25 insertions(+), 13 deletions(-)
45
46 diff --git a/plugins/project-wizard/autogen.c b/plugins/project-wizard/autogen.c
47 -index ca6492a..0135cb8 100644
48 +index ca6492a..d38241b 100644
49 --- a/plugins/project-wizard/autogen.c
50 +++ b/plugins/project-wizard/autogen.c
51 -@@ -89,7 +89,7 @@ struct _NPWAutogen
52 - gboolean
53 - npw_check_autogen (void)
54 - {
55 -- gchar* args[] = {"autogen", "-v", NULL};
56 -+ gchar* args[] = {"autogen", "-u", NULL};
57 - gchar* output;
58 -
59 +@@ -95,19 +95,31 @@ npw_check_autogen (void)
60 if (g_spawn_sync (NULL, args, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL,
61 + NULL, NULL, &output, NULL, NULL, NULL))
62 + {
63 +- gint ver[3];
64 +- gchar* ptr;
65 +-
66 +- /* Check autogen */
67 +- if (strstr(output, "The Automated Program Generator") == NULL) return FALSE;
68 +-
69 +- /* Get version number */
70 +- ptr = strstr(output, "Ver. ");
71 +- if (ptr == NULL) return FALSE;
72 +- ptr += 5;
73 +- sscanf(ptr,"%d.%d.%d", &ver[0], &ver[1], &ver[2]);
74 +-
75 +- return (ver[0] == 5);
76 ++ GRegex *re;
77 ++ GMatchInfo *minfo;
78 ++ gboolean result = FALSE;
79 ++
80 ++ /* Check autogen 5 version string
81 ++ * Examples:
82 ++ * autogen - The Automated Program Generator - Ver. 5.5.7
83 ++ * autogen (GNU AutoGen) - The Automated Program Generator - Ver. 5.11
84 ++ * autogen (GNU AutoGen) 5.11.9
85 ++ */
86 ++ re = g_regex_new ("autogen.* (\\d)\\.(\\d+)(?:\\.(\\d+))?", 0, 0, NULL);
87 ++ g_regex_match (re, output, 0, &minfo);
88 ++ if (g_match_info_matches (minfo)) {
89 ++ gchar **match_strings;
90 ++
91 ++ match_strings = g_match_info_fetch_all (minfo);
92 ++ /* if major version is 5 */
93 ++ if (g_ascii_strtoll (match_strings[1], 0, 10) == 5)
94 ++ result = TRUE;
95 ++
96 ++ g_strfreev (match_strings);
97 ++ }
98 ++ g_match_info_free (minfo);
99 ++ g_regex_unref (re);
100 ++ return result;
101 + }
102 +
103 + return FALSE;
104 --
105 1.7.5.rc3