source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Support homebrew-style linking on Mac OS X.
@ 2015-01-21 22:42 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-01-21 22:42 UTC (permalink / raw)
  To: source

Log Message:
-----------
Support homebrew-style linking on Mac OS X.
Idea found together with Alexis Hildebrandt <surryhill at gmail dot com>.

Modified Files:
--------------
    mdocml:
        configure
        configure.local.example
        mandocdb.c

Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandocdb.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.183 -r1.184
--- mandocdb.c
+++ mandocdb.c
@@ -613,7 +613,11 @@ treescan(void)
 					say(path, "&realpath");
 				continue;
 			}
-			if (strstr(buf, basedir) != buf) {
+			if (strstr(buf, basedir) != buf
+#ifdef HOMEBREWDIR
+			    && strstr(buf, HOMEBREWDIR) != buf
+#endif
+			) {
 				if (warnings) say("",
 				    "%s: outside base directory", buf);
 				continue;
@@ -818,6 +822,10 @@ filescan(const char *file)
 		start = buf;
 	else if (strstr(buf, basedir) == buf)
 		start = buf + strlen(basedir);
+#ifdef HOMEBREWDIR
+	else if (strstr(buf, HOMEBREWDIR) == buf)
+		start = buf;
+#endif
 	else {
 		exitcode = (int)MANDOCLEVEL_BADARG;
 		say("", "%s: outside base directory", buf);
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.2 -r1.3
--- configure.local.example
+++ configure.local.example
@@ -1,6 +1,6 @@
 # $Id$
 #
-# Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
+# Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
 #
 # Permission to use, copy, modify, and distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -152,6 +152,14 @@ BINM_APROPOS=mapropos		# default is "apr
 BINM_MAN=mman			# default is "man"
 BINM_WHATIS=mwhatis		# default is "whatis"
 BINM_MAKEWHATIS=mandocdb	# default is "makewhatis"
+
+# When using the "homebrew" package manager on Mac OS X, the actual
+# manuals are located in a so-called "cellar" and only symlinked
+# into the manual trees.  To allow mandoc to follow such symlinks,
+# you have to specify the physical location of the cellar as returned
+# by realpath(3), for example:
+
+HOMEBREWDIR=/Cellar
 
 # --- user settings related man.cgi ------------------------------------
 
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lconfigure -Lconfigure -u -p -r1.17 -r1.18
--- configure
+++ configure
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
+# Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
 #
 # Permission to use, copy, modify, and distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
@@ -70,6 +70,7 @@ INCLUDEDIR=
 LIBDIR=
 MANDIR=
 EXAMPLEDIR=
+HOMEBREWDIR=
 
 WWWPREFIX="/var/www"
 HTDOCDIR=
@@ -276,6 +277,7 @@ __HEREDOC__
 echo
 echo "#define VERSION \"${VERSION}\""
 [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
+[ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
 
 cat << __HEREDOC__
 #define HAVE_DIRENT_NAMLEN ${HAVE_DIRENT_NAMLEN}
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-21 22:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 22:42 mdocml: Support homebrew-style linking on Mac OS X schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).