mirror of
https://github.com/oasislinux/oasis.git
synced 2025-12-25 12:14:00 +01:00
24 lines
388 B
Awk
24 lines
388 B
Awk
BEGIN {
|
|
RS = ""
|
|
sort = "sort -k 2"
|
|
}
|
|
|
|
function mode() {
|
|
for (i = 2; i <= NF; ++i) {
|
|
if ($i ~ /^mode=/)
|
|
return substr($i, 6)
|
|
}
|
|
printf "file '%s' is missing mode attribute\n", $1 >"/proc/self/fd/2"
|
|
exit(1)
|
|
}
|
|
|
|
/type=dir/ {
|
|
printf "04%s %s\n", mode(), substr($1, 2) |sort
|
|
}
|
|
|
|
/type=reg/ {
|
|
m = mode()
|
|
if (m != "0644" && m != "0755")
|
|
printf "10%s %s\n", m, substr($1, 2) |sort
|
|
}
|