X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=bin%2Fpecl%2Bsig;h=b093c0e369636418c20b6c009b0ba401800302d8;hb=c89e04079cb434e7d0a7de07c4484a83b9be3ad9;hp=4ce3e2feaa353ac18c3b7fcd04cf65170fa1cf32;hpb=c0785929670b7307260b16dd61861eeb27226f4c;p=pharext%2Freplicator.pharext.org diff --git a/bin/pecl+sig b/bin/pecl+sig index 4ce3e2f..b093c0e 100755 --- a/bin/pecl+sig +++ b/bin/pecl+sig @@ -24,9 +24,20 @@ 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); } } @@ -70,11 +81,10 @@ function work($url, $dir) { ]); }; -if (($sxe = simplexml_load_file("http://pecl.php.net/feeds/$what.rss"))) { +if (($sxe = simplexml_load_file("https://pecl.php.net/feeds/$what.rss"))) { foreach ($sxe->item as $item) { - $url = (string) $item->link; - $pkg = basename(dirname($url)); - $ver = basename($url); + list($pkg, $ver) = explode(" ", (string) $item->title); + $url = sprintf("https://pecl.php.net/get/%s/%s", $pkg, $ver); $skp = sprintf("%s/../skip/%s/%s", __DIR__, $pkg, $ver); $ext = sprintf("%s/../public/phars/%s/%s-%s.ext.phar", __DIR__, $pkg, $pkg, $ver); $dir = dirname($ext); @@ -85,6 +95,7 @@ if (($sxe = simplexml_load_file("http://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");