From 13d8fe58d9753a1756577385e33a729bc3a0ca6d Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 31 Dec 2008 16:29:11 +0100 Subject: [PATCH] Dump the description of the projects. --- gitdump.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gitdump.py b/gitdump.py index 164794d..f5f6965 100644 --- a/gitdump.py +++ b/gitdump.py @@ -40,9 +40,9 @@ class AuthorizedKeysDumper: def dumprepos(self): # FIXME: use a trigger to indicate if *anything at all* has changed curs = self.db.cursor() - curs.execute("SELECT name,anonymous,web,(SELECT min(first_name) FROM repository_permissions AS rp LEFT JOIN auth_user AS au ON au.username=rp.userid WHERE rp.level=2 AND rp.repository=r.repoid) FROM repositories AS r WHERE approved ORDER BY name") + curs.execute("SELECT name,anonymous,web,description,(SELECT min(first_name) FROM repository_permissions AS rp LEFT JOIN auth_user AS au ON au.username=rp.userid WHERE rp.level=2 AND rp.repository=r.repoid) FROM repositories AS r WHERE approved ORDER BY name") f = open("%s.tmp" % self.conf.get("paths", "gitweblist"), "w") - for name, anon, web, owner in curs: + for name, anon, web, description, owner in curs: # Check if this repository exists at all if not os.path.isdir("%s/repos/%s" % (self.conf.get("paths", "githome"), name)): # Does not exist, let's initialize a new one @@ -54,6 +54,10 @@ class AuthorizedKeysDumper: # Check for publishing options here if web: f.write("%s %s\n" % (urllib.quote_plus(name), urllib.quote_plus(owner))) + df = open("%s/repos/%s/description" % (self.conf.get("paths", "githome"), name), "w") + df.write(description) + df.close() + anonfile = "%s/repos/%s/git-daemon-export-ok" % (self.conf.get("paths", "githome"), name) if anon: if not os.path.isfile(anonfile): -- 2.39.5