Bug 3091

Summary: Nonportable tool usage in scripts
Product: Busybox Reporter: bugdal
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:
Attachments: Patch to fix the issues
Fix for the remaining issue.

Description bugdal 2011-01-15 23:07:22 UTC
Created attachment 2845 [details]
Patch to fix the issues

Busybox sed does not seem to support the usage "sed command -- file" that's used in its own build scripts. "sed -e command -- file" works fine, however.

This makes it impossible to build BB on a BB-hosted system.

Also, the ? character is not special in POSIX BRE, and \? is not a conformant substitute. The portable solution is to use egrep instead of grep.

This second issue does not necessarily preclude building BB on a BB-hosted system, but depending on the choice of standard library in use and the strictness of its regex implementation, it may be a problem.

Attached patch fixes both issues.
Comment 1 Denys Vlasenko 2011-02-07 13:49:16 UTC
(In reply to comment #0)
> Created attachment 2845 [details]
> Patch to fix the issues
> 
> Busybox sed does not seem to support the usage "sed command -- file" that's
> used in its own build scripts. "sed -e command -- file" works fine, however.

Works with 1.18.2

> Also, the ? character is not special in POSIX BRE, and \? is not a conformant
> substitute. The portable solution is to use egrep instead of grep.

Great, can you point out where exactly is that ?
Comment 2 Denys Vlasenko 2011-03-07 14:28:30 UTC
fixed in git
Comment 3 bugdal 2011-04-13 17:00:30 UTC
There is another instance of this grep usage that still has not been fixed. See the new patch I'm about to attach.
Comment 4 bugdal 2011-04-13 17:01:42 UTC
Created attachment 3211 [details]
Fix for the remaining issue.
Comment 5 Denys Vlasenko 2011-04-16 17:47:11 UTC
Applied, thanks!