]> git.decadent.org.uk Git - dak.git/commitdiff
allow contents files to be written to an alternate location
authorMike O'Connor <stew@vireo.org>
Wed, 25 Feb 2009 21:21:16 +0000 (16:21 -0500)
committerMike O'Connor <stew@vireo.org>
Wed, 25 Feb 2009 21:21:16 +0000 (16:21 -0500)
Signed-off-by: Mike O'Connor <stew@vireo.org>
config/debian/dak.conf
dak/contents.py
dak/dak.py

index de6841e9d26b32e1ef82361da6fc2cb9c95aa350..60df7567f568ba1bb441c2277a4f4ab12d37dad0 100644 (file)
@@ -716,4 +716,5 @@ Urgency
 Contents
 {
   Header "contents";
+  Root "/srv/ftp.debian.org/ftp/";
 }
\ No newline at end of file
index 2e24b2b9739aacc55974770b00f9bc71ece27c2a..a2f99ae7e3ee0d2b57c197aa299b43436fc9766b 100644 (file)
@@ -191,14 +191,12 @@ class Contents(object):
                     h = open(os.path.join( Config()["Dir::Templates"],
                                            Config()["Contents::Header"] ), "r")
                     self.header = h.read()
-                    print( "header: %s" % self.header )
                     h.close()
                 except:
                     log.error( "error opening header file: %d\n%s" % (Config()["Contents::Header"],
                                                                       traceback.format_exc() ))
                     self.header = False
             else:
-                print( "no header" )
                 self.header = False
 
         return self.header
@@ -211,7 +209,11 @@ class Contents(object):
         Internal method for writing all the results to a given file.
         The cursor should have a result set generated from a query already.
         """
-        f = gzip.open(Config()["Dir::Root"] + filename, "w")
+        filepath = Config()["Contents::Root"] + filename
+        filedir = os.path.dirname(filepath)
+        if not os.path.isdir(filedir):
+            os.makedirs(filedir)
+        f = gzip.open(filepath, "w")
         try:
             header = self._getHeader()
 
@@ -224,7 +226,7 @@ class Contents(object):
                     return
 
                 num_tabs = max(1,
-                               int( math.ceil( (self._goal_column - len(contents[0])) / 8) ) )
+                               int(math.ceil((self._goal_column - len(contents[0])) / 8)))
                 f.write(contents[0] + ( '\t' * num_tabs ) + contents[-1] + "\n")
 
         finally:
index 14cddd562545f9449d86c62c5a107f3c8db8afe2..61749490935a77f0fbb6fbddadd66c50243002ad 100755 (executable)
@@ -173,8 +173,6 @@ def init():
          "Split queue/done into a date-based hierarchy"),
         ("stats",
          "Generate statistics"),
-        ("calculate-shasums",
-         "Calculate missing sha1sums and sha256sums"),
         ("bts-categorize",
          "Categorize uncategorized bugs filed against ftp.debian.org"),
         ("add-user",