From aac24391b4146c0c1917f90b5391e73653a8c51f Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Jan 07 2019 11:36:18 +0000 Subject: Update to 5.2 --- diff --git a/.gitignore b/.gitignore index 577071d..9ff149d 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /pagure-5.1.1.tar.gz /pagure-5.1.3.tar.gz /pagure-5.1.4.tar.gz +/pagure-5.2.tar.gz diff --git a/0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch b/0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch deleted file mode 100644 index 63cbce8..0000000 --- a/0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 8ed43b1f9581fd81a29cb2902baf92a80d19bfb8 Mon Sep 17 00:00:00 2001 -From: Pierre-Yves Chibon -Date: Wed, 12 Dec 2018 14:50:48 +0100 -Subject: [PATCH] Port pagure to markdown 3.0+ while remaining backward - compatible - -Lift the restriction in the requirements.txt - -Fixes https://pagure.io/pagure/issue/3668 - -Signed-off-by: Pierre-Yves Chibon ---- - pagure/pfmarkdown.py | 26 ++++++++++++++++++++++---- - requirements.txt | 2 +- - 2 files changed, 23 insertions(+), 5 deletions(-) - -diff --git a/pagure/pfmarkdown.py b/pagure/pfmarkdown.py -index 39820ab2..6e5355d9 100644 ---- a/pagure/pfmarkdown.py -+++ b/pagure/pfmarkdown.py -@@ -34,6 +34,16 @@ import pagure.lib.query - from pagure.config import config as pagure_config - - -+try: -+ from markdown.inlinepatterns import ImagePattern as ImagePattern -+ -+ MK_VERSION = 2 -+except ImportError: -+ from markdown.inlinepatterns import ImageInlineProcessor as ImagePattern -+ -+ MK_VERSION = 3 -+ -+ - # the (? -Date: Mon, 26 Nov 2018 12:02:10 +0100 -Subject: [PATCH] Bypass old hooks rather than using non-existing symlinks - -When we moved to the runner architecture, we changed the way hooks are -called. During this move, we changed all of our existing hooks into -non-existing symlinks pointing to '/does/not/exists' and we were checking -if the files on disk were matching this target or not. -This created a few issue when releasing pagure: -- python setup.py sdist resolve symlinks as part of the archive creation - process - Reported in https://pagure.io/pagure/issue/3782 -- Building pagure failed on some system because these symlinks does not - exist - Reported in https://pagure.io/pagure/issue/3706 - -So in this commit we are dropping the use of symlink and just making -pagure ignore all the hook it could have created. - -Fixes https://pagure.io/pagure/issue/3782 -Fixes https://pagure.io/pagure/issue/3706 - -Signed-off-by: Pierre-Yves Chibon ---- - pagure/hooks/__init__.py | 7 +++---- - pagure/lib/__init__.py | 20 +++++++++++++++++--- - pagure/lib/tasks.py | 4 +--- - 3 files changed, 21 insertions(+), 10 deletions(-) - -diff --git a/pagure/hooks/__init__.py b/pagure/hooks/__init__.py -index 027f5822..d7409460 100644 ---- a/pagure/hooks/__init__.py -+++ b/pagure/hooks/__init__.py -@@ -411,10 +411,9 @@ def run_project_hooks( - if hook.startswith(hooktype + "."): - hookfile = os.path.join(hookdir, hook) - -- # Determine if this is an actual hook, or if it's a remnant -- # from a hook that was installed before it was moved to the -- # runner system. -- if os.path.realpath(hookfile) == pagure.lib.HOOK_DNE_TARGET: -+ # By-pass all the old hooks that pagure may have created before -+ # moving to the runner architecture -+ if hook in pagure.lib.ORIGINAL_PAGURE_HOOK: - continue - - # Execute -diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py -index 0284201b..aebd07d4 100644 ---- a/pagure/lib/__init__.py -+++ b/pagure/lib/__init__.py -@@ -70,9 +70,23 @@ REDIS = None - PAGURE_CI = None - REPOTYPES = ("main", "docs", "tickets", "requests") - _log = logging.getLogger(__name__) --# The target for hooks migrated to the Runner system, to be able to detect --# whether a hook was migrated without having to open and read the file --HOOK_DNE_TARGET = "/does/not/exist" -+# List of all the possible hooks pagure could generate before it was moved -+# to the runner architecture we now use. -+# This list is kept so we can ignore all of these hooks. -+ORIGINAL_PAGURE_HOOK = [ -+ "post-receive.default", -+ "post-receive.fedmsg", -+ "post-receive.irc", -+ "post-receive.mail", -+ "post-receive.mirror", -+ "post-receive.pagure", -+ "post-receive.pagure-requests", -+ "post-receive.pagure-ticket", -+ "post-receive.rtd", -+ "pre-receive.pagure_no_new_branches", -+ "pre-receive.pagureforcecommit", -+ "pre-receive.pagureunsignedcommit", -+] - - - class Unspecified(object): -diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py -index 74c03291..2e73121f 100644 ---- a/pagure/lib/tasks.py -+++ b/pagure/lib/tasks.py -@@ -651,7 +651,6 @@ def move_to_repospanner(self, session, name, namespace, user, region): - raise Exception("Project is already on repoSpanner") - - # Make sure that no non-runner hooks are enabled for this project -- compatible_targets = [pagure.lib.HOOK_DNE_TARGET] - incompatible_hooks = [] - for repotype in pagure.lib.REPOTYPES: - path = project.repopath(repotype) -@@ -666,8 +665,7 @@ def move_to_repospanner(self, session, name, namespace, user, region): - if hook.endswith(".sample"): - # Ignore the samples that Git inserts - continue -- hookfile = os.path.join(hookpath, hook) -- if os.path.realpath(hookfile) not in compatible_targets: -+ if hook not in pagure.lib.ORIGINAL_PAGURE_HOOK: - incompatible_hooks.append((repotype, hook)) - - if incompatible_hooks: --- -2.17.2 - diff --git a/pagure.spec b/pagure.spec index c43a595..7a10647 100644 --- a/pagure.spec +++ b/pagure.spec @@ -16,23 +16,14 @@ Name: pagure -Version: 5.1.4 -Release: 2%{?dist} +Version: 5.2 +Release: 1%{?dist} Summary: A git-centered forge License: GPLv2+ URL: https://pagure.io/pagure Source0: https://pagure.io/releases/pagure/%{name}-%{version}.tar.gz -# Backports from upstream -# Port pfmarkdown to Markdown v3 while remaining v2 compatible -# From: https://pagure.io/pagure/c/8ed43b1f9581fd81a29cb2902baf92a80d19bfb8 -Patch0001: 0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch -# Avoid the need for non-existent symlinks to trigger migration to new hooks -# From: https://pagure.io/pagure/c/4937c4e266b2d1a2583b793128f87c66c96a7d5e -Patch0002: 0002-Bypass-old-hooks-rather-than-using-non-existing-syml.patch - - BuildArch: noarch BuildRequires: systemd-devel @@ -248,8 +239,11 @@ install -p -m 644 createdb.py $RPM_BUILD_ROOT/%{_datadir}/pagure/pagure_createdb # Install the api_key_expire_mail.py script install -p -m 644 files/api_key_expire_mail.py $RPM_BUILD_ROOT/%{_datadir}/pagure/api_key_expire_mail.py +# Install the mirror_project_in.py script +install -p -m 644 files/mirror_project_in.py $RPM_BUILD_ROOT/%{_datadir}/pagure/mirror_project_in.py + # Install the keyhelper and aclcheck scripts -mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/pagure +mkdir -p $RPM_BUILD_ROOT/%{_libexecdir}/pagure/ install -p -m 755 files/aclchecker.py $RPM_BUILD_ROOT/%{_libexecdir}/pagure/aclchecker.py install -p -m 755 files/keyhelper.py $RPM_BUILD_ROOT/%{_libexecdir}/pagure/keyhelper.py @@ -295,6 +289,12 @@ install -p -m 644 files/pagure_api_key_expire_mail.service \ install -p -m 644 files/pagure_api_key_expire_mail.timer \ $RPM_BUILD_ROOT/%{_unitdir}/pagure_api_key_expire_mail.timer +# Install the systemd file for the script updating mirrored project +install -p -m 644 files/pagure_mirror_project_in.service \ + $RPM_BUILD_ROOT/%{_unitdir}/pagure_mirror_project_in.service +install -p -m 644 files/pagure_mirror_project_in.timer \ + $RPM_BUILD_ROOT/%{_unitdir}/pagure_mirror_project_in.timer + # Install the milter files mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/run/pagure mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} @@ -352,6 +352,7 @@ done %systemd_post pagure_worker.service %systemd_post pagure_gitolite_worker.service %systemd_post pagure_api_key_expire_mail.timer +%systemd_post pagure_mirror_project_in.timer %post milters %systemd_post pagure_milter.service %post ev @@ -371,6 +372,7 @@ done %systemd_preun pagure_worker.service %systemd_preun pagure_gitolite_worker.service %systemd_preun pagure_api_key_expire_mail.timer +%systemd_preun pagure_mirror_project_in.timer %preun milters %systemd_preun pagure_milter.service %preun ev @@ -390,6 +392,7 @@ done %systemd_postun_with_restart pagure_worker.service %systemd_postun_with_restart pagure_gitolite_worker.service %systemd_postun pagure_api_key_expire_mail.timer +%systemd_postun pagure_mirror_project_in.timer %postun milters %systemd_postun_with_restart pagure_milter.service %postun ev @@ -431,6 +434,8 @@ done %{_unitdir}/pagure_gitolite_worker.service %{_unitdir}/pagure_api_key_expire_mail.service %{_unitdir}/pagure_api_key_expire_mail.timer +%{_unitdir}/pagure_mirror_project_in.service +%{_unitdir}/pagure_mirror_project_in.timer %files theme-pagureio @@ -489,6 +494,9 @@ done %changelog +* Mon Jan 07 2019 Neal Gompa - 5.2-1 +- Update to 5.2 + * Fri Dec 14 2018 Neal Gompa - 5.1.4-2 - Backport fix from master to add compatibility with Markdown 3.0+ - Backport fix from master to properly skip legacy hooks diff --git a/sources b/sources index 8c600c4..e6b1ac9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pagure-5.1.4.tar.gz) = 80b1a96529f6451160ffaeafeb94bccb73c86579b27dda1e9ba90d0059d89bb80164d84d03b5e9e78359f07f63f52416a27ee973094e7bf013764753172037a9 +SHA512 (pagure-5.2.tar.gz) = 047c9690e8ee8b5d4facf98ada56f050fe888ecd1ce3f026f0d4e99ffdee11a570ed67acfbbc1fbab36abba2b0e9175cc8874fd0a81dcded54eef43134955b8e