bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is n


From: Paul Eggert
Subject: Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported
Date: Wed, 27 May 2015 07:59:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

KO Myung-Hun wrote:

+# Check if symbolic link is supported
+have_symlink_support=false
+rm -f symlink$$.file symlink$$
+if (echo >symlink$$.file) 2>/dev/null; then
+  if ln -s symlink$$.file symlink$$ 2>/dev/null; then
+    have_symlink_support=true
+  fi
+fi
+rm -f symlink$$.file symlink$$

There's no need to use the echo; just use ln -s (the target need not exist).

Also, this test should be done dynamically, when the actual ln -s is run, not at the start of the run. That is because 'ln -s' might succeed on some file systems but not on others. It's OK to output a warning for the first ln -s that
is replaced by a cp, but I wouldn't warn for each one.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]