diff --git a/pagure/hooks/fedmsg.py b/pagure/hooks/fedmsg.py index 9c69ba8..be6f133 100644 --- a/pagure/hooks/fedmsg.py +++ b/pagure/hooks/fedmsg.py @@ -87,11 +87,11 @@ class Fedmsg(BaseHook): os.makedirs(hookfolder) # Install the hook itself - hook_file = os.path.join(hook_files, 'fedmsg_hook.py') + hook_file = os.path.join(repopath, 'hooks', 'post-receive.fedmsg') if not os.path.exists(hook_file): os.symlink( - hook_file, - os.path.join(repopath, 'hooks', 'post-receive.fedmsg') + os.path.join(hook_files, 'fedmsg_hook.py'), + hook_file ) @classmethod diff --git a/pagure/hooks/mail.py b/pagure/hooks/mail.py index da1be78..90cdfca 100644 --- a/pagure/hooks/mail.py +++ b/pagure/hooks/mail.py @@ -95,11 +95,11 @@ class Mail(BaseHook): 'multimailhook.environment', '', 'gitolite') # Install the hook itself - hook_file = os.path.join(hook_files, 'git_multimail.py') + hook_file = os.path.join(repopath, 'hooks', 'post-receive.mail') if not os.path.exists(hook_file): os.symlink( - hook_file, - os.path.join(repopath, 'hooks', 'post-receive.mail') + os.path.join(hook_files, 'git_multimail.py'), + hook_file ) @classmethod diff --git a/pagure/hooks/pagure_hook.py b/pagure/hooks/pagure_hook.py index ec6b0a9..22773f2 100644 --- a/pagure/hooks/pagure_hook.py +++ b/pagure/hooks/pagure_hook.py @@ -95,7 +95,7 @@ class PagureHook(BaseHook): hook_path = os.path.join( repopath, 'hooks', 'post-receive.pagure') hook_file = os.path.join(hook_files, 'git_multimail.py') - if not os.path.exists(hook_file): + if not os.path.exists(hook_path): os.symlink(hook_file, hook_path) @classmethod diff --git a/pagure/hooks/pagure_request_hook.py b/pagure/hooks/pagure_request_hook.py index 3f8f57e..83421b7 100644 --- a/pagure/hooks/pagure_request_hook.py +++ b/pagure/hooks/pagure_request_hook.py @@ -112,10 +112,11 @@ class PagureRequestHook(BaseHook): # Install the hook itself hook_path = os.path.join( repopath, 'hooks', 'post-receive.pagure-requests') - os.symlink( - os.path.join(hook_files, 'pagure_hook_requests.py'), - hook_path - ) + if not os.path.exists(hook_path): + os.symlink( + os.path.join(hook_files, 'pagure_hook_requests.py'), + hook_path + ) @classmethod def remove(cls, project): diff --git a/pagure/hooks/pagure_ticket_hook.py b/pagure/hooks/pagure_ticket_hook.py index b4f5d61..bfad88c 100644 --- a/pagure/hooks/pagure_ticket_hook.py +++ b/pagure/hooks/pagure_ticket_hook.py @@ -111,11 +111,11 @@ class PagureTicketHook(BaseHook): # Install the hook itself hook_path = os.path.join( repopath, 'hooks', 'post-receive.pagure-ticket') - shutil.copyfile( - os.path.join(hook_files, 'pagure_hook_tickets.py'), - hook_path - ) - os.chmod(hook_path, 0755) + if not os.path.exists(hook_path): + os.symlink( + os.path.join(hook_files, 'pagure_hook_tickets.py'), + hook_path + ) @classmethod def remove(cls, project):