FreeBSD: Don't set MANPATH, use OS configuration
authorMarcin Cieslak <saper@saper.info>
Mon, 10 Sep 2012 02:21:16 +0000 (04:21 +0200)
committerJon Trulson <jon@radscan.com>
Mon, 10 Sep 2012 18:08:34 +0000 (12:08 -0600)
- make installer to set up man(1) paths using /usr/local/etc/man.d/*
- don't override empty/unset MANPATH with compiled in default

cde/admin/IntegTools/post_install/freebsd/configMin.src
cde/programs/dtlogin/config/0060.dtsysenv.src
cde/programs/dtsearchpath/dtsp/ManSearchPath.C
cde/programs/dtsearchpath/libCliSrv/UnixEnv.C

index 977ac861130519fee9f519d75ec251e0239c023a..ca848fe534a76591f44f997d9d6a5cadd1d36048 100755 (executable)
@@ -10,6 +10,7 @@ XCOMM #######
 PRODUCT=CDE
 FILESET=CDE-MIN
 DO_CONFIGURATION=""
+PREFIX=/usr/local
 retval=0
 
 FixEtcServices()
@@ -194,6 +195,17 @@ RemoveMinFiles()
        EOF
 }
 
+SetManPath()
+{
+    DTMANPATH=CDE_INSTALLATION_TOP/share/man
+    echo "MANPATH $DTMANPATH" > ${PREFIX}/etc/man.d/cde.conf
+}
+
+UnSetManPath()
+{
+    rm -f ${PREFIX}/etc/man.d/cde.conf
+}
+
 VerifyInstalledFiles()
 {
     echo "Status   mode    owner   group   filename"
@@ -227,6 +239,8 @@ XCOMM ###############################################################
 
     : FixEtcInetdDotConf
 
+    SetManPath
+
     HASH
     HASH  create the /var/dt/tmp directory for the dtspcd
     HASH
@@ -239,6 +253,8 @@ XCOMM ###############################################################
   elif [ "$OPERATION" = "deconfigure" ]
   then
 
+    UnsetManPath
+
     UnfixEtcServices
 
     : UnfixEtcInetdDotConf
index 1b9a93b908cc56cff235b69c4bbc835131c3cb17..f69919e0c88488f0fafee51babbbd6a617f89860 100644 (file)
@@ -27,6 +27,7 @@ XCOMM ####################################################################
 
 #define HASH #
 
+#if !defined(__FreeBSD__)
 HASH
 HASH Source TIMEZONE
 HASH
@@ -55,6 +56,7 @@ if [ -f $MANPATH_FILE -a -r $MANPATH_FILE ]; then
         export MANPATH="$MANPATH:`cat $MANPATH_FILE`"
 fi
 unset MANPATH_FILE
+#endif
 
 XCOMM #########################         eof       #####################
 
index b03891da6d3a3d4f7a7475ffcb1252a1f094a908..a1cc948f2262977496c2839dad56a6d9451fcb5c 100644 (file)
@@ -42,6 +42,12 @@ ManSearchPath::ManSearchPath
        const char *     sep
        ) : SearchPath(user, envvar, sep)
 {
+#if defined(__FreeBSD__)
+    /* Installer on FreeBSD sets up man configuration so that
+     * setting MANPATH is not necessary
+     */
+    if (!user->OS()->MANPATH().isNull()) {
+#endif
     if (user->DTMANPATH())
        search_path = user->FactoryManPath() + "," + *user->DTMANPATH();
     else
@@ -55,6 +61,9 @@ ManSearchPath::ManSearchPath
 
     NormalizePath();
     TraversePath();
+#if defined(__FreeBSD__)
+    }
+#endif
 }
 
 
index e00bb2c5215b2ed02f1365be6975f8a8c44ab811..9b34e858291e102cc73756ecc4c81882d8769b14 100644 (file)
@@ -83,7 +83,7 @@ UnixEnvironment::UnixEnvironment()
 #elif defined(__OpenBSD__)
        manpath = "/usr/share/man:/usr/X11R6/man:/usr/local/man:/usr/ports/infrastructure/man";
 #elif defined(__FreeBSD__)
-       manpath = "/usr/share/man:/usr/local/man";
+       manpath = temp;
 #endif
     else
        manpath = temp;