[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
/floppy/ac-patches/96-fyi-m4-append-uniq.patch
From: |
Akim Demaille |
Subject: |
/floppy/ac-patches/96-fyi-m4-append-uniq.patch |
Date: |
Thu, 13 Sep 2001 08:56:17 +0200 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): New.
* lib/autotest/general.m4 (AT_VICTIMS, AT_KEYWORDS, _AT_CLEANUP_FILE):
Use it.
Index: lib/autotest/general.m4
--- lib/autotest/general.m4 Wed, 12 Sep 2001 23:47:08 +0200 akim
+++ lib/autotest/general.m4 Wed, 12 Sep 2001 23:54:18 +0200 akim
@@ -614,7 +614,7 @@ m4_define([AS_MESSAGE_LOG_FD], [6])
# must correspond to the version of the package.. The PATH should be
# already preset so the proper executable will be selected.
m4_define([AT_VICTIMS],
-[m4_append([AT_victims], [$1], [ ])])
+[m4_append_uniq([AT_victims], [$1], [ ])])
# AT_SETUP(DESCRIPTION)
@@ -642,25 +642,14 @@ m4_define([AT_ordinal], m4_incr(AT_ordin
# ---------------------
# Declare a list of keywords associated to the current test group.
m4_define([AT_KEYWORDS],
-[m4_append([AT_keywords], [$1], [,])])
-
-
-
-# _AT_CLEANUP_FILE_IF(FILE, IF-REGISTERED, IF-NOT-REGISTERED)
-# -----------------------------------------------------------
-# We try to build a regular expression matching `[', `]', `*', and
-# `.', i.e., the regexp active characters.
-m4_define([_AT_CLEANUP_FILE_IF],
-[m4_match(AT_data_files, m4_re_escape([ $1 ]),
- [$2], [$3])])
+[m4_append_uniq([AT_keywords], [$1], [,])])
# _AT_CLEANUP_FILE(FILE)
# ----------------------
# Register FILE for AT_CLEANUP.
m4_define([_AT_CLEANUP_FILE],
-[_AT_CLEANUP_FILE_IF([$1], [],
- [m4_append([AT_data_files], [$1 ])])])
+[m4_append_uniq([AT_data_files], [$1], [ ])])
# AT_CLEANUP_FILES(FILES)
Index: lib/m4sugar/m4sugar.m4
--- lib/m4sugar/m4sugar.m4 Wed, 12 Sep 2001 23:47:08 +0200 akim
+++ lib/m4sugar/m4sugar.m4 Wed, 12 Sep 2001 23:54:35 +0200 akim
@@ -1520,6 +1520,16 @@ m4_define([m4_append],
m4_ifdef([$1], [m4_defn([$1])$3])[$2])])
+# m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR])
+# -----------------------------------------------
+# As `m4_append', but append only if not yet present.
+m4_define([m4_append_uniq],
+[m4_ifdef([$1],
+ [m4_match([$3]m4_defn([$1])[$3], m4_re_escape([$3$2$3]), [],
+ [m4_append($@)])],
+ [m4_append($@)])])
+
+
# m4_foreach_quoted(VARIABLE, LIST, EXPRESSION)
# ---------------------------------------------
# FIXME: This macro should not exists. Currently it's used only in
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- /floppy/ac-patches/96-fyi-m4-append-uniq.patch,
Akim Demaille <=