summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-07 14:16:50 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-07 14:16:50 -0400
commit50aedb15997bae463b6676c10c05ab1b0384563e (patch)
treeb141c76b604347b6bf7d89437df588a9d99679a4
parentf43f55adcb50b4ba0de1c8da8a836bb2683a287b (diff)
jh-checksource: small cleanups
-rw-r--r--jh-checksource.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/jh-checksource.sh b/jh-checksource.sh
index c9d1086..e3eff21 100644
--- a/jh-checksource.sh
+++ b/jh-checksource.sh
@@ -15,7 +15,7 @@ safe_files_string=()
min_size=3
normalize_filename() {
- local cwd="`pwd`"
+ local cwd="$(readlink -m -- "$PWD")"
readlink -m -- "$1"|sed "s|^$cwd/|./|"
}
@@ -43,7 +43,7 @@ matches_regexp() {
print-human() {
libremessages warning "The source directory %s contains binary files:" "$PWD"
- sed 's/./ -> &/'
+ sed 's/^/ -> /'
}
print-machine() {
@@ -61,9 +61,8 @@ main() {
done
# Init
- local unsafe_files="$(mktemp)"
- cleanup() { rm -f -- "$unsafe_files"; }
- trap cleanup EXIT
+ local unsafe_files="$(mktemp --tmpdir "${0##*/}.XXXXXXXXXX")"
+ trap "$(printf 'rm -f -- %q' "$unsafe_files")" EXIT
# Heavy lifting
find . -type f -printf '%s %h/%f\n' | # find all files