[projects/git-slug: 164/170] Encode paths in projects.list file

glen glen at pld-linux.org
Mon Sep 21 21:52:35 CEST 2015


commit 6ca2d3d4669da66801ce0786cee7db5323b62e60
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Fri Feb 22 07:27:51 2013 +0000

    Encode paths in projects.list file
    
    Paths in projects_list file has to be URI encoded (see man gitweb).

 slug_watch | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/slug_watch b/slug_watch
index edf6ec8..2a0da28 100755
--- a/slug_watch
+++ b/slug_watch
@@ -12,6 +12,7 @@ import signal
 import sys
 
 from contextlib import contextmanager
+from urllib.parse import quote_plus
 
 import Daemon.daemon
 from git_slug.gitconst import EMPTYSHA1, REFREPO, REFFILE
@@ -73,7 +74,7 @@ def process_file(pathname):
                 if sha1 != EMPTYSHA1:
                     print(sha1, ref, repo, file=headfile_new)
                     if repo != oldtuple[0]:
-                        print('packages/'+repo+'.git', file=projects)
+                        print(quote_plus('packages/'+repo+'.git', safe='/'), file=projects)
                 oldtuple = (repo, ref)
         except ValueError:
             logger.error("Problem with file: {}".format(pathname))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list