forked from apenwarr/redo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix more inconsistent behaviour with symlinks in paths.
Both redo and minimal/do were doing slightly weird things with symlinked directories, especially when combined with "..". For example, if x is a link to ., then x/x/x/x/../y should resolve to "../y", which is quite non-obvious. Added some tests to make sure this stays fixed.
- Loading branch information
Showing
13 changed files
with
121 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
/.do_built.dir | ||
/minimal/.do_built | ||
/minimal/.do_built.dir | ||
/minimal/y | ||
*~ | ||
*.tmp | ||
*.did | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,7 @@ | |
/shellfail | ||
/shelltest.warned | ||
/shelltest.failed | ||
/shlink | ||
/stress.log | ||
/symlink path | ||
/flush-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/*.dyn | ||
/src | ||
/x | ||
/y | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
redo-ifchange ../flush-cache | ||
rm -f src | ||
: >src | ||
|
||
for iter in 10 20; do | ||
rm -rf y | ||
rm -f x *.dyn static | ||
mkdir y | ||
: >y/static | ||
ln -s . y/x | ||
../flush-cache | ||
|
||
( | ||
cd y/x/x/x/x/x | ||
IFS=$(printf '\n') | ||
redo-ifchange static x/x/x/static $PWD/static \ | ||
$(/bin/pwd)/static /etc/passwd | ||
redo-ifchange $PWD/../static 2>/dev/null && exit 35 | ||
redo-ifchange 1.dyn x/x/x/2.dyn $PWD/3.dyn \ | ||
$PWD/../4.dyn $(/bin/pwd)/5.dyn | ||
) | ||
[ -e y/1.dyn ] || exit $((iter + 1)) | ||
[ -e y/2.dyn ] || exit $((iter + 2)) | ||
[ -e y/3.dyn ] || exit $((iter + 3)) | ||
[ -e 4.dyn ] || exit $((iter + 4)) | ||
[ -e y/5.dyn ] || exit $((iter + 5)) | ||
|
||
# Second iteration won't work in minimal/do since it only ever | ||
# builds things once. | ||
. ../skip-if-minimal-do.sh | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rm -rf y | ||
rm -f src x *.dyn *~ .*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
redo-ifchange src | ||
echo dynamic >$3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters