? drush_make_includes.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/Attic/README.txt,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 README.txt
--- README.txt	2 Jun 2010 15:59:33 -0000	1.1.2.6
+++ README.txt	7 Jun 2010 22:45:08 -0000
@@ -260,6 +260,19 @@ projects. Additionally, they may specify
         libraries[jquery_ui][destination] = "modules/contrib/jquery_ui
 
 
+### Includes
+
+An array of makefiles to include. Each include may be a local path or a direct
+URL to the makefile. Includes are appended in order with the source makefile
+appended last, allowing latter makefiles to override the keys/values of former
+makefiles.
+
+**Example:**
+
+    includes[example] = "example.make"
+    includes[remote] = "http://www.example.com/remote.make"
+
+
 Recursion
 ---------
 If a project that is part of a build contains a `.make` itself, drush make will
Index: drush_make.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/Attic/drush_make.drush.inc,v
retrieving revision 1.11.2.40
diff -u -p -r1.11.2.40 drush_make.drush.inc
--- drush_make.drush.inc	25 Feb 2010 05:38:00 -0000	1.11.2.40
+++ drush_make.drush.inc	7 Jun 2010 22:45:08 -0000
@@ -81,8 +81,10 @@ function drush_drush_make_make($makefile
   $drush_version = $queue->addItem('drush_make_ensure_version');
   $base_path = $queue->addItem('drush_make_base_path', array($base_path), array($drush_version));
   $file_exists = $queue->addItem('drush_make_base_path_validate', array(), $base_path);
-  $info  = $queue->addItem('drush_make_parse_info_file', $makefile, $file_exists);
-  $valid = $queue->addItem('drush_make_validate_info_file', array(), $info);
+  $data    = $queue->addItem('drush_make_get_data', $makefile, $file_exists);
+  $info    = $queue->addItem('drush_make_parse_info_file', array(), $data);
+  $include = $queue->addItem('drush_make_include_info_files', array(), array($info, $data, $base_path));
+  $valid   = $queue->addItem('drush_make_validate_info_file', array(), $include);
   $tmp = $queue->addItem('drush_make_create_tmp', array(), $valid);
   $queue->addItem('drush_make_add_projects', array(FALSE, drush_get_option('contrib-destination', 'sites/all')), array($tmp, $base_path, $valid));
   $queue->addItem('drush_make_add_libraries', array(drush_get_option('contrib-destination', 'sites/all')), array($tmp, $base_path, $valid));
Index: drush_make.project.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/Attic/drush_make.project.inc,v
retrieving revision 1.1.2.22
diff -u -p -r1.1.2.22 drush_make.project.inc
--- drush_make.project.inc	22 Apr 2010 23:30:14 -0000	1.1.2.22
+++ drush_make.project.inc	7 Jun 2010 22:45:08 -0000
@@ -133,7 +133,8 @@ class DrushMakeProject {
     if (file_exists($makefile)) {
       drush_log(dt("Found makefile: %makefile", array("%makefile" => basename($makefile))), 'ok');
       $build_path = $this->buildPath($directory);
-      $info  = $this->queue->addItem('drush_make_parse_info_file', $makefile);
+      $data  = $this->queue->addItem('drush_make_get_data', $makefile);
+      $info  = $this->queue->addItem('drush_make_parse_info_file', array(), $data);
       $valid = $this->queue->addItem('drush_make_validate_info_file', array(), $info);
       $this->queue->addItem('drush_make_add_projects', array(TRUE, trim($build_path, '/'), $this->tmp_path, $this->base_path), array($valid));
       $this->queue->addItem('drush_make_add_libraries', array(trim($build_path, '/'), $this->tmp_path, $this->base_path), array($valid));
Index: drush_make.utilities.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/Attic/drush_make.utilities.inc,v
retrieving revision 1.1.2.28
diff -u -p -r1.1.2.28 drush_make.utilities.inc
--- drush_make.utilities.inc	22 Apr 2010 23:30:14 -0000	1.1.2.28
+++ drush_make.utilities.inc	7 Jun 2010 22:45:08 -0000
@@ -31,8 +31,7 @@ function drush_make_base_path_validate($
  *
  * @see drupal_parse_info_file
  */
-function drush_make_parse_info_file($data_source) {
-  $data = drush_make_get_data($data_source);
+function drush_make_parse_info_file($data) {
   if (!$data) {
     return FALSE;
   }
@@ -91,6 +90,44 @@ function drush_make_parse_info_file($dat
   return FALSE;
 }
 
+/**
+ * Include any additional info files and merge them into the current file.
+ *
+ * Files are included in listed order with the source info file appended
+ * last. This allows the source info file to override keys of all other
+ * included files.
+ *
+ * @param array $info
+ *   A parsed info file array. Need not be validated.
+ * @param string $source
+ *   The unparsed source data that provided the original info file array.
+ * @param string $base_path
+ *   The base path to which include paths are relative.
+ *
+ * @return array
+ *   A parsed info file array of the combined includes.  
+ */
+function drush_make_include_info_files($info, $source, $base_path) {
+  $includes = array();
+  if (!empty($info['includes']) && is_array($info['includes'])) {
+    foreach ($info['includes'] as $key => $include) {
+      if (is_string($include)) {
+        $data = FALSE;
+        if (drush_make_valid_url($include) && ($data = drush_make_get_data($include))) {
+          $includes[$key] = $data;
+        }
+        else if (file_exists($base_path .'/'. $include) && ($data = drush_make_get_data($base_path .'/'. $include))) {
+          $includes[$key] = $data;
+        }
+      }
+      // @TODO: Support other include methods other than local files.
+    }
+  }
+  $includes[] = $source;
+  $merged = implode("\n", $includes);
+  return drush_make_parse_info_file($merged);
+}
+
 function drush_make_validate_info_file($info) {
   // Assume no errors to start.
   $errors = FALSE;
@@ -391,4 +428,4 @@ function drush_make_get_remote_file($url
   else {
     return drush_set_error('drush_make_download_error', 'Unable to download remote file. No download services supported.');
   }
-}
\ No newline at end of file
+}
Index: contrib/drush_make_d_o.convert.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/contrib/Attic/drush_make_d_o.convert.inc,v
retrieving revision 1.1.2.11
diff -u -p -r1.1.2.11 drush_make_d_o.convert.inc
--- contrib/drush_make_d_o.convert.inc	3 Dec 2009 01:41:07 -0000	1.1.2.11
+++ contrib/drush_make_d_o.convert.inc	7 Jun 2010 22:45:08 -0000
@@ -71,7 +71,7 @@ class DrushMakeDrupalorgConverter extend
   }
 
   function read() {
-    if (!($this->old_info = drush_make_parse_info_file($this->from))) {
+    if (!($this->old_info = drush_make_parse_info_file(drush_make_get_data($this->from)))) {
       drush_make_error('FILE_ERROR', dt("Unable to parse file %file", array('%file' => $this->from)));
       return FALSE;
     }
@@ -280,7 +280,7 @@ class DrushMakeDrupalorgVerifier extends
   }
 
   function read($makefile) {
-    if (!($makefile = drush_make_parse_info_file($makefile))) {
+    if (!($makefile = drush_make_parse_info_file(drush_make_get_data($makefile)))) {
       drush_make_error('FILE_ERROR', dt("Unable to parse file %file", array('%file' => $makefile)));
       return FALSE;
     }
