Make url and pkgdesc fields optional

The url and pkgdesc PKGBUILD variables are optional, so they should be
in the AUR as well.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Johannes Löthberg 2015-06-20 12:47:23 +02:00 committed by Lukas Fleischer
parent 5d9a80a546
commit 61cdf09cd0
4 changed files with 24 additions and 5 deletions

View file

@ -77,6 +77,10 @@ def save_srcinfo(srcinfo, db, cur, user):
else:
ver = '%s-%s' % (pkginfo['pkgver'], pkginfo['pkgrel'])
for field in ('pkgdesc', 'url'):
if not field in pkginfo:
pkginfo[field] = None
# Create a new package.
cur.execute("INSERT INTO Packages (PackageBaseID, Name, " +
"Version, Description, URL) " +
@ -247,7 +251,7 @@ 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'):
if not field in pkginfo:
die_commit('missing mandatory field: %s' % (field), commit.id)
@ -259,7 +263,7 @@ for commit in walker:
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)