[Bug 282638] Re: log_progress_msg overridden with empty function in /etc/lsb-base-logging.sh

Andrew radamanf at gmail.com
Tue Jun 17 11:50:38 UTC 2014


ok sorry I think that this is static, but should be a progress .. it's
not simple then, but anyway for me I've used this code as static text to
see at least some output and not to kill script in the middle of
execution:

log_progress_msg () {
    GREEN=`$TPUT setaf 2`
    NORMAL=`$TPUT op`
    printf " $GREEN*$NORMAL $@" || true
}

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lsb in Ubuntu.
https://bugs.launchpad.net/bugs/282638

Title:
  log_progress_msg overridden with empty function in /etc/lsb-base-
  logging.sh

Status in “lsb” package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: lsb-base

  The functions in /etc/lsb-base-logging.sh override all the corresponding functions in /lib/lsb/init-functions.
  In particular it override log_progress_msg with the following code:
  ===========
  ...
   log_progress_msg () { 
      : 
  }
  ...
  ===========

  There is really little surprise in the fact no output is given.
  Is this behavior intended?
  If so: why?
  fixing this is rather trivial, bu I would like to understand the "why" before touching anything

  If that's relevant:
  ===========
  mauro at heimdall:~$ lsb_release -rd
  Description:	Ubuntu 8.04.1
  Release:	8.04
  mauro at heimdall:~$ apt-cache policy lsb-base
  lsb-base:
    Installato: 3.2-4ubuntu1
    Candidato: 3.2-4ubuntu1
    Tabella versione:
   *** 3.2-4ubuntu1 0
          500 http://it.archive.ubuntu.com hardy/main Packages
          100 /var/lib/dpkg/status
  ===========

  UPDATE:
  I changed my /etc/lsb-base-logging.sh to "fix" the problem (if any).
  If someone is interested these are the diffs:
  ===========
  mauro at heimdall:/etc$ diff -wu lsb-base-logging.sh-orig  lsb-base-logging.sh
  --- lsb-base-logging.sh-orig	2007-09-06 19:43:32.000000000 +0200
  +++ lsb-base-logging.sh	2008-10-14 10:55:05.000000000 +0200
  @@ -87,6 +87,7 @@
   	    COLS=80
               COL=73
           fi
  +        if [ -n "$2" ]; then #normal case
           # We leave the cursor `hanging' about-to-wrap (see terminfo(5)
           # xenl, which is approximately right). That way if the script
           # prints anything then we will be on the next line and not
  @@ -99,6 +100,13 @@
           # asterisk ought to go.
   
           printf " * $*       "
  +            unset DO_PROGRESS
  +        else                #prepare for log_progress_msg
  +            printf " * $1"
  +            $TPUT sc
  +            printf "       "
  +            DO_PROGRESS='t'
  +        fi
           # Enough trailing spaces for ` [fail]' to fit in; if the message
           # is too long it wraps here rather than later, which is what we
           # want.
  @@ -111,7 +119,24 @@
   }
   
   log_progress_msg () {
  -    :
  +    if [ -n $DO_PROGRESS ]; then
  +        $TPUT rc
  +        printf " $*"
  +        $TPUT sc
  +        printf "       "
  +        $TPUT hpa `$EXPR $COLS - 1`
  +        printf ' '
  +    fi
  +}
  +
  +log_progress_msg1 () {
  +    if [ -n $DO_PROGRESS ]; then
  +        $TPUT rc
  +        printf " $*"
  +        $TPUT el
  +        $TPUT hpa `$EXPR $COLS - 1`
  +        printf ' '
  +    fi
   }
   
   log_end_msg () {
  ===========
  They appear to work correctly at least within  gnome-terminal and at the linux console.

  TiA
  ZioNemo

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/282638/+subscriptions



More information about the foundations-bugs mailing list