From 640c72e104bbe95f1b6e34d2c5d727232326300a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 27 2015 07:50:35 +0000 Subject: Rename the pagure ticket and request hook to have dedicated names Relates to http://209.132.184.222/pagure/issue/78 --- diff --git a/pagure/hooks/pagure_request_hook.py b/pagure/hooks/pagure_request_hook.py index b654524..e25163e 100644 --- a/pagure/hooks/pagure_request_hook.py +++ b/pagure/hooks/pagure_request_hook.py @@ -110,13 +110,13 @@ class PagureRequestHook(BaseHook): repo_obj = pygit2.Repository(repopath) # Install the hook itself + hook_path = os.path.join( + repopath, 'hooks', 'post-receive.pagure-requests') shutil.copyfile( os.path.join(hook_files, 'pagure_hook_requests.py'), - os.path.join(repopath, 'hooks', 'post-receive.pagure') + hook_path ) - os.chmod( - os.path.join(repopath, 'hooks', 'post-receive.pagure'), - 0755) + os.chmod(hook_path, 0755) @classmethod def remove(cls, project): @@ -131,6 +131,6 @@ class PagureRequestHook(BaseHook): flask.abort(404, 'No git repo found') hook_path = os.path.join( - repopath, 'hooks', 'post-receive.pagure') + repopath, 'hooks', 'post-receive.pagure-requests') if os.path.exists(hook_path): os.unlink(hook_path) diff --git a/pagure/hooks/pagure_ticket_hook.py b/pagure/hooks/pagure_ticket_hook.py index f1ed3dc..f71fbea 100644 --- a/pagure/hooks/pagure_ticket_hook.py +++ b/pagure/hooks/pagure_ticket_hook.py @@ -109,13 +109,13 @@ class PagureTicketHook(BaseHook): repo_obj = pygit2.Repository(repopath) # 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'), - os.path.join(repopath, 'hooks', 'post-receive.pagure') + hook_path ) - os.chmod( - os.path.join(repopath, 'hooks', 'post-receive.pagure'), - 0755) + os.chmod(hook_path, 0755) @classmethod def remove(cls, project): @@ -130,6 +130,6 @@ class PagureTicketHook(BaseHook): flask.abort(404, 'No git repo found') hook_path = os.path.join( - repopath, 'hooks', 'post-receive.pagure') + repopath, 'hooks', 'post-receive.pagure-ticket') if os.path.exists(hook_path): os.unlink(hook_path)