I made those changes, but then ran into a problem. If you set
--with-backup-prefix to soemthing in a pound sign e.g; .# or #
...things blow up Makefile.am does not seem to have any facility
for escaping interpolated values, and apparently pounds signs
aren't portable in Makefile variable values anyhow.

  http://lists.gnu.org/archive/html/automake/2011-08/msg00023.html

Consequently tests will fail for these particular settings like so:

make  check-TESTS
make[2]: Entering directory `/home/belg4mit/nmh'
/bin/sh: -c: line 9: unexpected EOF while looking for matching `''
/bin/sh: -c: line 91: syntax error: unexpected end of file
make[2]: *** [check-TESTS] Error 2

Although if one can manage to escape the value as in the Makefile
as shown below, the tests will pass:

BACKUP_PREFIX = .\#
diff --git a/Makefile.am b/Makefile.am
index 91a915f..254ac26 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,6 +41,7 @@ TESTS_ENVIRONMENT = MH_OBJ_DIR="@abs_builddir@" \
                    default_locking="${default_locking}" \
                    MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \
                    ICONV_ENABLED=$(ICONV_ENABLED) \
+                   BACKUP_PREFIX='@BACKUP_PREFIX@' \
                    $(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT.
 ##
 ## Important note: the "cleanup" test should always be last
diff --git a/configure.ac b/configure.ac
index 932809a..2ea405c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,12 +47,14 @@ AS_IF([test x"$with_tls" != x -a x"$with_tls" != x"no"],[
       tls_support=yes],[tls_support=no])
 
 dnl Set the backup prefix
-AC_ARG_WITH([hash-backup],
-  AS_HELP_STRING([--with-hash-backup],[use # as the backup prefix (default: 
,)]))
-AS_IF([test x"$with_hash_backup" != x -a x"$with_hash_backup" != x"no"],
-      [backup_prefix="#"], [backup_prefix=","])
+AC_ARG_WITH([backup-prefix],
+  AS_HELP_STRING([--with-backup-prefix=ARG],[use alternate backup prefix 
(default w/o switch: ,)]))
+AS_IF([test x"$with_backup_prefix" != x -a x"$with_backup_prefix" != x"no"],
+      [backup_prefix="$with_backup_prefix"],
+      [backup_prefix=","])
 AC_DEFINE_UNQUOTED([BACKUP_PREFIX], "$backup_prefix",
-    [The prefix that is prepended to the name of message files when they are 
"removed" by rmm. This should typically be `,' or `#'.])dnl
+    [The prefix that is prepended to the name of message files when they are 
"removed" by rmm. This will typically be `,' or `#'.])dnl
+AC_SUBST([BACKUP_PREFIX], "$backup_prefix")
 
 dnl What method of posting should post use?
 AC_ARG_WITH([mts],
diff --git a/test/common.sh.in b/test/common.sh.in
index 67b18a8..dad223b 100644
--- a/test/common.sh.in
+++ b/test/common.sh.in
@@ -17,8 +17,9 @@ test -z "$supported_locks"  &&  
supported_locks="@supported_locks@"
 test -z "$default_locking"  &&  default_locking="@default_locking@"
 test -z "$MULTIBYTE_ENABLED"  &&  MULTIBYTE_ENABLED="@MULTIBYTE_ENABLED@"
 test -z "$ICONV_ENABLED"  &&  ICONV_ENABLED="@ICONV_ENABLED@"
+test -z "$BACKUP_PREFIX"  &&  BACKUP_PREFIX="@BACKUP_PREFIX@"
 export MH_TEST_DIR auxexecdir bindir mandir sysconfdir
-export MULTIBYTE_ENABLED ICONV_ENABLED
+export MULTIBYTE_ENABLED ICONV_ENABLED BACKUP_PREFIX
 
 test -z "$MH_INST_DIR"  &&  MH_INST_DIR="${MH_TEST_DIR}/inst"
 export MH_INST_DIR
diff --git a/test/mhbuild/test-attach b/test/mhbuild/test-attach
index 6d5a594..fcf4761 100755
--- a/test/mhbuild/test-attach
+++ b/test/mhbuild/test-attach
@@ -17,7 +17,7 @@ setup_test
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
-backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
+backup="${MH_TEST_DIR}/${BACKUP_PREFIX}$$.draft.orig"
 expected="$MH_TEST_DIR/$$.expected"
 
 #
diff --git a/test/mhbuild/test-cte b/test/mhbuild/test-cte
index f996e73..d21f1de 100755
--- a/test/mhbuild/test-cte
+++ b/test/mhbuild/test-cte
@@ -19,7 +19,7 @@ set -e
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
-backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
+backup="${MH_TEST_DIR}/${BACKUP_PREFIX}$$.draft.orig"
 expected="$MH_TEST_DIR/$$.expected"
 
 #
diff --git a/test/mhbuild/test-ext-params b/test/mhbuild/test-ext-params
index adde9d9..cba355d 100755
--- a/test/mhbuild/test-ext-params
+++ b/test/mhbuild/test-ext-params
@@ -17,7 +17,7 @@ setup_test
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
-backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
+backup="${MH_TEST_DIR}/${BACKUP_PREFIX}$$.draft.orig"
 expected="$MH_TEST_DIR/$$.expected"
 
 #
diff --git a/test/mhbuild/test-forw b/test/mhbuild/test-forw
index 771bec0..c4f167c 100755
--- a/test/mhbuild/test-forw
+++ b/test/mhbuild/test-forw
@@ -27,7 +27,7 @@ EOF
 }
 
 draft="$MH_TEST_DIR/$$.draft"
-draftorig="$MH_TEST_DIR/,$$.draft.orig"
+draftorig="$MH_TEST_DIR/${BACKUP_PREFIX}$$.draft.orig"
 expected="$MH_TEST_DIR/$$.expected"
 actual="$MH_TEST_DIR/$$.actual"
 
diff --git a/test/mhbuild/test-header-encode b/test/mhbuild/test-header-encode
index e4883b5..ef7c375 100755
--- a/test/mhbuild/test-header-encode
+++ b/test/mhbuild/test-header-encode
@@ -16,7 +16,7 @@ fi
 
 setup_test
 testname="${MH_TEST_DIR}/$$"
-backupname="${MH_TEST_DIR}/`mhparam sbackup`$$"
+backupname="${MH_TEST_DIR}/${BACKUP_PREFIX}$$"
 
 #
 # We're going to hardcode UTF-8 for this test.
diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg
index d60b9d7..f33eb6a 100755
--- a/test/mhfixmsg/test-mhfixmsg
+++ b/test/mhfixmsg/test-mhfixmsg
@@ -172,7 +172,7 @@ folder last >/dev/null
 run_test 'mhfixmsg' ''
 check "$expected" "$MH_TEST_DIR"/Mail/inbox/11 'keep first'
 cp "$MH_TEST_DIR"/Mail/inbox/11.original "$MH_TEST_DIR"/Mail/inbox/11
-check "$MH_TEST_DIR"/Mail/inbox/,11 "$MH_TEST_DIR"/Mail/inbox/11.original
+check "$MH_TEST_DIR"/Mail/inbox/${BACKUP_PREFIX}11 
"$MH_TEST_DIR"/Mail/inbox/11.original
 
 
 # check backup with -file
@@ -180,7 +180,7 @@ cp "$MH_TEST_DIR"/Mail/inbox/11 
"$MH_TEST_DIR"/Mail/inbox/11.original
 folder last >/dev/null
 run_test 'mhfixmsg -file '"$MH_TEST_DIR"/Mail/inbox/11 ''
 check "$MH_TEST_DIR"/Mail/inbox/11 "$expected" 'keep first'
-check "$MH_TEST_DIR"/Mail/inbox/,11 "$MH_TEST_DIR"/Mail/inbox/11.original
+check "$MH_TEST_DIR"/Mail/inbox/${BACKUP_PREFIX}11 
"$MH_TEST_DIR"/Mail/inbox/11.original
 
 
 # check -reformat (enabled by default):  addition of text/plain part
@@ -1082,7 +1082,7 @@ cp "${MH_TEST_DIR}/Mail/inbox/19" 
"${MH_TEST_DIR}/Mail/inbox/20"
 
 run_test 'mhfixmsg 19 -normmproc'
 check "${MH_TEST_DIR}/Mail/inbox/20" \
-      "${MH_TEST_DIR}/Mail/inbox/,19" 'keep first'
+      "${MH_TEST_DIR}/Mail/inbox/${BACKUP_PREFIX}19" 'keep first'
 
 
 # check -rmmproc
diff --git a/test/mhparam/test-mhparam b/test/mhparam/test-mhparam
index 89bcb5d..cba3097 100755
--- a/test/mhparam/test-mhparam
+++ b/test/mhparam/test-mhparam
@@ -100,6 +100,7 @@ $bindir/whatnow
 $bindir/whom
 $sysconfdir
 ${MH_LIB_DIR}
+${BACKUP_PREFIX}
 fcntl
 ${default_locking}
 EOF
@@ -128,6 +129,7 @@ whatnowproc \
 whomproc \
 etcdir \
 libdir \
+sbackup \
 datalocking \
 spoollocking >$actual 2>&1
 
@@ -136,13 +138,6 @@ check $expected $actual
 #### This exits with non-zero status, so let run_test squash that:
 run_test 'mhparam formatproc rmmproc' ''
 
-#### Test sbackup separately because it's only passed as a -D compile option.
-case `mhparam sbackup` in
-  ,|\#) ;;
-  *   ) echo mhparam sbackup failed
-        failed=`expr ${failed:-0} + 1` ;;
-esac
-
 # check -component
 run_test 'mhparam -component Path' "Path: $MH_TEST_DIR/Mail"
 
diff --git a/test/refile/test-refile b/test/refile/test-refile
index 645f4f1..aa82e42 100755
--- a/test/refile/test-refile
+++ b/test/refile/test-refile
@@ -172,7 +172,7 @@ run_test 'folders -noheader' \
 other  has 6 messages  (1-12).
 
 TOTAL = 12 messages in 2 folders.'
-if test -f $MH_TEST_DIR/Mail/inbox/,3; then
+if test -f $MH_TEST_DIR/Mail/inbox/${BACKUP_PREFIX}3; then
   echo "$0: refile -unlink failed" 1>&2
   failed=`expr ${failed:-0} + 1`
 fi
@@ -184,7 +184,7 @@ run_test 'folders -noheader' \
 other  has 7 messages  (1-13).
 
 TOTAL = 12 messages in 2 folders.'
-if test -f $MH_TEST_DIR/Mail/inbox/,2; then
+if test -f $MH_TEST_DIR/Mail/inbox/${BACKUP_PREFIX}2; then
   :
 else
   echo "$0: refile -nounlink failed" 1>&2
_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

Reply via email to