summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGravatar Florian Tham <fgtham@gmail.com>2017-02-24 23:17:18 +0100
committerGravatar Mike Burns <mike@mike-burns.com>2017-03-10 10:58:07 -0500
commita01e08d6ee5f38338d7779c44cff82c4d069ef21 (patch)
tree715a2b55a04c691b99c12e7030d93003c1ddbe78 /bin
parent6162eb3905c1e6482e9ab582776cd2882bb324a6 (diff)
rcup: handle directory names containing whitespace
This commit fixes #197.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rcup.in11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/rcup.in b/bin/rcup.in
index 2fb592d..910e534 100755
--- a/bin/rcup.in
+++ b/bin/rcup.in
@@ -34,7 +34,7 @@ print_generated_preface() {
#
# sh install.sh
#
-# Environment variables: VERBOSE, CP, LN, MKDIR, RM, DIRNAME, XARGS.
+# Environment variables: VERBOSE, CP, LN, MKDIR, RM, DIRNAME.
#
# env VERBOSE=1 sh install.sh
#
@@ -52,7 +52,6 @@ print_generated_preface() {
: \${MKDIR:=/bin/mkdir}
: \${RM:=/bin/rm}
: \${DIRNAME:=/usr/bin/dirname}
-: \${XARGS:=/usr/bin/xargs}
verbose() {
if [ "\$VERBOSE" -gt 0 ]; then
echo "\$@"
@@ -73,7 +72,7 @@ handle_file_cp() {
esac
fi
verbose "'\$1' -> '\$2'"
- \$DIRNAME "\$2" | \$XARGS \$MKDIR -p
+ \$MKDIR -p "\$(\$DIRNAME "\$2")"
\$CP -R "\$1" "\$2"
}
handle_file_ln() {
@@ -91,7 +90,7 @@ handle_file_ln() {
esac
fi
verbose "'\$1' -> '\$2'"
- \$DIRNAME "\$2" | \$XARGS \$MKDIR -p
+ \$MKDIR -p "\$(\$DIRNAME "\$2")"
\$LN -sf "\$1" "\$2"
}
PREFACE
@@ -145,9 +144,9 @@ is_linked() {
handle_dir() {
local dest="$1"
- $DEBUG "handle_dir $1"
+ $DEBUG "handle_dir $dest"
- dirname "$dest" | xargs $MKDIR -p
+ $MKDIR -p "$(dirname "$dest")"
}
handle_file() {