summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/management/commands/reporead.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index 08853a32..70526bfd 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -398,16 +398,18 @@ def db_update(archname, reponame, pkgs, force=False):
populate_pkg(dbpkg, pkg, timestamp=timestamp)
Update.objects.log_update(None, dbpkg)
- maintainers = User.objects.filter(
- package_relations__pkgbase=dbpkg.pkgbase,
- package_relations__type=PackageRelation.MAINTAINER)
- if not maintainers:
- packager = finder.find(pkg.packager)
- if packager:
- prel = PackageRelation(pkgbase=dbpkg.pkgbase,
- user=packager,
- type=PackageRelation.MAINTAINER)
- prel.save()
+ 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: