list-source-files: Fix the behavior for processing soft links

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-10-28 18:09:04 +00:00
parent 1e9ec5d21a
commit dad9e0317c

View File

@@ -1,12 +1,18 @@
#!/bin/bash
inode() {
ls -id "$1" | { read a b; echo "$a"; }
}
list_source_files() {
local d r
d="$(cd "$1" && echo "$PWD")"
r="$d"
while [ "$r" != "/" -a ! -e "$r/.svn" -a ! -e "$r/.git" -a ! -e "$r/.hg" ]; do
r="$(dirname "$r")"
inode_root="$(inode /)"
while [ $(inode "$r") != "${inode_root}" -a \
! -e "$r/.svn" -a ! -e "$r/.git" -a ! -e "$r/.hg" ]; do
r="$r/.."
done
if [ -e "$r/.svn" ]; then