diff --git a/dist-git.spec b/dist-git.spec index 4e0a4e2..6e9b9e8 100644 --- a/dist-git.spec +++ b/dist-git.spec @@ -5,7 +5,7 @@ Name: dist-git Version: 1.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Package source version control system # upload.cgi uses GPLv1 @@ -18,6 +18,8 @@ URL: https://github.com/release-engineering/dist-git Source0: %{name}-%{version}.tar.gz BuildArch: noarch +Patch0: ensure_gitrepo_namespaced.patch + BuildRequires: systemd Requires: httpd @@ -67,7 +69,7 @@ This package includes SELinux support. %prep %setup -q - +%patch0 -p1 %build # ------------------------------------------------------------------------------ @@ -213,6 +215,9 @@ fi %changelog +* Thu Oct 26 2017 clime - 1.4-3 +- add ensure_gitrepo_namespaced patch + * Wed Jul 26 2017 Fedora Release Engineering - 1.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/ensure_gitrepo_namespaced.patch b/ensure_gitrepo_namespaced.patch new file mode 100644 index 0000000..e440166 --- /dev/null +++ b/ensure_gitrepo_namespaced.patch @@ -0,0 +1,39 @@ +From 15ec38ca2cb761ca02eb75d6a31565f894bf2f00 Mon Sep 17 00:00:00 2001 +From: clime +Date: Thu, 26 Oct 2017 17:06:04 +0200 +Subject: [PATCH] patch for Fedora + +--- + scripts/httpd/upload.cgi | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/scripts/httpd/upload.cgi b/scripts/httpd/upload.cgi +index 1de12a3..78f3ba9 100644 +--- a/scripts/httpd/upload.cgi ++++ b/scripts/httpd/upload.cgi +@@ -91,6 +91,13 @@ def makedirs(dir_, username, mode=02755): + send_error(str(e)) + + ++def ensure_namespaced(name): ++ name_parts = name.split('/') ++ if len(name_parts) == 1: ++ return 'rpms/'+name ++ return name ++ ++ + def main(): + config = ConfigParser() + config.read('/etc/dist-git/dist-git.conf') +@@ -165,7 +172,7 @@ def main(): + msgpath = os.path.join(name, filename, hash_type, checksum, filename) + + # first test if the module really exists +- git_dir = os.path.join(config['dist-git']['gitroot_dir'], '%s.git' % name) ++ git_dir = os.path.join(config['dist-git']['gitroot_dir'], '%s.git' % ensure_namespaced(name)) + if not os.path.isdir(git_dir): + sys.stderr.write('[username=%s] Unknown module: %s' % (username, name)) + send_error('Module "%s" does not exist!' % name, +-- +2.9.5 +