=== modified file 'bin/fileset.awk' --- bin/fileset.awk 2013-09-26 19:34:34 +0000 +++ bin/fileset.awk 2013-09-26 18:03:45 +0000 @@ -7,25 +7,21 @@ # header print "#!/bin/sh" print "export fname dirname" - print_b("die() {") - print_i("printf '%s\\n' \"$*\"") - print_i("exit 1") - print_e("}") + print "die() { printf '%s\n' \"$*\"; exit 1 }" } function escaped(str) { gsub(/\\/, "\\\\", str) - # gsub(/\n/, "\\n", str) - gsub(/([\\\t"`${}\[\]])/, "\\\\&", str) +# gsub(/\n/, "\\n", str) + gsub(/([\\"`$])/, "\\\\&", str) return str } function quoted(str) { if(str ~ /^[a-zA-Z0-9_./]+$/) return str - gsub(/'/, "'\\''", str) - return "'" str "'" - # return "\"" escaped(str) "\"" + else + return "\"" escaped(str) "\"" } function print_i(str) { # print with indent @@ -202,11 +198,9 @@ cmd_mknod("test -f "fname, "file") # unless disabled with the N flag, append newline at the end of # last line, if not already present - printf_fmt = crest ~ /n/ || (crest !~ /N/ && statement !~ /\n$/) ? \ - "%s\\n" : "%s" + printf_fmt = (crest !~ /N/ && statement !~ /\n$/) ? \ + "%s\n" : "%s" printf_redir = (crest ~ /a/ ? ">>" : ">") fname - # print_i("content="quoted(statement)) - # print_d("printf "printf_redir" '"printf_fmt"' \"$content\"") print_d("printf "printf_redir" '"printf_fmt"' "quoted(statement)) statement = "" continue === removed file 'bin/fsapply' --- bin/fsapply 2013-09-26 19:34:34 +0000 +++ bin/fsapply 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -#!/bin/sh -if getopts x o; then - opt=-$o - shift -else - opt="" -fi -if ! [[ -d $1 ]]; then - printf '%s\n' >&2 "supply directory argument (got '$1')" - exit 2 -fi -cd "$1" || exit $? -shift -if [[ -n "$opt" ]]; then - fileset.awk | sh $opt -else - fileset.awk | sh -fi === modified file 'bin/fslist' --- bin/fslist 2013-09-26 19:34:34 +0000 +++ bin/fslist 2013-09-26 18:03:45 +0000 @@ -33,12 +33,7 @@ } for arg in "${@:-$PWD}"; do - if [[ -d $arg ]]; then - fnames=( $arg:a/**/* ) - else - fnames=( $arg:a ) - fi - for fname in $fnames; do + for fname in $arg:a/**/*; do zstat -LH s $fname || continue ftype=$(( [##16] $s[mode] >> 12 )) fmode=$(( [##8] $s[mode] & 8#7777 )) @@ -69,10 +64,6 @@ flags='' if [[ $content == *$'\n' ]]; then content=${content%$'\n'} - if [[ $content == *$'\n' ]]; then - # force appending newline - flags+=n - fi else flags+=N fi