Fix minimal/do and tests when built in a path containing spaces.
Basically all just missing quotes around shell strings that use $PWD. Most paths inside a project, since redo uses relative paths, only need to worry when project-internal directories or filenames have spaces in them. Reported-by: Jeff Stearns <jeff.stearns@gmail.com>
This commit is contained in:
parent
539a26d264
commit
474e12eed8
6 changed files with 19 additions and 17 deletions
17
install.do
17
install.do
|
|
@ -19,24 +19,25 @@ read py <redo/whichpython
|
||||||
echo "Installing to: $DESTDIR$PREFIX"
|
echo "Installing to: $DESTDIR$PREFIX"
|
||||||
|
|
||||||
# make dirs
|
# make dirs
|
||||||
$INSTALL -d $MANDIR/man1 $DOCDIR $BINDIR $LIBDIR $LIBDIR/version
|
"$INSTALL" -d "$MANDIR/man1" "$DOCDIR" "$BINDIR" \
|
||||||
|
"$LIBDIR" "$LIBDIR/version"
|
||||||
|
|
||||||
# docs
|
# docs
|
||||||
for d in docs/*.1; do
|
for d in docs/*.1; do
|
||||||
[ "$d" = "docs/*.1" ] && continue
|
[ "$d" = "docs/*.1" ] && continue
|
||||||
$INSTALL -m 0644 $d $MANDIR/man1
|
"$INSTALL" -m 0644 $d "$MANDIR/man1"
|
||||||
done
|
done
|
||||||
$INSTALL -m 0644 README.md $DOCDIR
|
"$INSTALL" -m 0644 README.md "$DOCDIR"
|
||||||
|
|
||||||
# .py files (precompiled to .pyc files for speed)
|
# .py files (precompiled to .pyc files for speed)
|
||||||
$INSTALL -m 0644 redo/*.py $LIBDIR/
|
"$INSTALL" -m 0644 redo/*.py "$LIBDIR/"
|
||||||
$INSTALL -m 0644 redo/version/*.py $LIBDIR/version/
|
"$INSTALL" -m 0644 redo/version/*.py "$LIBDIR/version/"
|
||||||
$py -mcompileall $LIBDIR
|
"$py" -mcompileall "$LIBDIR"
|
||||||
|
|
||||||
# It's important for the file to actually be named 'sh'. Some shells (like
|
# It's important for the file to actually be named 'sh'. Some shells (like
|
||||||
# bash and zsh) only go into POSIX-compatible mode if they have that name.
|
# bash and zsh) only go into POSIX-compatible mode if they have that name.
|
||||||
cp -R redo/sh $LIBDIR/sh
|
cp -R redo/sh "$LIBDIR/sh"
|
||||||
|
|
||||||
# binaries
|
# binaries
|
||||||
bins=$(ls bin/redo* | grep '^bin/redo[-a-z]*$')
|
bins=$(ls bin/redo* | grep '^bin/redo[-a-z]*$')
|
||||||
$INSTALL -m 0755 $bins $BINDIR/
|
"$INSTALL" -m 0755 $bins "$BINDIR/"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# For the full version, visit http://github.com/apenwarr/redo
|
# For the full version, visit http://github.com/apenwarr/redo
|
||||||
#
|
#
|
||||||
# The author disclaims copyright to this source file and hereby places it in
|
# The author disclaims copyright to this source file and hereby places it in
|
||||||
# the public domain. (2010 12 14; updated 2018 12 04)
|
# the public domain. (2010 12 14; updated 2018 12 11)
|
||||||
#
|
#
|
||||||
USAGE="
|
USAGE="
|
||||||
usage: do [-d] [-x] [-v] [-c] <targets...>
|
usage: do [-d] [-x] [-v] [-c] <targets...>
|
||||||
|
|
@ -44,7 +44,8 @@ dirname()
|
||||||
)
|
)
|
||||||
|
|
||||||
_dirsplit "$0"
|
_dirsplit "$0"
|
||||||
export REDO=$(cd "${_dirsplit_dir:-.}" && echo "$PWD/$_dirsplit_base")
|
REDO=$(cd "${_dirsplit_dir:-.}" && echo "$PWD/$_dirsplit_base")
|
||||||
|
export REDO
|
||||||
_cmd=$_dirsplit_base
|
_cmd=$_dirsplit_base
|
||||||
|
|
||||||
DO_TOP=
|
DO_TOP=
|
||||||
|
|
@ -76,7 +77,7 @@ if [ -z "$DO_BUILT" -a "$_cmd" != "redo-whichdo" ]; then
|
||||||
if [ "$#" -eq 0 ] && [ "$_cmd" = "do" -o "$_cmd" = "redo" ]; then
|
if [ "$#" -eq 0 ] && [ "$_cmd" = "do" -o "$_cmd" = "redo" ]; then
|
||||||
set all # only toplevel redo has a default target
|
set all # only toplevel redo has a default target
|
||||||
fi
|
fi
|
||||||
export DO_BUILT=$PWD/.do_built
|
export DO_BUILT="$PWD/.do_built"
|
||||||
if [ -z "$_do_opt_clean" -a -e "$DO_BUILT" ]; then
|
if [ -z "$_do_opt_clean" -a -e "$DO_BUILT" ]; then
|
||||||
echo "do: Incremental mode. Use -c for clean rebuild." >&2
|
echo "do: Incremental mode. Use -c for clean rebuild." >&2
|
||||||
fi
|
fi
|
||||||
|
|
@ -89,7 +90,7 @@ if [ -z "$DO_BUILT" -a "$_cmd" != "redo-whichdo" ]; then
|
||||||
xargs -0 rm -f 2>/dev/null
|
xargs -0 rm -f 2>/dev/null
|
||||||
mv "$DO_BUILT.new" "$DO_BUILT"
|
mv "$DO_BUILT.new" "$DO_BUILT"
|
||||||
DO_PATH=$DO_BUILT.dir
|
DO_PATH=$DO_BUILT.dir
|
||||||
export PATH=$DO_PATH:$PATH
|
export PATH="$DO_PATH:$PATH"
|
||||||
rm -rf "$DO_PATH"
|
rm -rf "$DO_PATH"
|
||||||
mkdir "$DO_PATH"
|
mkdir "$DO_PATH"
|
||||||
for d in redo redo-ifchange redo-whichdo; do
|
for d in redo redo-ifchange redo-whichdo; do
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,8 @@ check_s "" "$_dirsplit_base"
|
||||||
|
|
||||||
|
|
||||||
SECTION _relpath
|
SECTION _relpath
|
||||||
check "a/b/c" _relpath $PWD/a/b/c
|
check "a/b/c" _relpath "$PWD/a/b/c"
|
||||||
check "../a/b/c" _relpath $PWD/../a/b/c
|
check "../a/b/c" _relpath "$PWD/../a/b/c"
|
||||||
check "" _relpath "$PWD"
|
check "" _relpath "$PWD"
|
||||||
(cd / && check "a/b/c" _relpath a/b/c)
|
(cd / && check "a/b/c" _relpath a/b/c)
|
||||||
(cd / && check "a/b/c" _relpath /a/b/c)
|
(cd / && check "a/b/c" _relpath /a/b/c)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ for sh in dash /usr/xpg4/bin/sh ash posh mksh ksh ksh88 ksh93 pdksh \
|
||||||
SH=$PWD/$1.new/sh
|
SH=$PWD/$1.new/sh
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
( cd ../t && $SH shelltest.od ) >shelltest.tmp 2>&1
|
( cd ../t && "$SH" shelltest.od ) >shelltest.tmp 2>&1
|
||||||
RV=$?
|
RV=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@ printf x >>a.ran
|
||||||
rm -f dir/$2.1 $2.2 $2.3 $2.final
|
rm -f dir/$2.1 $2.2 $2.3 $2.final
|
||||||
echo foo >$2.final
|
echo foo >$2.final
|
||||||
ln -s $2.final $2.3
|
ln -s $2.final $2.3
|
||||||
ln -s $PWD/$2.3 $2.2
|
ln -s "$PWD/$2.3" $2.2
|
||||||
ln -s ../$2.2 dir/$2.1
|
ln -s ../$2.2 dir/$2.1
|
||||||
ln -s dir/$2.1 $3
|
ln -s dir/$2.1 $3
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
rm -rf test.tmp
|
rm -rf test.tmp
|
||||||
DESTDIR=$PWD/test.tmp redo ../../install >install.log 2>&1
|
DESTDIR="$PWD/test.tmp" redo ../../install >install.log 2>&1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue