mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user