svn commit: samba r11224 - branches/SAMBA_3_0/source/script trunk/source/script

lmuelle at samba.org lmuelle at samba.org
Thu Oct 20 12:58:41 GMT 2005


Author: lmuelle
Date: 2005-10-20 12:58:40 +0000 (Thu, 20 Oct 2005)
New Revision: 11224

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11224

Log:
Add feature to get our configuration from config.log into installman.sh.
This allows us to install for example smbsh.1 only if SMBWRAPPER is set.

Removed also one rm call as we copy and do not append to the same file
in the next step.  There is no file permission risk as we chmod 0644 in
any case later.

Replaced one basename call by shell substitution.

Modified:
   branches/SAMBA_3_0/source/script/installman.sh
   trunk/source/script/installman.sh


Changeset:
Modified: branches/SAMBA_3_0/source/script/installman.sh
===================================================================
--- branches/SAMBA_3_0/source/script/installman.sh	2005-10-20 11:19:52 UTC (rev 11223)
+++ branches/SAMBA_3_0/source/script/installman.sh	2005-10-20 12:58:40 UTC (rev 11224)
@@ -18,6 +18,10 @@
 	exit 0
 fi
 
+# Get the configured feature set
+test -f config.log && \
+	eval $( grep "^[[:alnum:]]*=.*" config.log)
+
 for lang in $langs; do
     if [ "X$lang" = XC ]; then
 	echo Installing default man pages in $MANDIR/
@@ -40,13 +44,20 @@
     for sect in 1 5 7 8 ; do
 	for m in $langdir/man$sect ; do
 	    for s in $SRCDIR../docs/manpages/$lang/*$sect; do
-	    FNAME=$m/`basename $s`
- 
+	    MP_BASENAME=${s##*/}
+
+	    # Check if this man page if required by the configured feature set
+	    case "${MP_BASENAME}" in
+	    	smbsh.1) test -z "${SMBWRAPPER}" && continue ;;
+		*) ;;
+	    esac
+
+	    FNAME="$m/${MP_BASENAME}"
+
 	    # Test for writability.  Involves 
 	    # blowing away existing files.
  
 	    if (rm -f $FNAME && touch $FNAME); then
-		rm $FNAME
 		if [ "x$GROFF" = x ] ; then
 		    cp $s $m            # Copy raw nroff 
 		else

Modified: trunk/source/script/installman.sh
===================================================================
--- trunk/source/script/installman.sh	2005-10-20 11:19:52 UTC (rev 11223)
+++ trunk/source/script/installman.sh	2005-10-20 12:58:40 UTC (rev 11224)
@@ -18,6 +18,10 @@
 	exit 0
 fi
 
+# Get the configured feature set
+test -f config.log && \
+	eval $( grep "^[[:alnum:]]*=.*" config.log)
+
 for lang in $langs; do
     if [ "X$lang" = XC ]; then
 	echo Installing default man pages in $MANDIR/
@@ -40,13 +44,20 @@
     for sect in 1 5 7 8 ; do
 	for m in $langdir/man$sect ; do
 	    for s in $SRCDIR../docs/manpages/$lang/*$sect; do
-	    FNAME=$m/`basename $s`
- 
+	    MP_BASENAME=${s##*/}
+
+	    # Check if this man page if required by the configured feature set
+	    case "${MP_BASENAME}" in
+	    	smbsh.1) test -z "${SMBWRAPPER}" && continue ;;
+		*) ;;
+	    esac
+
+	    FNAME="$m/${MP_BASENAME}"
+
 	    # Test for writability.  Involves 
 	    # blowing away existing files.
  
 	    if (rm -f $FNAME && touch $FNAME); then
-		rm $FNAME
 		if [ "x$GROFF" = x ] ; then
 		    cp $s $m            # Copy raw nroff 
 		else



More information about the samba-cvs mailing list