On Fri, 2007-09-28 at 15:11 -0600, Bryan Sutula wrote:

> After a little more discussion, and seeing no further input from the
> list, I've opened a couple of issues, #1804510 (to rename the macros)
> and #1804512 (to fix usage).  The main consequence for other OpenHPI
> developers (including out-of-tree plugins) will be:
> 
>   dbg() will be renamed to err()
> 
>   trace() will be renamed to dbg()

The above change has now been made in the trunk.  If you have
out-of-tree plugins, you will want to rename your macros as well before
moving to the new trunk version.

Please also note that two environment variables were renamed, consistent
with this change:

  Environment variable OPENHPI_DEBUG is now OPENHPI_ERROR
  Environment variable OPENHPI_DEBUG_TRACE is now OPENHPI_DEBUG

If you need to make changes to an out-of-tree plugin, the following
notes may help.  Note that they don't cover cases such as "dbg (", so if
you have code written like this, you'll have to change the patterns.  I
make no claims of elegance in these fragments, but they work.  :-)

# Change all dbg() calls to err() calls
find . -type d -print | while read directory
do
    files=`echo ' *.c *.cpp *.cxx *.h *.S' | sed "s| | $directory/|g"`
    if [ `ls -l $files 2>/dev/null | wc -l` -ne 0 ]
    then
        sed --in-place 's/dbg(/err(/g' $files 2>/dev/null
    fi
done

At this point, manually go through the rest of the instances of dbg in
the code, to see if anything was missed, or if a comment refers to dbg
and should now refer to err.

# Change all trace() calls to dbg() calls
find . -type d -print | while read directory
do
    files=`echo ' *.c *.cpp *.cxx *.h *.S' | sed "s| | $directory/|g"`
    if [ `ls -l $files 2>/dev/null | wc -l` -ne 0 ]
    then
        sed --in-place 's/trace(/dbg(/g' $files 2>/dev/null
    fi
done

At this point, manually go through the dbg( calls, to see if everything
looks OK and whether comment spacing needs to be adjusted, since err()
is two characters shorter than trace().

-- 
Bryan Sutula <[EMAIL PROTECTED]>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to