[Fedora-directory-commits] adminserver/wrappers initscript.in, 1.3, 1.4

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Sat Dec 8 17:42:52 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/adminserver/wrappers
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2050/adminserver/wrappers

Modified Files:
	initscript.in 
Log Message:
Resolves: bug 400221
Bug Description: init.d scripts to restart ds instance on solaris produces output with -n
Reviewed by: nhosoi (Thanks!)
Fix Description: We cannot figure out at build time whether to use echo -n or echo \c because the user may use a different shell at run time e.g. using bash to run configure but using /sbin/sh at run time.  So, we just figure out at runtime what kind of echo is being used and deal with it.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none



Index: initscript.in
===================================================================
RCS file: /cvs/dirsec/adminserver/wrappers/initscript.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- initscript.in	8 Oct 2007 14:37:29 -0000	1.3
+++ initscript.in	8 Dec 2007 17:42:49 -0000	1.4
@@ -24,10 +24,17 @@
     exit 0
 fi
 
-# Solaris echo cannot use -n - linux echo by default cannot use \c
+# figure out which echo we're using
+ECHO_N=`echo -n`
+
+# some shells echo cannot use -n - linux echo by default cannot use \c
 echo_n()
 {
-    echo @ECHO_N@ "$*@ECHO_C@"
+    if [ "$ECHO_N" = '-n' ] ; then
+        echo "$*\c"
+    else
+        echo -n "$*"
+    fi
 }
 
 # failure and success are not defined on some platforms




More information about the Fedora-directory-commits mailing list