From 892c4c668d755df7d4ef8dffba59497b3688a1c1 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 28 Jul 2021 17:49:39 -0400 Subject: [PATCH] Check for RPM keys before producing RPM packages --- RoboFile.php | 6 ++++++ release/settings.default.php | 15 ++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RoboFile.php b/RoboFile.php index 5f298d2..8bd7442 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -436,6 +436,12 @@ class RoboFile extends \Robo\Tasks { $this->yell("Build target '$target' skipped: RPM tools not available"); continue; } + $installed = explode("\n", trim(`rpm -qa "gpg-pubkey*"`)); + $missing = array_diff($s['keys'], $installed); + if ($missing) { + $this->yell("Build target '$target' skipped: the following RPM verificcation keys are not installed:\n".implode("\n", $missing)); + continue; + } } $recipe = escapeshellarg($recipe[0]); $dist = "--dist ".escapeshellarg($s['dist']); diff --git a/release/settings.default.php b/release/settings.default.php index da984fa..8ee41b7 100644 --- a/release/settings.default.php +++ b/release/settings.default.php @@ -1,27 +1,24 @@ [ - 'type' => "arch", - 'repos' => ["http://mirror.csclub.uwaterloo.ca/archlinux/core/os/x86_64/", "http://mirror.csclub.uwaterloo.ca/archlinux/extra/os/x86_64/"], - 'keys' => [], 'dist' => "arch", 'recipe' => "PKGBUILD", + 'repos' => ["http://mirror.csclub.uwaterloo.ca/archlinux/core/os/x86_64/", "http://mirror.csclub.uwaterloo.ca/archlinux/extra/os/x86_64/"], + 'keys' => [], 'output' => "/usr/src/packages/ARCHPKGS/*.pkg.tar.zst", ], 'debian' => [ - 'type' => "debian", - 'repos' => ["http://ftp.ca.debian.org/debian/?dist=buster&component=main"], - 'keys' => [], 'dist' => "debian10", 'recipe' => "*.dsc", + 'repos' => ["http://ftp.ca.debian.org/debian/?dist=buster&component=main"], + 'keys' => [], 'output' => "/usr/src/packages/DEBS/*.deb", ], 'suse' => [ - 'type' => "rpm", - 'repos' => ["http://mirror.csclub.uwaterloo.ca/opensuse/distribution/leap/15.3/repo/oss/"], - 'keys' => ["gpg-pubkey-39db7c82-5f68629b", "gpg-pubkey-65176565-5d94a381", "gpg-pubkey-307e3d54-5aaa90a5", "gpg-pubkey-3dbdc284-53674dd4"], 'dist' => "sl15.3", 'recipe' => "arsse.spec", + 'repos' => ["http://mirror.csclub.uwaterloo.ca/opensuse/distribution/leap/15.3/repo/oss/"], + 'keys' => ["gpg-pubkey-39db7c82-5f68629b", "gpg-pubkey-65176565-5d94a381", "gpg-pubkey-307e3d54-5aaa90a5", "gpg-pubkey-3dbdc284-53674dd4"], 'output' => "/home/abuild/rpmbuild/RPMS/noarch/*.rpm", ], ];