• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4116 (tree)
時間2020-10-14 22:24:01
作者magicant

Log Message

configure: Create *.d files safely

The previous implementation (recursively calling function) was not
safe when there was some symbolic link to a directory

Change Summary

差異

--- yash/trunk/configure (revision 4115)
+++ yash/trunk/configure (revision 4116)
@@ -1798,25 +1798,13 @@
17981798
17991799
18001800 # create dependency files if there are none
1801-makedep() {
1802- for i in ${1}*.c
1803- do
1804- if [ -f "${i}" ] && [ ! -f "${i%.c}.d" ]
1805- then
1806- printf 'touching %s\n' "${i%.c}.d"
1807- >>"${i%.c}.d"
1808- printf 'Touched %s\n' "${i%.c}.d" >&5
1809- fi
1810- done
1811- for i in ${1}*/
1812- do
1813- if [ -d "${i}" ]
1814- then
1815- makedep "${i}"
1816- fi
1817- done
1818-}
1819-makedep ''
1801+find . -name '*.c' -exec sh -c '
1802+dfile="${1%.c}.d"
1803+[ -f "$dfile" ] && exit
1804+printf "touching %s\n" "$dfile"
1805+>>"$dfile"
1806+printf "Touched %s\n" "$dfile" >&5
1807+' x {} \;
18201808
18211809 # create config.status
18221810 printf 'creating %s... ' "${configstatus}"
Show on old repository browser