diff --git a/git-interface/git-update.py b/git-interface/git-update.py index 66100195..41a34742 100755 --- a/git-interface/git-update.py +++ b/git-interface/git-update.py @@ -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) diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql index 5a702b2b..5a2e5c51 100644 --- a/schema/aur-schema.sql +++ b/schema/aur-schema.sql @@ -107,8 +107,8 @@ CREATE TABLE Packages ( PackageBaseID INTEGER UNSIGNED NOT NULL, Name VARCHAR(255) NOT NULL, Version VARCHAR(255) NOT NULL DEFAULT '', - Description VARCHAR(255) NOT NULL DEFAULT "An Arch Package", - URL VARCHAR(255) NOT NULL DEFAULT "https://www.archlinux.org", + Description VARCHAR(255) NULL DEFAULT NULL, + URL VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (ID), UNIQUE (Name), FOREIGN KEY (PackageBaseID) REFERENCES PackageBases(ID) ON DELETE CASCADE diff --git a/upgrading/4.0.0.txt b/upgrading/4.0.0.txt index 954dfccd..637c4b9f 100644 --- a/upgrading/4.0.0.txt +++ b/upgrading/4.0.0.txt @@ -58,4 +58,11 @@ CREATE TABLE PackageKeywords ( ) ENGINE = InnoDB; ---- -8. (optional) Setup cgit to browse the Git repositories via HTTP. +8. Let Description and URL store nulls + +---- +ALTER TABLE Packages MODIFY Description VARCHAR(255) NULL DEFAULT NULL, + MODIFY URL VARCHAR(255) NULL DEFAULT NULL; +---- + +9. (optional) Setup cgit to browse the Git repositories via HTTP. diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 82bc2621..1e2b9a58 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -189,11 +189,19 @@ $sources = pkg_sources($row["ID"]); + + + + + + + + 0):