Преглед на файлове

Catch symlink creation failures and report a better error

Some users have noticed that repo doesn't work on VFAT, as we
require a POSIX filesystem with POSIX symlink support.  Catching the
OSError during our symlink creation and raising a GitError with a
more descriptive message will help users to troubleshoot and fix
their own installation problems.

Signed-off-by: Shawn O. Pearce <sop@google.com>
Shawn O. Pearce преди 17 години
родител
ревизия
438ee1cad9
променени са 1 файла, в които са добавени 9 реда и са изтрити 2 реда
  1. 9 2
      project.py

+ 9 - 2
project.py

@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import errno
 import filecmp
 import os
 import re
@@ -864,8 +865,14 @@ class Project(object):
                    'refs',
                    'rr-cache',
                    'svn']:
-        os.symlink(os.path.join(relgit, name),
-                   os.path.join(dotgit, name))
+        try:
+          os.symlink(os.path.join(relgit, name),
+                     os.path.join(dotgit, name))
+        except OSError, e:
+          if e.errno == errno.EPERM:
+            raise GitError('filesystem must support symlinks')
+          else:
+            raise
 
       rev = self.GetRemote(self.remote.name).ToLocal(self.revision)
       rev = self.bare_git.rev_parse('%s^0' % rev)