X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FTask%2FPeclFixup.php;h=33eb889c7900744e5350862a271f83cb26b6df29;hb=10c6f10181e75139992ba92b7185fe9a50b889b2;hp=b237771055c51cf344d9397caa26591c0cf5ea56;hpb=337e76964be2ed6724633ac477affc3a28426c97;p=pharext%2Fpharext diff --git a/src/pharext/Task/PeclFixup.php b/src/pharext/Task/PeclFixup.php index b237771..33eb889 100644 --- a/src/pharext/Task/PeclFixup.php +++ b/src/pharext/Task/PeclFixup.php @@ -33,8 +33,11 @@ class PeclFixup implements Task } $dirs = glob("{$this->source}/*", GLOB_ONLYDIR); $files = array_diff(glob("{$this->source}/*"), $dirs); + $check = array_reduce($files, function($r, $v) { + return $v && fnmatch("package*.xml", basename($v)); + }, true); - if (count($dirs) !== 1 || !count($files)) { + if (count($dirs) !== 1 || !$check) { throw new Exception("Does not look like an extracted PECL dir: {$this->source}"); }