1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 02:05:16 +03:00
aports/community/afl++/0004-busybox-stat.patch
2022-06-20 16:32:07 +00:00

22 lines
975 B
Diff

Add support for busybox stat by just using the GNU stat option format no matter what, as Alpine
doesn't ship BSD stat anyway.
--- a/afl-cmin
+++ b/afl-cmin
@@ -347,15 +347,8 @@
# get list of input filenames sorted by size
i = 0
- # yuck, gnu stat is option incompatible to bsd stat
- # we use a heuristic to differentiate between
- # GNU stat and other stats
- "stat --version 2>/dev/null" | getline statversion
- if (statversion ~ /GNU coreutils/) {
- stat_format = "-c '%s %n'" # GNU
- } else {
- stat_format = "-f '%z %N'" # *BSD, MacOS
- }
+ # Both GNU stat and busybox stat use -c for the format
+ stat_format = "-c '%s %n'" # GNU, busybox
cmdline = "(cd "in_dir" && find . \\( ! -name \".*\" -a -type d \\) -o -type f -exec stat "stat_format" \\{\\} + | sort -k1n -k2r)"
#cmdline = "ls "in_dir" | (cd "in_dir" && xargs stat "stat_format" 2>/dev/null) | sort -k1n -k2r"
#cmdline = "(cd "in_dir" && stat "stat_format" *) | sort -k1n -k2r"