commit 9ebfabefc17d057d295c1984e420cc00533d6350
parent 7bf9015da718033ccdf3bc6697cefe809ba87c53
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Sun, 29 Sep 2013 01:58:03 +0200
don't define dirname, let user override the shell in fsapply
Diffstat:
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/bin/fileset.awk b/bin/fileset.awk
@@ -1,7 +1,7 @@
#!/bin/awk -f
BEGIN {
fname="\"$fname\"" # constants so I don't have to write it out
- dirname="\"$dirname\""
+ # dirname="\"$dirname\""
or_die="|| exit $?"
}
@@ -86,7 +86,7 @@ function process_statement() {
print ""
print_i("fname=" quoted(crest))
match(crest, /.*\//)
- print_i("dirname=" quoted(substr(crest, 1, RLENGTH-1)))
+ # print_i("dirname=" quoted(substr(crest, 1, RLENGTH-1)))
continue
}
diff --git a/bin/fileset_inc.sh b/bin/fileset_inc.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-export fname dirname
+export fname
die() {
printf '%s\\n' \"$*\"
exit 1
@@ -26,9 +26,9 @@ fi
rm_flags() {
if $f_f; then
- rm -f$2 "$fname" || exit $?
- elif test -n "$2"; then
- rm -$2 "$fname" || exit $?
+ rm -f$1 "$fname" || exit $?
+ elif test -n "$1"; then
+ rm -$1 "$fname" || exit $?
else
rm "$fname" || exit $?
fi
@@ -36,7 +36,7 @@ rm_flags() {
mkdir_p() {
if $f_p; then
- mkdir -p "$dirname" || exit $?
+ mkdir -p "$(dirname "$fname")" || exit $?
fi
}
diff --git a/bin/fsapply b/bin/fsapply
@@ -12,7 +12,7 @@ fi
cd "$1" || exit $?
shift
if [[ -n "$opt" ]]; then
- fileset "$@" | sh $opt
+ fileset "$@" | ${FILESET_SHELL:-sh} $opt
else
- fileset "$@" | sh
+ fileset "$@" | ${FILESET_SHELL:-sh}
fi