Bug#708337: lsb: Please revert unnecessary use of /bin/echo -n

Steve Langasek <[email protected]>
Newsgroups gmane.linux.debian.devel.lsb
Message-ID <[email protected]>
Package: lsb
Version: 4.1+Debian9
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu saucy ubuntu-patch

Hi guys,

In response to bug #602038, the init-functions scripts in lsb-base have been
changed to use /bin/echo -n instead of echo -n.  This results in a lot of
added forks which are unnecessary and inappropriate: 'echo -n' is guaranteed
by Debian policy to be supported by the shell.

Please revert this change, improving the efficiency of this
boot-performance-sensitive shell library.  I've attached a patch to do this.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[email protected]                                     [email protected]
lsb_4.1+Debian9ubuntu1.debdiff (text/x-diff, 1 KB)
=== modified file 'init-functions'
--- init-functions	2012-11-12 08:58:04 +0000
+++ init-functions	2013-05-15 07:40:53 +0000
@@ -280,7 +280,7 @@
     if [ -z "${1:-}" ]; then
         return 1
     fi
-    /bin/echo -n "$@" || true
+    echo -n "$@" || true
     log_begin_msg_post "$@"
 }
 
@@ -305,11 +305,11 @@
     log_daemon_msg_pre "$@"
 
     if [ -z "${2:-}" ]; then
-        /bin/echo -n "$1:" || true
+        echo -n "$1:" || true
         return
     fi
     
-    /bin/echo -n "$1: $2" || true
+    echo -n "$1: $2" || true
     log_daemon_msg_post "$@"
 }
 
@@ -332,7 +332,7 @@
     if [ -z "${1:-}" ]; then
         return 1
     fi
-    /bin/echo -n " $@" || true
+    echo -n " $@" || true
 }
 
 
@@ -379,12 +379,12 @@
 
 log_action_begin_msg () {
     log_action_begin_msg_pre "$@"
-    /bin/echo -n "$@..." || true
+    echo -n "$@..." || true
     log_action_begin_msg_post "$@"
 }
 
 log_action_cont_msg () {
-    /bin/echo -n "$@..." || true
+    echo -n "$@..." || true
 }
 
 log_action_end_msg () {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.