ws
[pharext/replicator.pharext.org] / bin / pecl+sig
index dd3de50e7ef534598c06798e1e26d0e0524ba911..02c3d1589168a54230e432390b9d097d12a7f6c9 100755 (executable)
@@ -24,13 +24,17 @@ function fail($pkg, $ver, $skp, $fmt) {
 }
 
 function sign($pkg, $ext) {
-       $fmt = "%s/%s-sign %s %s";
+       $fmt = "%s/%s-%s %s %s%s";
        foreach (["rsa", "gpg"] as $sig) {
-               passthru(sprintf($fmt, __DIR__, $sig, $pkg, $ext));
+               foreach (["", ".gz", ".bz2"] as $typ) {
+                       passthru(sprintf($fmt, __DIR__, $sig, "sign", $pkg, $ext, $typ));
+                       passthru(sprintf($fmt, __DIR__, $sig, "vrfy", $pkg, $ext, $typ));
+               }
        }
 }
 
 function info($pkg, $dir) {
+       $pkg = strtolower($pkg);
        $inf = file_get_contents("https://pecl.php.net/rest/p/$pkg/info.xml");
        if ($inf) {
                file_put_contents("$dir/info.xml", $inf);
@@ -69,10 +73,10 @@ function work($url, $dir) {
        require_once __DIR__."/../vendor/autoload.php";
        $packager = new pharext\Packager;
        $packager->run(5, [
-               $_SERVER["argv"][0], 
-               "-qps", 
-               $url, 
-               "-Zzd", 
+               $_SERVER["argv"][0],
+               "-qps",
+               $url,
+               "-Zzd",
                $dir
        ]);
 };
@@ -98,14 +102,14 @@ if (($sxe = simplexml_load_file("https://pecl.php.net/feeds/$what.rss"))) {
                                        break;
                        }
                }
-               
+
                if (count($pids) > 5) {
                        wait($pids);
                }
        }
        while (wait($pids))
                ;
-       
+
 }