[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-workers] [PATCH] Make xterm usage configurable
From: |
Eric Gillespie |
Subject: |
[Nmh-workers] [PATCH] Make xterm usage configurable |
Date: |
Thu, 14 Aug 2008 14:04:50 -0700 |
The default behavior of throwing new xterms at me out of nowhere
is horribly annoying.
=== modified file 'ChangeLog'
--- ChangeLog 2008-08-15 02:47:29 +0000
+++ ChangeLog 2008-08-14 21:01:03 +0000
@@ -1,5 +1,20 @@
2008-08-14 Eric Gillespie <address@hidden>
+ * test/setup-test: Run configure --without-xterm.
+
+ * etc/mhn.defaults.sh.cfg.in: Add file, with just xtermpath.
+
+ * etc/mhn.defaults.sh: Load mhn.defaults.sh.cfg and use xtermpath,
+ possibly skipping the xterm line entirely.
+
+ * etc/Makefile.in: Pass mhn.defaults.sh.cfg to mhn.defaults.sh and
+ make mhn.defaults depend on it. Remove mhn.defaults on error.
+
+ * configure.in: AC_SUBST(xtermpath) from --with-xterm.
+ Add etc/mhn.defaults.sh.cfg to AC_CONFIG_FILES.
+
+2008-08-14 Eric Gillespie <address@hidden>
+
* test/setup-test: Don't run autogen.sh unless needed. Build in a
blddir under the temporary directory so as not to interfere with
whatever the developer may be doing in the source directory.
=== modified file 'configure.in'
--- configure.in 2008-08-06 04:06:00 +0000
+++ configure.in 2008-08-14 20:36:08 +0000
@@ -223,6 +223,13 @@
fi
AC_SUBST(smtpservers)dnl
+dnl xterm, for mhn.defaults
+AC_ARG_WITH(xterm,
+ AS_HELP_STRING([--with-xterm=XTERM],[specify xterm ('no' to disable)]))
+if test -n "$with_xterm"; then
+ xtermpath="$with_xterm"
+fi
+
dnl ----------------------------------------------------
dnl Default location is /usr/local/nmh/{bin,etc,lib,man}
dnl ----------------------------------------------------
@@ -401,6 +408,12 @@
fi
AC_SUBST(editorpath)dnl
+dnl If xterm is not specified yet, then use `xterm' as the default.
+if test -z "$xtermpath"; then
+ xtermpath=xterm
+fi
+AC_SUBST(xtermpath)dnl
+
dnl ----------------------------------------------------------
dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
dnl ----------------------------------------------------------
@@ -1056,7 +1069,8 @@
dnl ----------------
AC_CONFIG_FILES(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
mts/Makefile mts/smtp/Makefile \
- etc/Makefile docs/Makefile man/Makefile)
+ etc/Makefile docs/Makefile man/Makefile
+ etc/mhn.defaults.sh.cfg)
AC_CONFIG_COMMANDS([stamp],[test -z "$CONFIG_HEADERS" || echo > stamp-h])
AC_OUTPUT
=== modified file 'etc/Makefile.in'
--- etc/Makefile.in 2006-03-04 22:14:18 +0000
+++ etc/Makefile.in 2008-08-14 20:10:37 +0000
@@ -34,6 +34,9 @@
# handle MIME content. Used to create mhn.defaults
MHNSEARCHPROG = $(srcdir)/mhn.find.sh
+# configure-generated info for mhn.defaults.sh (in blddir)
+MHNCONF = mhn.defaults.sh.cfg
+
SED = sed
.SUFFIXES:
@@ -67,9 +70,9 @@
all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
-mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
- rm -f $@
- $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
+mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG) $(MHNCONF)
+ $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) \
+ `pwd`/$(MHNCONF) > $@ || rm -f $@
mts.conf: $(srcdir)/mts.conf.in Makefile
rm -f $@
=== modified file 'etc/mhn.defaults.sh'
--- etc/mhn.defaults.sh 2000-04-12 00:25:23 +0000
+++ etc/mhn.defaults.sh 2008-08-14 21:03:17 +0000
@@ -22,6 +22,11 @@
SEARCHPROG="mhn.find.sh"
fi
+# If a conf file is passed to the script, load it.
+if [ -n "$3" ]; then
+ . "$3"
+fi
+
# put output into a temporary file, so we
# can sort it before output.
TMP=/tmp/nmh_temp.$$
@@ -154,9 +159,19 @@
echo "mhshow-suffix-application/msword: .doc" >> $TMP
fi
-PGM="`$SEARCHPROG $SEARCHPATH xterm`"
-if [ ! -z "$PGM" ]; then
- echo "mhshow-charset-iso-8859-1: xterm -fn
'-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s" >> $TMP
+if [ "$xtermpath" != 'no' ]; then
+ if [ -n "$xtermpath" ]; then
+ if [ "$xtermpath" = "${xtermpath#/}" ]; then
+ # $xtermpath contains a relative path; find full path.
+ PGM="`$SEARCHPROG $SEARCHPATH $xtermpath`"
+ else
+ # $xtermpath contains an absolute path; use it directly.
+ PGM="$xtermpath"
+ fi
+ else
+ PGM="`$SEARCHPROG $SEARCHPATH xterm`"
+ fi
+ echo "mhshow-charset-iso-8859-1: $PGM -fn
'-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s" >> $TMP
fi
# output a sorted version of the file
=== added file 'etc/mhn.defaults.sh.cfg.in'
--- etc/mhn.defaults.sh.cfg.in 1970-01-01 00:00:00 +0000
+++ etc/mhn.defaults.sh.cfg.in 2008-08-14 20:56:26 +0000
@@ -0,0 +1,1 @@
address@hidden@
=== modified file 'test/setup-test'
--- test/setup-test 2008-08-15 02:47:29 +0000
+++ test/setup-test 2008-08-14 21:01:26 +0000
@@ -18,7 +18,8 @@
srcdir=$PWD
mkdir $TEMPDIR/bld
cd $TEMPDIR/bld
-$srcdir/configure --prefix=$TEMPDIR --with-locking=fcntl --enable-debug
+$srcdir/configure --prefix=$TEMPDIR --with-locking=fcntl --without-xterm \
+ --enable-debug
make install
echo "Path: $TEMPDIR/Mail" > $TEMPDIR/mh_profile