Show More
@@ -244,7 +244,17 b' def checklink(path):' | |||||
244 | # create a fixed file to link to; doesn't matter if it |
|
244 | # create a fixed file to link to; doesn't matter if it | |
245 | # already exists. |
|
245 | # already exists. | |
246 | target = 'checklink-target' |
|
246 | target = 'checklink-target' | |
247 | open(os.path.join(cachedir, target), 'w').close() |
|
247 | try: | |
|
248 | open(os.path.join(cachedir, target), 'w').close() | |||
|
249 | except IOError as inst: | |||
|
250 | if inst[0] == errno.EACCES: | |||
|
251 | # If we can't write to cachedir, just pretend | |||
|
252 | # that the fs is readonly and by association | |||
|
253 | # that the fs won't support symlinks. This | |||
|
254 | # seems like the least dangerous way to avoid | |||
|
255 | # data loss. | |||
|
256 | return False | |||
|
257 | raise | |||
248 | try: |
|
258 | try: | |
249 | os.symlink(target, name) |
|
259 | os.symlink(target, name) | |
250 | if cachedir is None: |
|
260 | if cachedir is None: |
General Comments 0
You need to be logged in to leave comments.
Login now