From 84a850b72985e0c739893736556de3de13f7a9e6 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sep 22 2018 19:29:41 +0000 Subject: [PATCH 1/2] Fix shebangs for new pagure hooks The shebangs for the pagure hooks were slightly wrong, so they did not match when being fixed up in packaging. In addition, there are some new hook files that need to have the shebangs set correctly during the package build. Signed-off-by: Neal Gompa --- diff --git a/files/pagure.spec b/files/pagure.spec index 7bb111f..f2bc372 100644 --- a/files/pagure.spec +++ b/files/pagure.spec @@ -305,7 +305,10 @@ sed -e "s|#!/usr/bin/env python|#!%{__python}|" -i \ $RPM_BUILD_ROOT/%{_datadir}/pagure/comment_email_milter.py \ $RPM_BUILD_ROOT/%{_datadir}/pagure/pagure_createdb.py \ $RPM_BUILD_ROOT/%{_datadir}/pagure/api_key_expire_mail.py \ - $RPM_BUILD_ROOT/%{python_sitelib}/pagure/hooks/files/*.py + $RPM_BUILD_ROOT/%{python_sitelib}/pagure/hooks/files/*.py \ + $RPM_BUILD_ROOT/%{python_sitelib}/pagure/hooks/files/post-receive \ + $RPM_BUILD_ROOT/%{python_sitelib}/pagure/hooks/files/pre-receive \ + $RPM_BUILD_ROOT/%{python_sitelib}/pagure/hooks/files/repospannerhook # Switch interpreter for systemd units sed -e "s|/usr/bin/python|%{__python}|g" -i $RPM_BUILD_ROOT/%{_unitdir}/*.service diff --git a/pagure/hooks/files/hookrunner b/pagure/hooks/files/hookrunner index 7b19abb..b59732a 100755 --- a/pagure/hooks/files/hookrunner +++ b/pagure/hooks/files/hookrunner @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python # -*- coding: utf-8 -*- """ diff --git a/pagure/hooks/files/repospannerhook b/pagure/hooks/files/repospannerhook index 2669cda..663cb26 100755 --- a/pagure/hooks/files/repospannerhook +++ b/pagure/hooks/files/repospannerhook @@ -1,4 +1,4 @@ -#!/bin/env python3 +#!/usr/bin/env python # -*- coding: utf-8 -*- """ From 38766c338d7464444daafd341888982410c4f77c Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sep 22 2018 19:29:41 +0000 Subject: [PATCH 2/2] Drop unneeded commands in pagure.spec prep stage These extra steps actually cause the package build to fail because you cannot use chmod to set the executable bit on a symlink. They aren't necessary anyway, since they are committed to Git with the correct permissions. Signed-off-by: Neal Gompa --- diff --git a/files/pagure.spec b/files/pagure.spec index f2bc372..425f1c4 100644 --- a/files/pagure.spec +++ b/files/pagure.spec @@ -201,10 +201,6 @@ of this pagure instance. %prep %autosetup -p1 -# In case it gets broken in git at least the rpm will be good -chmod +x pagure/hooks/files/* -chmod +x files/api_key_expire_mail.py - %if 0%{?rhel} && 0%{?rhel} <= 7 # Fix requirements.txt for EL7 setuptools ## Remove environment markers, as they're not supported