Skip to content

Commit

Permalink
Sign repo databases upon deletion of a pkg.
Browse files Browse the repository at this point in the history
  • Loading branch information
bionade24 committed Sep 29, 2024
1 parent 83b0a51 commit e6d4f53
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cd_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ def remove_pkgbuild_and_archpkg(sender, instance, using, **kwargs):
for file in glob.iglob(f"/repo/{pkg}-{pkg_version}-*.pkg.tar.*"):
logger.debug(f"Deleting {file}")
os.remove(file)
key = models.GpgKey.get_most_appropriate_key(AnonymousUser)
if key:
try:
key.sign(os.path.join(settings.PACMANREPO_PATH, settings.PACMANDB_FILENAME))
key.sign(os.path.join(settings.PACMANREPO_PATH, settings.PACMAN_FILESDB_FILENAME))
except gpg.errors.GpgError:
logger.exception("Error while signing repo databases:")



class GpgKey(models.Model):
Expand Down

0 comments on commit e6d4f53

Please sign in to comment.