[prev in list] [next in list] [prev in thread] [next in thread]
List: mandoc-source
Subject: mdocml: Now that our man.conf(5) format is mature and extremely simple,
From: schwarze () mdocml ! bsd ! lv
Date: 2016-07-19 22:41:04
Message-ID: 3747644195995136562.enqueue () fantadrom ! bsd ! lv
[Download RAW message or body]
Log Message:
-----------
Now that our man.conf(5) format is mature and extremely simple,
delete manpath(1) support. With the mandoc-based man(1), manpath(1)
is utterly useless. Just set MANPATH_DEFAULT in configure.local
for sane operating system defaults, use man.conf(5) for machine-
specific modifications, and use ${MANPATH}, -m, and -M for user
preferences.
Modified Files:
--------------
mdocml:
INSTALL
configure
configure.local.example
makewhatis.8
mandocdb.c
manpath.c
Revision Data
-------------
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.15 -r1.16
--- configure.local.example
+++ configure.local.example
@@ -49,9 +49,9 @@ HAVE_WCHAR=1
HAVE_WCHAR=0
# When man(1) or apropos(1) is called without -m and -M options,
-# MANPATH is not set in the environment, man.conf(5) is not available
-# and manpath(1) not used, manuals are searched for in the following
-# directory trees by default.
+# MANPATH is not set in the environment, and man.conf(5) is not
+# available, manuals are searched for in the following directory
+# trees by default.
MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man"
@@ -79,19 +79,6 @@ SBINDIR="${PREFIX}/sbin"
INCLUDEDIR="${PREFIX}/include/mandoc"
LIBDIR="${PREFIX}/lib/mandoc"
MANDIR="${PREFIX}/man"
-
-# The man(1) utility needs to know where the manuals reside.
-# We know of two ways to tell it: via manpath(1) or man.conf(5).
-# The latter is used by OpenBSD and NetBSD, the former by most
-# other systems.
-
-# Force usage of manpath(1).
-# If it is not installed or not operational,
-# man(1), makewhatis(8), and apropos(1) will not work properly.
-HAVE_MANPATH=1
-
-# Force usage of man.conf(5).
-HAVE_MANPATH=0
# Some distributions may want to avoid naming conflicts
# with the configuration files of other man(1) implementations.
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.44
retrieving revision 1.45
diff -Lconfigure -Lconfigure -u -p -r1.44 -r1.45
--- configure
+++ configure
@@ -51,6 +51,7 @@ HAVE_GETLINE=
HAVE_GETSUBOPT=
HAVE_ISBLANK=
HAVE_MKDTEMP=
+HAVE_OHASH=
HAVE_PLEDGE=
HAVE_PROGNAME=
HAVE_REALLOCARRAY=
@@ -67,9 +68,6 @@ HAVE_STRTONUM=
HAVE_VASPRINTF=
HAVE_WCHAR=
-HAVE_OHASH=
-HAVE_MANPATH=
-
PREFIX="/usr/local"
BINDIR=
SBINDIR=
@@ -217,21 +215,6 @@ echo "LDADD=\"${LDADD}\"" 1>&2
echo "LDADD=\"${LDADD}\"" 1>&3
echo 1>&3
-# --- manpath ---
-if ismanual manpath "${HAVE_MANPATH}"; then
- :
-elif manpath 1>&3 2>&3; then
- echo "manpath: yes" 1>&2
- echo "manpath: yes" 1>&3
- echo 1>&3
- HAVE_MANPATH=1
-else
- echo "manpath: no" 1>&2
- echo "manpath: no" 1>&3
- echo 1>&3
- HAVE_MANPATH=0
-fi
-
# --- write config.h ---
exec > config.h
@@ -287,7 +270,6 @@ cat << __HEREDOC__
#define HAVE_VASPRINTF ${HAVE_VASPRINTF}
#define HAVE_WCHAR ${HAVE_WCHAR}
#define HAVE_OHASH ${HAVE_OHASH}
-#define HAVE_MANPATH ${HAVE_MANPATH}
#define BINM_APROPOS "${BINM_APROPOS}"
#define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
Index: INSTALL
===================================================================
RCS file: /home/cvs/mdocml/mdocml/INSTALL,v
retrieving revision 1.16
retrieving revision 1.17
diff -LINSTALL -LINSTALL -u -p -r1.16 -r1.17
--- INSTALL
+++ INSTALL
@@ -35,7 +35,11 @@ To install mandoc manually, the followin
command "echo BUILD_CGI=1 > configure.local". Then run "cp
cgi.h.examples cgi.h" and edit cgi.h as desired.
-2. Run "./configure".
+2. Define MANPATH_DEFAULT in configure.local
+if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate
+for your operating system.
+
+3. Run "./configure".
This script attempts autoconfiguration of mandoc for your system.
Read both its standard output and the file "Makefile.local" it
generates. If anything looks wrong or different from what you
@@ -45,26 +49,19 @@ result seems right to you.
On Solaris 10 and earlier, you may have to run "ksh ./configure"
because the native /bin/sh lacks some POSIX features.
-3. Run "make".
+4. Run "make".
Any POSIX-compatible make, in particular both BSD make and GNU make,
should work. If the build fails, look at "configure.local.example"
and go back to step 2.
-4. Run "make -n install" and check whether everything will be
+5. Run "make -n install" and check whether everything will be
installed to the intended places. Otherwise, put some *DIR or *NM*
-variables into "configure.local" and go back to step 2.
+variables into "configure.local" and go back to step 3.
-5. Run "sudo make install". If you intend to build a binary
+6. Run "sudo make install". If you intend to build a binary
package using some kind of fake root mechanism, you may need a
command like "make DESTDIR=... install". Read the *-install targets
in the "Makefile" to understand how DESTDIR is used.
-
-6. If you want to use the integrated man(1) and your system uses
-manpath(1), make sure it is configured correctly, in particular,
-it returns all directory trees where manual pages are installed.
-Otherwise, if your system uses man.conf(5), make sure it contains
-a "manpath" line for each directory tree, and the order of these
-lines meets your wishes.
7. Run the command "sudo
makewhatis" to build mandoc.db(5) databases in all the directory
Index: manpath.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/manpath.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lmanpath.c -Lmanpath.c -u -p -r1.30 -r1.31
--- manpath.c
+++ manpath.c
@@ -32,9 +32,7 @@
#include "mandoc_aux.h"
#include "manconf.h"
-#if !HAVE_MANPATH
static void manconf_file(struct manconf *, const char *);
-#endif
static void manpath_add(struct manpaths *, const char *, int);
static void manpath_parseline(struct manpaths *, char *, int);
@@ -43,52 +41,6 @@ void
manconf_parse(struct manconf *conf, const char *file,
char *defp, char *auxp)
{
-#if HAVE_MANPATH
- char cmd[(PATH_MAX * 3) + 20];
- FILE *stream;
- char *buf;
- size_t sz, bsz;
-
- strlcpy(cmd, "manpath", sizeof(cmd));
- if (file) {
- strlcat(cmd, " -C ", sizeof(cmd));
- strlcat(cmd, file, sizeof(cmd));
- }
- if (auxp) {
- strlcat(cmd, " -m ", sizeof(cmd));
- strlcat(cmd, auxp, sizeof(cmd));
- }
- if (defp) {
- strlcat(cmd, " -M ", sizeof(cmd));
- strlcat(cmd, defp, sizeof(cmd));
- }
-
- /* Open manpath(1). Ignore errors. */
-
- stream = popen(cmd, "r");
- if (NULL == stream)
- return;
-
- buf = NULL;
- bsz = 0;
-
- /* Read in as much output as we can. */
-
- do {
- buf = mandoc_realloc(buf, bsz + 1024);
- sz = fread(buf + bsz, 1, 1024, stream);
- bsz += sz;
- } while (sz > 0);
-
- if ( ! ferror(stream) && feof(stream) &&
- bsz && '\n' == buf[bsz - 1]) {
- buf[bsz - 1] = '\0';
- manpath_parseline(&conf->manpath, buf, 1);
- }
-
- free(buf);
- pclose(stream);
-#else
char *insert;
/* Always prepend -m. */
@@ -137,7 +89,6 @@ manconf_parse(struct manconf *conf, cons
/* MANPATH overrides man.conf(5) completely. */
manpath_parseline(&conf->manpath, defp, 0);
-#endif
}
/*
@@ -204,7 +155,6 @@ manconf_free(struct manconf *conf)
free(conf->output.style);
}
-#if !HAVE_MANPATH
static void
manconf_file(struct manconf *conf, const char *file)
{
@@ -270,7 +220,6 @@ out:
if (*manpath_default != '\0')
manpath_parseline(&conf->manpath, manpath_default, 0);
}
-#endif
void
manconf_output(struct manoutput *conf, const char *cp)
Index: mandocdb.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandocdb.c,v
retrieving revision 1.221
retrieving revision 1.222
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.221 -r1.222
--- mandocdb.c
+++ mandocdb.c
@@ -464,8 +464,7 @@ mandocdb(int argc, char *argv[])
} else {
/*
* If we have arguments, use them as our manpaths.
- * If we don't, grok from manpath(1) or however else
- * manconf_parse() wants to do it.
+ * If we don't, use man.conf(5).
*/
if (argc > 0) {
conf.manpath.paths = mandoc_reallocarray(NULL,
Index: makewhatis.8
===================================================================
RCS file: /home/cvs/mdocml/mdocml/makewhatis.8,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lmakewhatis.8 -Lmakewhatis.8 -u -p -r1.3 -r1.4
--- makewhatis.8
+++ makewhatis.8
@@ -79,8 +79,6 @@ If
is not provided,
.Nm
uses the default paths stipulated by
-.Xr manpath 1 ,
-or
.Xr man.conf 5 .
.Pp
The arguments are as follows:
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic