From a521b4ed1c1815957cc770dd054889a8053906a7 Mon Sep 17 00:00:00 2001 From: James Troup Date: Thu, 18 May 2006 12:58:41 -0500 Subject: [PATCH] Check returned value from database.get_archive_id() --- ChangeLog | 3 +++ dak/init_db.py | 3 +++ 2 files changed, 6 insertions(+) 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"])) -- 2.39.5