head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.12 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.10 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.8 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.6 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.4 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.2 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.1.1.1.0.18 pkgsrc-2008Q3-base:1.1.1.1 cube-native-xorg:1.1.1.1.0.16 cube-native-xorg-base:1.1.1.1 pkgsrc-2008Q2:1.1.1.1.0.14 pkgsrc-2008Q2-base:1.1.1.1 cwrapper:1.1.1.1.0.12 pkgsrc-2008Q1:1.1.1.1.0.10 pkgsrc-2008Q1-base:1.1.1.1 pkgsrc-2007Q4:1.1.1.1.0.8 pkgsrc-2007Q4-base:1.1.1.1 pkgsrc-2007Q3:1.1.1.1.0.6 pkgsrc-2007Q3-base:1.1.1.1 pkgsrc-2007Q2:1.1.1.1.0.4 pkgsrc-2007Q2-base:1.1.1.1 pkgsrc-2007Q1:1.1.1.1.0.2 pkgsrc-2007Q1-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2008.10.28.11.28.31; author wiz; state dead; branches; next 1.1; 1.1 date 2007.01.04.02.51.02; author rillig; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2007.01.04.02.51.02; author rillig; state Exp; branches; next ; desc @@ 1.2 log @Update to 2.24.1: Changes in 2.24.1 * Fix #541694 - new modules and packaged are not displayed in dialog until the project is reloaded * Fixed some warnings * Translation updates: ar, sk Changes in 2.24.0 * Removed gdl-gnome dependency * Fix format string bugs * Translation updates: ru, hu, cs, da, ml, ar, tr, ja, it, de, nl, en_GB, fr, nb, gu, fi, eu, pt Changes in 2.23.90 * Bumped version to be consistent with gnome releases. * Fixed bug #517047 - Port to GOption * Replace deprecated INCLUDES with AM_CPPFLAGS * Add a new chooser to select pkg-config modules in the target configuration (related to bug #393679) * Fixed bug #463561 and bug #538952 - Removed deprecated and unused build code thus removing the regex depency * Fixed bug #522715 - Typo & missing libglade-2.0 entry in configure.in * Fixed bug #475244 - Do not add AC_SUBST() after PKG_CHECK_MODULE * Translation updates: et, ar, es, ca, sv, pt_BR, mr, fi, eu, pt, nb, he, sq, zh_HK, zh_TW, gl, th, oc, bg Changes in 0.3.0 * Fixed #515997 – Fails to build from source * Added methods to access the list of pkg-config packages required for building the project (to be used for symbol autocompletion for example). * Added a conveniece check for the returned packages * Fixed two mem-leaks. Changes in 0.2.3 * Check for Locale::gettext which is required. * Translation updates for si, pt, fi, gl, en_GB, nb, ne, es, th, fr and de. Changes in 0.2.2 * COPYING: Fixed license. * Fixed bug #503526 (translation issues) * Translation updates for eu, es, sv, nb, fi, oc, pt, ar and pt_BR. Changes in 0.2.1 * Fixed #476315 - Anjuta set _LDADD for shared object * Fixed #475280 - _HEADERS not defined * Added support for SRC_SUBDIRS like it's used in gtk+ * Add support for check_PROGRAM (bug #474617) * Improve gnome-build EXTRA_DIST support (bug #463408) * Added localisation through gettext() * Migrated to use po/LINGUAS * Changed variable detection rule to also match ${VAR} (bug #450604) * Removed check_LTLIBRARIES restriction, added expanding vars in SUBDIRS (bug #450604) * Append data to a macro rather than overwrite it if an assignment is split into several lines (#510351) @ text @$NetBSD: patch-aa,v 1.1 2007/01/04 02:51:02 rillig Exp $ Replaced the GNU regular expressions with POSIX regular expressions, since the latter are more portable. --- src/backends/libgbf_am/gbf-am-build.c.orig 2004-01-17 22:34:56.000000000 +0100 +++ src/backends/libgbf_am/gbf-am-build.c 2007-01-04 03:16:49.000000000 +0100 @@@@ -38,10 +38,11 @@@@ typedef struct { GList *callbacks; /* Regex structures. */ - struct re_pattern_buffer dir_buf; - struct re_pattern_buffer warn_buf; - struct re_pattern_buffer err_buf; - struct re_registers reg; + regex_t dir_buf; + regex_t warn_buf; + regex_t err_buf; +#define N_GROUPS 5 /* 1 + maximum number of groups + 1 */ + regmatch_t reg[N_GROUPS]; /* Build info. */ char *build_dir; @@@@ -55,12 +56,9 @@@@ build_info_free (BuildInfo *info) if (info->build_dir) g_free (info->build_dir); - if (info->dir_buf.fastmap) - g_free (info->dir_buf.fastmap); - if (info->warn_buf.fastmap) - g_free (info->warn_buf.fastmap); - if (info->err_buf.fastmap) - g_free (info->err_buf.fastmap); + regfree (&info->dir_buf); + regfree (&info->warn_buf); + regfree (&info->err_buf); g_free (info); } @@@@ -79,33 +77,36 @@@@ build_msg (BuildInfo *info, } } +/* Returns a copy of the ''n''th captured group. */ +#define GBF_GETGROUP(n) \ + g_strndup (line + info->reg[n].rm_so, \ + info->reg[n].rm_eo - info->reg[n].rm_so) + static void parse_output (BuildInfo *info, const char *line) { - int line_length = strlen (line); + size_t line_length = strlen (line); + int n; /* Check for directory changes. */ - if (re_search (&info->dir_buf, line, line_length, 0, - line_length, &info->reg) != -1) { - if (info->reg.num_regs >= 2) { - if (info->build_dir) - g_free (info->build_dir); - info->build_dir = g_strndup (line + info->reg.start[1], - info->reg.end[1] - info->reg.start[1]); - } + if (regexec (&info->dir_buf, line, N_GROUPS, info->reg, 0) == 0) { + g_assert (info->reg[1].rm_so != -1 && info->reg[2].rm_so == -1); + if (info->build_dir) + g_free (info->build_dir); + info->build_dir = GBF_GETGROUP(1); } /* Check for warnings & errors. */ - if (re_search (&info->warn_buf, line, line_length, 0, - line_length, &info->reg) != -1) { + if (regexec (&info->warn_buf, line, N_GROUPS, info->reg, 0) == 0) { GbfBuildWarning *warn; char *text; + g_assert (info->reg[3].rm_so != -1 && info->reg[4].rm_so == -1); + /* Create new warning. */ warn = g_new0 (GbfBuildWarning, 1); - text = g_strndup (line + info->reg.start[1], - info->reg.end[1] - info->reg.start[1]); + text = GBF_GETGROUP(1); if (text[0] != '/') { /* only prepend build_dir if path not absolute */ warn->filename = g_strconcat (info->build_dir, "/", text, NULL); g_free (text); @@@@ -113,25 +114,21 @@@@ parse_output (BuildInfo *info, warn->filename = text; } - text = g_strndup (line + info->reg.start[2], - info->reg.end[2] - info->reg.start[2]); + text = GBF_GETGROUP(2); warn->line = atoi (text); g_free (text); - warn->warning = g_strndup (line + info->reg.start[3], - info->reg.end[3] - info->reg.start[3]); + warn->warning = GBF_GETGROUP(3); warn->output = g_strdup (line); build_msg (info, GBF_BUILD_WARNING, warn); /* FIXME: We should free warn here, and make copy in gbf-build-info.c. */ - } else if (re_search (&info->err_buf, line, line_length, 0, - line_length, &info->reg) != -1) { + } else if (regexec (&info->err_buf, line, N_GROUPS, info->reg, 0) == 0) { GbfBuildError *err; char *text; /* Create new error. */ err = g_new0 (GbfBuildError, 1); - text = g_strndup (line + info->reg.start[1], - info->reg.end[1] - info->reg.start[1]); + text = GBF_GETGROUP(1); if (text[0] != '/') { /* only prepend build_dir if path not absolute */ err->filename = g_strconcat (info->build_dir, "/", text, NULL); g_free (text); @@@@ -139,12 +136,10 @@@@ parse_output (BuildInfo *info, err->filename = text; } - text = g_strndup (line + info->reg.start[2], - info->reg.end[2] - info->reg.start[2]); + text = GBF_GETGROUP(2); err->line = atoi (text); g_free (text); - err->error = g_strndup (line + info->reg.start[3], - info->reg.end[3] - info->reg.start[3]); + err->error = GBF_GETGROUP(3); err->output = g_strdup (line); build_msg (info, GBF_BUILD_ERROR, err); @@@@ -153,6 +148,7 @@@@ parse_output (BuildInfo *info, build_msg (info, GBF_BUILD_OUTPUT, (gpointer)line); } } +#undef GBF_GETGROUP(n) static gboolean build_output_cb (GIOChannel *chan, @@@@ -192,24 +188,10 @@@@ build_output_cb (GIOChannel *chan, } static gboolean -compile_pattern (struct re_pattern_buffer *buf, +compile_pattern (regex_t *buf, const char *pattern) { - memset (buf, 0, sizeof (struct re_pattern_buffer)); - buf->translate = NULL; - buf->fastmap = g_malloc (256); - buf->allocated = 0; - buf->buffer = NULL; - buf->can_be_null = 0; - buf->no_sub = 0; - - if (!re_compile_pattern (pattern, strlen (pattern), buf)) { - if (re_compile_fastmap (buf) != 0) { - g_warning ("IMPORTANT REGEX FAILED TO CREASTE FASTMAP"); - g_free (buf->fastmap); - buf->fastmap = NULL; - } - } else { + if (regcomp(buf, pattern, REG_EXTENDED) != 0) { g_warning ("IMPORTANT REGEX FAILED TO COMPILE"); return FALSE; } @@@@ -234,7 +216,6 @@@@ gbf_build_run (GbfAmProject *project, char *tmp, *msg; int output, err, pid; GIOChannel *out_channel, *err_channel; - reg_syntax_t old_options; GError *error = NULL; const char *charset; GNode *g_node; @@@@ -347,9 +328,6 @@@@ gbf_build_run (GbfAmProject *project, info->build_dir = NULL; /* Intialize regexs. */ - old_options = re_syntax_options; - re_syntax_options = RE_SYNTAX_EGREP; - if (!compile_pattern (&info->dir_buf, dir_regex) || !compile_pattern (&info->warn_buf, warn_regex) || !compile_pattern (&info->err_buf, err_regex)) { @@@@ -360,8 +338,6 @@@@ gbf_build_run (GbfAmProject *project, return -1; } - re_syntax_options = old_options; - g_signal_emit_by_name (G_OBJECT (project), "build_start"); tmp = g_strjoinv (" ", (char **) argv); @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @Imported gnome-build. This is the GNOME Build Framework (GBF). @ text @@