function make_parse_info_file

8.0.x make.utilities.inc make_parse_info_file($makefile)
6.x make.utilities.inc make_parse_info_file($makefile, $parsed = TRUE, $makefile_options = array())
7.x make.utilities.inc make_parse_info_file($makefile)
5.x make.utilities.inc make_parse_info_file($makefile, $parsed = TRUE)
master make.utilities.inc make_parse_info_file($makefile)

Parse Drupal info file format.

Copied with modifications from includes/common.inc.

See also

drupal_parse_info_file

2 calls to make_parse_info_file()
DrushMakeProject::recurse in commands/make/make.project.inc
Recurse to process additional makefiles that may be found during processing.
drush_make in commands/make/make.drush.inc
Drush callback; make based on the makefile.

File

commands/make/make.utilities.inc, line 14
General utility functions for Drush Make.

Code

function make_parse_info_file($makefile, $parsed = TRUE) {
  if (!($data = make_get_data($makefile))) {
    return drush_set_error('MAKE_INVALID_MAKE_FILE', dt('Invalid or empty make file: !makefile', array('!makefile' => $makefile)));
  }
  if (!($info = _drush_drupal_parse_info_file($data))) {
    return FALSE;
  }
  if (!empty($info['includes'])) {
    $include_path = dirname($makefile);
    $includes = array();
    if (!empty($info['includes']) && is_array($info['includes'])) {
      foreach ($info['includes'] as $include) {
        if (is_string($include)) {
          if (make_valid_url($include, TRUE) && ($file = make_parse_info_file($include, FALSE))) {
            $includes[] = $file;
          }
          elseif (file_exists($include_path . '/' . $include) && ($file = make_parse_info_file($include_path . '/' . $include, FALSE))) {
            $includes[] = $file;
          }
          elseif (file_exists($include) && ($file = make_parse_info_file($include, FALSE))) {
            $includes[] = $file;
          }
          else {
            make_error('BUILD_ERROR', dt("Include file missing: !include", array('!include' => $include)));
          }
        }
      }
    }
    $includes[] = $data;
    $data = implode("\n", $includes);
    $info = _drush_drupal_parse_info_file($data);
  }
  if ($parsed) {
    return $info;
  }
  else {
    return $data;
  }
}