Dump the description of the projects.
authorMagnus Hagander <magnus@hagander.net>
Wed, 31 Dec 2008 15:29:11 +0000 (16:29 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 31 Dec 2008 15:29:11 +0000 (16:29 +0100)
gitdump.py

index 164794d1904701a375539fe9d90e9b969b171c61..f5f6965dbb7808db38e116730e5127731bbc77e5 100644 (file)
@@ -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):