[aur-dev] [PATCH] git-update: Make url field optional
The url PKGBUILD variable is optional, so should be in the AUR as well. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> --- pkgdesc should be optional as well though, but I was unsure what Lukas would think, so sending this first. Comments? git-interface/git-update.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/git-interface/git-update.py b/git-interface/git-update.py index ebed491..34fabcf 100755 --- a/git-interface/git-update.py +++ b/git-interface/git-update.py @@ -247,10 +247,13 @@ for commit in walker: for pkgname in srcinfo.GetPackageNames(): pkginfo = srcinfo.GetMergedPackage(pkgname) - for field in ('pkgver', 'pkgrel', 'pkgname', 'pkgdesc', 'url'): + for field in ('pkgver', 'pkgrel', 'pkgname', 'pkgdesc'): if not field in pkginfo: die_commit('missing mandatory field: %s' % (field), commit.id) + if not 'url' in pkginfo: + pkginfo['url'] = 'None' + if 'epoch' in pkginfo and not pkginfo['epoch'].isdigit(): die_commit('invalid epoch: %s' % (pkginfo['epoch']), commit.id) @@ -258,11 +261,11 @@ for commit in walker: die_commit('invalid package name: %s' % (pkginfo['pkgname']), commit.id) - if not re.match(r'(?:http|ftp)s?://.*', pkginfo['url']): + if 'url' in pkginfo and not re.match(r'(?:http|ftp)s?://.*', pkginfo['url']): die_commit('invalid URL: %s' % (pkginfo['url']), commit.id) for field in ('pkgname', 'pkgdesc', 'url'): - if len(pkginfo[field]) > 255: + if field in pkginfo and len(pkginfo[field]) > 255: die_commit('%s field too long: %s' % (field, pkginfo[field]), commit.id) -- 2.4.3
participants (1)
-
Johannes Löthberg