]> git.donarmstrong.com Git - dak.git/blobdiff - dak/init_dirs.py
test_gpg.py: also check signature timestamp
[dak.git] / dak / init_dirs.py
index a4703bb88b5170ef8597ea18d3eb675bacf23a0a..0e0d33a94ea85f8d3b573ada62a57145887c726a 100755 (executable)
@@ -63,7 +63,7 @@ def process_file(config, config_name):
 def process_tree(config, tree):
     """Create directories for a config tree."""
 
-    for entry in config.SubTree(tree).List():
+    for entry in config.subtree(tree).list():
         entry = entry.lower()
         config_name = "%s::%s" % (tree, entry)
         target = config[config_name]
@@ -90,20 +90,20 @@ def process_keyring(fullpath, secret=False):
         os.makedirs(keydir)
         if secret:
             # Make sure secret keyring directories are 0700
-            os.chmod(keydir, 0700)
+            os.chmod(keydir, 0o700)
 
     # Touch the file
     print "Creating %s ..." % (fullpath)
     file(fullpath, 'w')
     if secret:
-        os.chmod(fullpath, 0600)
+        os.chmod(fullpath, 0o600)
     else:
-        os.chmod(fullpath, 0644)
+        os.chmod(fullpath, 0o644)
 
 ######################################################################
 
 def create_directories():
-    """Create directories referenced in dak.conf and apt.conf."""
+    """Create directories referenced in dak.conf."""
 
     session = DBConn().session()
 
@@ -121,7 +121,7 @@ def create_directories():
     for subdir in [ "Clean-Queues", "Clean-Suites" ]:
         process_morguesubdir(subdir)
 
-    suite_suffix = "%s" % (Cnf.Find("Dinstall::SuiteSuffix"))
+    suite_suffix = "%s" % (Cnf.find("Dinstall::SuiteSuffix"))
 
     # Process secret keyrings
     if Cnf.has_key('Dinstall::SigningKeyring'):
@@ -131,20 +131,13 @@ def create_directories():
         process_keyring(Cnf['Dinstall::SigningPubKeyring'], secret=True)
 
     # Process public keyrings
-    for keyring in session.query(Keyring).all():
+    for keyring in session.query(Keyring).filter_by(active=True):
         process_keyring(keyring.keyring_name)
 
-    # Process pool directories
-    for component in session.query(Component):
-        directory = os.path.join( Cnf['Dir::Pool'], component.component_name )
-
-        do_dir(directory, '%s pool' % component.component_name)
-
-
     # Process dists directories
     # TODO: Store location of each suite in database
     for suite in session.query(Suite):
-        suite_dir = os.path.join( Cnf['Dir::Root'], 'dists', "%s/%s" % (suite.suite_name, suite_suffix) )
+        suite_dir = os.path.join(suite.archive.path, 'dists', suite.suite_name, suite_suffix)
 
         # TODO: Store valid suite/component mappings in database
         for component in session.query(Component):
@@ -179,9 +172,9 @@ def main ():
 
     d = DBConn()
 
-    arguments = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv)
+    arguments = apt_pkg.parse_commandline(Cnf, arguments, sys.argv)
 
-    options = Cnf.SubTree("Init-Dirs::Options")
+    options = Cnf.subtree("Init-Dirs::Options")
     if options["Help"]:
         usage()
     elif arguments: