mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
symlink targets may exist; ignore them
This commit is contained in:
parent
e02972f610
commit
7f90c1a54c
1 changed files with 7 additions and 2 deletions
|
@ -225,8 +225,13 @@ class EventHandler(pyinotify.ProcessEvent):
|
|||
newd = os.path.join(base, newarch)
|
||||
newpath = os.path.join(newd, file)
|
||||
if action == 'add':
|
||||
os.symlink(os.path.join('..', arch, file), newpath)
|
||||
self._real_dispatch(newd, ActionInfo(newpath, action))
|
||||
try:
|
||||
os.symlink(os.path.join('..', arch, file), newpath)
|
||||
except FileExistsError:
|
||||
# already there? do nothing then.
|
||||
else:
|
||||
# XXX: this should be removed as soon as symlinks are supported
|
||||
self._real_dispatch(newd, ActionInfo(newpath, action))
|
||||
else:
|
||||
try:
|
||||
os.unlink(newpath)
|
||||
|
|
Loading…
Add table
Reference in a new issue