[packages/pld-gitolite] Rel 3; python3 3.13 fixes

arekm arekm at pld-linux.org
Thu Jul 16 13:13:08 CEST 2026


commit 4fd6408083eaeec8ac11abb69d5b770f5bc269f4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Jul 16 13:12:37 2026 +0200

    Rel 3; python3 3.13 fixes

 pld-gitolite.spec |  4 +++-
 python.patch      | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/pld-gitolite.spec b/pld-gitolite.spec
index 942aee8..696af19 100644
--- a/pld-gitolite.spec
+++ b/pld-gitolite.spec
@@ -3,7 +3,7 @@ Summary:	Gitolite setup used by PLD
 Summary(pl.UTF-8):	Konfiguracja Gitolite wykorzystywana przez PLD
 Name:		pld-gitolite
 Version:	0.13.4
-Release:	2
+Release:	3
 License:	GPL v2
 Group:		Development/Building
 Source0:	https://github.com/draenog/gitolite-scripts/tarball/v%{version}/gitolite-scripts.tar.gz
@@ -14,6 +14,7 @@ Source3:	git.conf
 Source4:	gitweb.conf
 Source5:	pld-developers
 Source6:	crontab
+Patch0:		python.patch
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.202
 Requires:	crondaemon
@@ -43,6 +44,7 @@ Konfiguracja Gitolite wykorzystywana przez PLD.
 %prep
 %setup -qc
 mv draenog-gitolite-scripts-*/* .
+%patch -P0 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/python.patch b/python.patch
new file mode 100644
index 0000000..80f11c5
--- /dev/null
+++ b/python.patch
@@ -0,0 +1,42 @@
+--- a/hooks/post-receive
++++ b/hooks/post-receive
+@@ -1,12 +1,20 @@
+ #!/usr/bin/python3 -u
+ 
+ import glob
+-import imp
++import importlib.util
+ import os
+ import sys
+ import subprocess
+ 
+ 
++def load_source(name, path):
++    spec = importlib.util.spec_from_file_location(name, path)
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[name] = module
++    spec.loader.exec_module(module)
++    return module
++
++
+ data = sys.stdin.readlines()
+ 
+ if (os.path.isdir('hooks/post-receive.d')):
+@@ -24,5 +32,5 @@
+         hook_process.communicate()
+ 
+ for pluginfile in glob.glob('hooks/post-receive.python.d/*.py'):
+-    plugin = imp.load_source(os.path.basename(pluginfile), pluginfile)
++    plugin = load_source(os.path.basename(pluginfile), pluginfile)
+     plugin.run(data)
+--- a/hooks/post-receive.d/gnome/git.py
++++ b/hooks/post-receive.d/gnome/git.py
+@@ -143,7 +143,7 @@
+ 
+     result = []
+     for i in range(0, len(lines), 2):
+-        m = re.match("commit\s+([A-Fa-f0-9]+)", lines[i])
++        m = re.match(r"commit\s+([A-Fa-f0-9]+)", lines[i])
+         if not m:
+             raise RuntimeException("Can't parse commit it '%s'", lines[i])
+         commit_id = m.group(1)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pld-gitolite.git/commitdiff/4fd6408083eaeec8ac11abb69d5b770f5bc269f4



More information about the pld-cvs-commit mailing list