diff --git a/pagure/hooks/fedmsg.py b/pagure/hooks/fedmsg.py index d3ea77d..9c69ba8 100644 --- a/pagure/hooks/fedmsg.py +++ b/pagure/hooks/fedmsg.py @@ -87,10 +87,12 @@ class Fedmsg(BaseHook): os.makedirs(hookfolder) # Install the hook itself - os.symlink( - os.path.join(hook_files, 'fedmsg_hook.py'), - os.path.join(repopath, 'hooks', 'post-receive.fedmsg') - ) + hook_file = os.path.join(hook_files, 'fedmsg_hook.py') + if not os.path.exists(hook_file): + os.symlink( + hook_file, + os.path.join(repopath, 'hooks', 'post-receive.fedmsg') + ) @classmethod def remove(cls, project): diff --git a/pagure/hooks/irc.py b/pagure/hooks/irc.py index cc314a2..6264e0b 100644 --- a/pagure/hooks/irc.py +++ b/pagure/hooks/irc.py @@ -122,10 +122,12 @@ class Hook(BaseHook): # repo_obj.config.set_multivar() # Install the hook itself - #os.symlink( - #os.path.join(hook_files, 'git_irc.py'), - #os.path.join(repopath, 'hooks', 'post-receive.irc') - #) + #hook_file = os.path.join(hook_files, 'git_irc.py') + #if not os.path.exists(hook_file): + #os.symlink( + #hook_file, + #os.path.join(repopath, 'hooks', 'post-receive.irc') + #) @classmethod def remove(cls, project): diff --git a/pagure/hooks/mail.py b/pagure/hooks/mail.py index f463f02..da1be78 100644 --- a/pagure/hooks/mail.py +++ b/pagure/hooks/mail.py @@ -95,10 +95,12 @@ class Mail(BaseHook): 'multimailhook.environment', '', 'gitolite') # Install the hook itself - os.symlink( - os.path.join(hook_files, 'git_multimail.py'), - os.path.join(repopath, 'hooks', 'post-receive.mail') - ) + hook_file = os.path.join(hook_files, 'git_multimail.py') + if not os.path.exists(hook_file): + os.symlink( + hook_file, + os.path.join(repopath, 'hooks', 'post-receive.mail') + ) @classmethod def remove(cls, project): diff --git a/pagure/hooks/pagure_hook.py b/pagure/hooks/pagure_hook.py index 4c430e4..ec6b0a9 100644 --- a/pagure/hooks/pagure_hook.py +++ b/pagure/hooks/pagure_hook.py @@ -94,7 +94,9 @@ class PagureHook(BaseHook): # Install the hook itself hook_path = os.path.join( repopath, 'hooks', 'post-receive.pagure') - os.symlink(hook_file, hook_path) + hook_file = os.path.join(hook_files, 'git_multimail.py') + if not os.path.exists(hook_file): + os.symlink(hook_file, hook_path) @classmethod def remove(cls, project): diff --git a/pagure/hooks/pagure_request_hook.py b/pagure/hooks/pagure_request_hook.py index 1bc00c9..3f8f57e 100644 --- a/pagure/hooks/pagure_request_hook.py +++ b/pagure/hooks/pagure_request_hook.py @@ -87,10 +87,9 @@ class PagureRequestHook(BaseHook): # Install the main post-receive file postreceive = os.path.join(hookfolder, 'post-receive') - if not os.path.exists(postreceive): - os.symlink( - os.path.join(hook_files, 'post-receive'), - postreceive) + hook_file = os.path.join(hook_files, 'git_multimail.py') + if not os.path.exists(hook_file): + os.symlink(hook_file, postreceive) @classmethod def install(cls, project, dbobj): diff --git a/pagure/hooks/pagure_ticket_hook.py b/pagure/hooks/pagure_ticket_hook.py index 26c71b0..b4f5d61 100644 --- a/pagure/hooks/pagure_ticket_hook.py +++ b/pagure/hooks/pagure_ticket_hook.py @@ -86,10 +86,9 @@ class PagureTicketHook(BaseHook): # Install the main post-receive file postreceive = os.path.join(hookfolder, 'post-receive') - if not os.path.exists(postreceive): - os.symlink( - os.path.join(hook_files, 'post-receive'), - postreceive) + hook_file = os.path.join(hook_files, 'git_multimail.py') + if not os.path.exists(hook_file): + os.symlink(hook_file, postreceive) @classmethod def install(cls, project, dbobj):