summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2019-02-22 23:28:39 -0500
committerLuke Shumaker <lukeshu@parabola.nu>2019-02-22 23:28:39 -0500
commitc5957b72419862b879b637b5e405289ef8784727 (patch)
tree5ac779a4dadcbed6fa1a42f0de22ddb9bb8df7b9 /devel
parent97c53e6f5963f2faff0d97f72e345588e105ccb8 (diff)
parent678f1b505a93bcabb0525ba808db27a6d9510ca0 (diff)
Merge branch 'archweb-generic'
Diffstat (limited to 'devel')
-rw-r--r--devel/management/commands/reporead.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index 72215382..9fe643bb 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -30,10 +30,11 @@ from django.core.management.base import BaseCommand, CommandError
from django.db import connections, router, transaction
from django.db.utils import IntegrityError
from django.utils.timezone import now
+from django.contrib.auth.models import User
from devel.utils import UserFinder
from main.models import Arch, Package, PackageFile, Repo
-from packages.models import Depend, Conflict, Provision, Replacement, Update
+from packages.models import Depend, Conflict, Provision, Replacement, Update, PackageRelation
from packages.utils import parse_version
@@ -401,6 +402,21 @@ def db_update(archname, reponame, pkgs, force=False):
with transaction.atomic():
populate_pkg(dbpkg, pkg, timestamp=timestamp)
Update.objects.log_update(None, dbpkg)
+
+ if not Package.objects.filter(
+ pkgname=pkg.name).exclude(id=dbpkg.id).exists():
+ if not User.objects.filter(
+ package_relations__pkgbase=dbpkg.pkgbase,
+ package_relations__type=PackageRelation.MAINTAINER
+ ).exists():
+ packager = finder.find(pkg.packager)
+ if packager:
+ prel = PackageRelation(pkgbase=dbpkg.pkgbase,
+ user=packager,
+ type=PackageRelation.MAINTAINER)
+ prel.save()
+
+
except IntegrityError:
if architecture.agnostic:
logger.warning("Could not add package %s; "