[projects/git-slug: 170/170] slug_watch: Separate cgit and gitweb projects_list
glen
glen at pld-linux.org
Mon Sep 21 21:53:06 CEST 2015
commit 4ed64f73960519a2f4fd04c42950b2c96ae795c5
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Thu Aug 15 14:56:44 2013 +0100
slug_watch: Separate cgit and gitweb projects_list
cgit projects_list is plain text while gitweb requires
the paths in the file to be URI encoded.
slug_watch | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/slug_watch b/slug_watch
index 70a7b2b..b077de9 100755
--- a/slug_watch
+++ b/slug_watch
@@ -23,6 +23,7 @@ LOCKFILE = 'slug_watch.lock'
PROJECTS_LIST = 'projects.list'
PROJECTS_LIST_NEW = PROJECTS_LIST + '.new'
PROJECTS_LIST_HEAD = PROJECTS_LIST + '.head'
+PROJECTS_LIST_GITWEB = PROJECTS_LIST + ".gitweb"
REFFILE_NEW = REFFILE + '.new'
REFREPO_WDIR = 'Refs'
@@ -83,7 +84,7 @@ def process_file(pathname):
if sha1 != EMPTYSHA1:
print(sha1, ref, repo, file=headfile_new)
if repo != oldtuple[0]:
- print(quote_plus('packages/'+repo+'.git', safe='/'), file=projects)
+ print('packages/'+repo+'.git', file=projects)
oldtuple = (repo, ref)
except ValueError:
logger.error("Problem with file: {}".format(pathname))
@@ -91,6 +92,10 @@ def process_file(pathname):
process.wait()
os.rename(PROJECTS_LIST_NEW, PROJECTS_LIST)
+ with open(PROJECTS_LIST, 'r') as projects, open(PROJECTS_LIST_GITWEB, 'w') as output:
+ for line in projects:
+ print(quote_plus(line, safe='/\n'), end='', file=output)
+
headrepo = GitRepo(REFREPO_WDIR, REFREPO_GDIR)
headrepo.commitfile(REFFILE, 'Changes by {}'.format(committer))
os.remove(pathname)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list