fix signing
[pharext/replicator.pharext.org] / bin / pecl+sig
index e615e5bf2b8d5c55bc072efd809a3a9fc6bd5bae..7c6b9af7ec5acb99b86aee0e3332d4a28aff458c 100755 (executable)
@@ -24,9 +24,19 @@ function fail($pkg, $ver, $skp, $fmt) {
 }
 
 function sign($pkg, $ext) {
-       $fmt = "%s/%s-sign %s %s";
+       $fmt = "%s/%s-sign %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, $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);
        }
 }
 
@@ -84,6 +94,7 @@ if (($sxe = simplexml_load_file("https://pecl.php.net/feeds/$what.rss"))) {
                                        exit;
                                case 0:
                                        work($url, $dir);
+                                       info($pkg, $dir);
                                        exit;
                                default:
                                        $pids[$pid] = compact("url", "pkg", "ver", "skp", "ext", "dir");