Merge pull request #2122 from JuhaSointusalo/update_versions-fix-multi-api_version

update_versions: handle multiple API_VERSION strings
This commit is contained in:
Kevin Reed 2018-02-09 09:47:14 -06:00 committed by GitHub
commit d17d5936f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -195,7 +195,7 @@ function get_api_version($a, $v, $p, $fds) {
foreach ($fds as $fd) {
if ($fd->main_program) {
$path = "apps/$a/$v/$p/$fd->physical_name";
$handle = popen("strings $path | grep API_VERSION", "r");
$handle = popen("strings $path | egrep --max-count=1 '^API_VERSION_[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$'", "r");
$x = fread($handle, 8192);
pclose($handle);
$x = strstr($x, "API_VERSION_");