diff options
| author | Shawn O. Pearce <sop@google.com> | 2008-11-03 09:59:36 -0800 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2008-11-03 09:59:36 -0800 |
| commit | 438ee1cad98ac32509718976e63c36a449bfb679 (patch) | |
| tree | 9627a7fc84e5aab01a2ece8eae6c0ac045e20a46 | |
| parent | 23d7781c0bac53b24f4598104e8ba38310e8d100 (diff) | |
| download | git-repo-438ee1cad98ac32509718976e63c36a449bfb679.tar.gz | |
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>
| -rw-r--r-- | project.py | 11 |
1 files changed, 9 insertions, 2 deletions
| @@ -12,6 +12,7 @@ | |||
| 12 | # See the License for the specific language governing permissions and | 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. | 13 | # limitations under the License. |
| 14 | 14 | ||
| 15 | import errno | ||
| 15 | import filecmp | 16 | import filecmp |
| 16 | import os | 17 | import os |
| 17 | import re | 18 | import re |
| @@ -864,8 +865,14 @@ class Project(object): | |||
| 864 | 'refs', | 865 | 'refs', |
| 865 | 'rr-cache', | 866 | 'rr-cache', |
| 866 | 'svn']: | 867 | 'svn']: |
| 867 | os.symlink(os.path.join(relgit, name), | 868 | try: |
| 868 | os.path.join(dotgit, name)) | 869 | os.symlink(os.path.join(relgit, name), |
| 870 | os.path.join(dotgit, name)) | ||
| 871 | except OSError, e: | ||
| 872 | if e.errno == errno.EPERM: | ||
| 873 | raise GitError('filesystem must support symlinks') | ||
| 874 | else: | ||
| 875 | raise | ||
| 869 | 876 | ||
| 870 | rev = self.GetRemote(self.remote.name).ToLocal(self.revision) | 877 | rev = self.GetRemote(self.remote.name).ToLocal(self.revision) |
| 871 | rev = self.bare_git.rev_parse('%s^0' % rev) | 878 | rev = self.bare_git.rev_parse('%s^0' % rev) |
