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

bugs at busybox.net bugs at busybox.net
Sun Feb 19 07:56:06 UTC 2006


The following issue has been CLOSED 
====================================================================== 
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:                     closed
Resolution:                 won't fix
Fixed in Version:           
====================================================================== 
Date Submitted:             02-18-2006 23:43 PST
Last Modified:              02-18-2006 23:56 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.

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

---------------------------------------------------------------------- 
 vapier - 02-18-06 23:56  
---------------------------------------------------------------------- 
your sed sucks

the -i option was not added until sed-4.x ... which itself was released
over four years ago

read the mailing list, this is a known "issue"

side note, your make may cause problems as well ... iirc, 3.79 does not
support '|' in the dependency list, but this is in make 3.80 (which also
was released over four years ago) 

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         
02-18-06 23:56  vapier         Note Added: 0001111                          
02-18-06 23:56  vapier         Status                   assigned => closed  
02-18-06 23:56  vapier         Resolution               open => won't fix   
======================================================================




More information about the busybox-cvs mailing list