Bug 3091 - Nonportable tool usage in scripts
Summary: Nonportable tool usage in scripts
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-15 23:07 UTC by bugdal
Modified: 2011-04-16 17:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Patch to fix the issues (1.42 KB, patch)
2011-01-15 23:07 UTC, bugdal
Details
Fix for the remaining issue. (383 bytes, patch)
2011-04-13 17:01 UTC, bugdal
Details

Note You need to log in before you can comment on or make changes to this bug.
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!