From 3488581046966d674f90e3f6811ebb3764482197 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 15 Jan 2015 09:32:48 +0100 Subject: git-update.py: Check for mandatory fields Check explicitly whether pkgver, pkgrel, pkgname, pkgdesc and url are available in each package. If any of these is missing, an exception might occur when parsing the meta data later. Signed-off-by: Lukas Fleischer --- scripts/git-integration/git-update.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/git-integration') diff --git a/scripts/git-integration/git-update.py b/scripts/git-integration/git-update.py index 3d2742a..161d42f 100755 --- a/scripts/git-integration/git-update.py +++ b/scripts/git-integration/git-update.py @@ -212,6 +212,10 @@ for commit in walker: for pkgname in srcinfo.GetPackageNames(): pkginfo = srcinfo.GetMergedPackage(pkgname) + for field in ('pkgver', 'pkgrel', 'pkgname', 'pkgdesc', 'url'): + if not field in pkginfo: + die_commit('missing mandatory field: %s' % (field), commit.id) + if 'epoch' in pkginfo and not pkginfo['epoch'].isdigit(): die_commit('invalid epoch: %s' % (pkginfo['epoch']), commit.id) -- cgit v1.2.3-70-g09d2