Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561606 - sys-apps/busybox: awk length string function does not handle implicit ()
Summary: sys-apps/busybox: awk length string function does not handle implicit ()
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Embedded Gentoo Team
URL: https://bugs.busybox.net/show_bug.cgi...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-26 21:56 UTC by Samuel Bauer
Modified: 2015-09-27 12:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
xdg-mime_awk_length.patch (xdg-mime_awk_length.patch,681 bytes, patch)
2015-09-26 21:56 UTC, Samuel Bauer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Bauer 2015-09-26 21:56:14 UTC
Created attachment 413012 [details, diff]
xdg-mime_awk_length.patch

Busybox awk doesn't support syntactic abbreviation: length
xdg-mime use this syntax, so when busybox is set as main shell or busybox awk set as main awk (following gentoo way through eselect sh and awk), personnal mime default application won't be considered.

eselect awk set busybox
xdg-mime query default x-scheme-handler/http
awk: cmd. line:13: Unexpected token
spacefm.desktop
eselect awk set gawk
xdg-mime query default x-scheme-handler/http
firefox.desktop

Seems to be an upstream bug, but as I don't have an account on freedesktop bug tracker,  I'd like to ask another gentoo folk already having such account, to open one bug there. May be it's better this way, as known folks may have their issues more considered than newly registered account.

P.S.: to track the wrong behavior of the script, I used root account as I needed to play with eselect (and was to lazy to switch window for every single test, or add sudo entry), this led me to another bug within xdg-mime:
xdg-mime default firefox.desktop x-scheme-handler/https
touch: cannot touch '/root/.local/share/applications/mimeapps.list': No such file or directory
/usr/bin/xdg-mime: line 804: /root/.local/share/applications/mimeapps.list.new: No such file or directory
Comment 1 SpanKY gentoo-dev 2015-09-27 06:07:40 UTC
Comment on attachment 413012 [details, diff]
xdg-mime_awk_length.patch

we don't patch programs to work around tools that violate POSIX.  this is a bug in busybox's awk implementation.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html

length[([s])]
Return the length, in characters, of its argument taken as a string, or of the whole record, $0, if there is no argument.
Comment 2 SpanKY gentoo-dev 2015-09-27 06:42:39 UTC
hmm, it does support "length()" (i.e. omitting the $0), but it doesn't support omitting the paren altogether.  moved to the upstream bugzilla tracker.
Comment 3 Samuel Bauer 2015-09-27 12:09:30 UTC
I already felt that checking if it was standard syntax was needed.

Thanks, for all precisions.