From 8b9feb3d8f0ac833d6980a3c12fbe07afa0da44c Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sun, 10 Apr 2011 20:29:54 +0100 Subject: [PATCH] Fall back to Maintainer if Changed-By missing Signed-off-by: Mark Hymers --- daklib/dbconn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 5028b7cd..6cddd35f 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2608,7 +2608,11 @@ def add_dsc_to_db(u, filename, session=None): source.source = u.pkg.dsc["source"] source.version = u.pkg.dsc["version"] # NB: not files[file]["version"], that has no epoch source.maintainer_id = get_or_set_maintainer(u.pkg.dsc["maintainer"], session).maintainer_id - source.changedby_id = get_or_set_maintainer(u.pkg.changes["changed-by"], session).maintainer_id + # If Changed-By isn't available, fall back to maintainer + if u.pkg.changes.has_key("changed-by"): + source.changedby_id = get_or_set_maintainer(u.pkg.changes["changed-by"], session).maintainer_id + else: + source.changedby_id = get_or_set_maintainer(u.pkg.dsc["maintainer"], session).maintainer_id source.fingerprint_id = get_or_set_fingerprint(u.pkg.changes["fingerprint"], session).fingerprint_id source.install_date = datetime.now().date() -- 2.39.5