--- /dev/null
+#!/usr/bin/env php
+<?php
+
+ini_set("error_reporting", E_ALL);
+ini_set("display_errors", true);
+
+if ($argc != 3) {
+ fprintf(STDERR, "Usage: %s <pkg name> <phar path>\n\n", basename($argv[0]));
+ exit(1);
+}
+
+list(, $pkg, $src) = $argv;
+$basename = basename($src);
+$dir = __DIR__."/../public/sigs/$pkg";
+
+$cmd = sprintf("gpg --verify %s/%s.asc %s", $dir, $basename, $src);
+passthru($cmd);
}
function sign($pkg, $ext) {
- $fmt = "%s/%s-sign %s %s%s";
+ $fmt = "%s/%s-%s %s %s%s";
foreach (["rsa", "gpg"] as $sig) {
foreach (["", ".gz", ".bz2"] as $typ) {
- passthru(sprintf($fmt, __DIR__, $sig, $pkg, $ext, $typ));
+ passthru(sprintf($fmt, __DIR__, $sig, "sign", $pkg, $ext, $typ));
+ passthru(sprintf($fmt, __DIR__, $sig, "vrfy", $pkg, $ext, $typ));
}
}
}
--- /dev/null
+#!/usr/bin/env php
+<?php
+
+ini_set("error_reporting", E_ALL);
+ini_set("display_errors", true);
+
+if ($argc != 3) {
+ fprintf(STDERR, "Usage: %s <pkg name> <phar path>\n\n", basename($argv[0]));
+ exit(1);
+}
+
+list(, $pkg, $src) = $argv;
+$basename = basename($src);
+$dir = __DIR__."/../public/sigs/$pkg";
+$pub = __DIR__."/../public/replicator.pub";
+
+$cmd = sprintf("openssl dgst -verify %s -signature %s/%s.sig %s", $pub, $dir, $basename, $src);
+passthru($cmd);