From: James Troup Date: Thu, 18 May 2006 17:58:41 +0000 (-0500) Subject: Check returned value from database.get_archive_id() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a521b4ed1c1815957cc770dd054889a8053906a7;p=dak Check returned value from database.get_archive_id() --- diff --git a/ChangeLog b/ChangeLog index 41137090..7347bbe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-05-18 James Troup + * 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 diff --git a/dak/init_db.py b/dak/init_db.py index eac3b6eb..b4fd6065 100755 --- a/dak/init_db.py +++ b/dak/init_db.py @@ -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"]))