[BusyBox 0000733]: unreliable/nonportable script generating bb_config.h (fix included)

bugs at busybox.net bugs at busybox.net
Sun Feb 19 07:43:45 UTC 2006


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=733 
====================================================================== 
Reported By:                rfelker
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   733
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-18-2006 23:43 PST
Last Modified:              02-18-2006 23:43 PST
====================================================================== 
Summary:                    unreliable/nonportable script generating bb_config.h
(fix included)
Description: 
The sed command used for generating bb_config.h from config.h does not work
on my system. I'm not sure if the problem is at the makefile level (GNU
make 3.79), the shell level (bash 1.14.7), or the sed level (GNU sed 3.02)
(I forget the makefile quoting semantics), but the script produces "n"
instead of newlines when attempting to break lines. Here is much simpler
code that will do the same thing portably:

@sed -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \
    -e '/#define CONFIG_/{;p;s/#define CONFIG_/#define ENABLE_/;}' \
        < $< >> $@

instead of the current:

@sed -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \
    -e 's/#define CONFIG_\(.*\)/#define CONFIG_\1\n#define ENABLE_\1/' \
        < $< >> $@

Additional simplifications could be done too, of course.

====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-18-06 23:43  rfelker        New Issue                                    
02-18-06 23:43  rfelker        Status                   new => assigned     
02-18-06 23:43  rfelker        Assigned To               => BusyBox         
======================================================================




More information about the busybox-cvs mailing list