commit 3a7572ad39cb8c9abd07571f704b73760da6f656
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Mon Dec 17 15:01:05 2018 +0100
upload.cgi: add support for more namespaces
roles/distgit/files/dist-git-upload.cgi | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/roles/distgit/files/dist-git-upload.cgi
b/roles/distgit/files/dist-git-upload.cgi
index e8f73c8..485df34 100755
--- a/roles/distgit/files/dist-git-upload.cgi
+++ b/roles/distgit/files/dist-git-upload.cgi
@@ -149,15 +149,16 @@ def main():
print >> sys.stderr, '[username=%s] Processing upload request: NAME=%s
FILENAME=%s %sSUM=%s' % (username, name, filename, hash_type.upper(), checksum)
# first test if the module really exists
- section = 'free'
- git_dir = os.path.join(GITREPO, section , '%s.git' % name)
- if not os.path.isdir(git_dir):
- section = 'nonfree'
+ sections = ['free', 'nonfree', 'rpi', 'cuda' ]
+ for section in sections :
git_dir = os.path.join(GITREPO, section , '%s.git' % name)
- if not os.path.isdir(git_dir):
- print >> sys.stderr, '[username=%s] Unknown module: %s' %
(username, name)
- send_error('Module "%s" does not exist!' % name,
- status='404 Not Found')
+ if os.path.isdir(git_dir):
+ break
+
+ if not os.path.isdir(git_dir):
+ print >> sys.stderr, '[username=%s] Unknown module: %s' %
(username, name)
+ send_error('Module "%s" does not exist!' % name,
+ status='404 Not Found')
module_dir = os.path.join(CACHE_DIR, section, name)
hash_dir = os.path.join(module_dir, filename, hash_type, checksum)
Show replies by date