]> git.decadent.org.uk Git - dak.git/commitdiff
Check returned value from database.get_archive_id()
authorJames Troup <james@nocrew.org>
Thu, 18 May 2006 17:58:41 +0000 (12:58 -0500)
committerJames Troup <james@nocrew.org>
Thu, 18 May 2006 17:58:41 +0000 (12:58 -0500)
ChangeLog
dak/init_db.py

index 411370901da52da3128d28796dd822f98cfd76ad..7347bbe0ef67ee8baf4b785549c40635ef54717f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-05-18  James Troup  <james@nocrew.org>
 
+       * dak/init_db.py (main): check returned value from
+       database.get_archive_id().
+
        * dak/dak.py: renamed from shell.py.  Update to support new source
        layout.  Created init() and usage() functions.  Various
        pylint-inspired cleanups.  Use daklib utils.warn() and
index eac3b6eb0f031dcd657479c53138feb18f008468..b4fd6065212e3eafc38da146d50320396c25d8ea 100755 (executable)
@@ -105,6 +105,9 @@ def main ():
     for location in Cnf.SubTree("Location").List():
         Location = Cnf.SubTree("Location::%s" % (location))
         archive_id = daklib.database.get_archive_id(Location["Archive"])
+        if archive_id == -1:
+            daklib.utils.fubar("Archive '%s' for location '%s' not found."
+                               % (Location["Archive"], location))
         type = Location.get("type")
         if type == "legacy-mixed":
             projectB.query("INSERT INTO location (path, archive, type) VALUES ('%s', %d, '%s')" % (location, archive_id, Location["type"]))