- projectB.query("INSERT INTO section (section) VALUES ('%s%s%s')" % (prefix, section, suffix));
- projectB.query("COMMIT WORK");
+ projectB.query("INSERT INTO section (section) VALUES "
+ "('%s%s%s')" % (prefix, section, suffix))
+ projectB.query("COMMIT WORK")
+
+################################################################################
+
+def main ():
+ """Sync dak.conf configuartion file and the SQL database"""
+
+ global Cnf, projectB
+
+ Cnf = utils.get_conf()
+ arguments = [('h', "help", "Init-DB::Options::Help")]
+ for i in [ "help" ]:
+ if not Cnf.has_key("Init-DB::Options::%s" % (i)):
+ Cnf["Init-DB::Options::%s" % (i)] = ""
+
+ arguments = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv)
+
+ options = Cnf.SubTree("Init-DB::Options")
+ if options["Help"]:
+ usage()
+ elif arguments:
+ utils.warn("dak init-db takes no arguments.")
+ usage(exit_code=1)
+
+ projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"],
+ int(Cnf["DB::Port"]))
+ database.init(Cnf, projectB)
+
+ do_archive()
+ do_architecture()
+ do_component()
+ do_location()
+ do_suite()
+ do_override_type()
+ do_priority()
+ do_section()