? .DS_Store
? 820992_includes_tests.patch
? 820992_includes_v2.patch
? tests/.DS_Store
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/Attic/README.txt,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 README.txt
--- README.txt	13 Jun 2010 17:54:47 -0000	1.1.2.8
+++ README.txt	13 Jun 2010 19:16:35 -0000
@@ -283,6 +283,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.41
diff -u -p -r1.11.2.41 drush_make.drush.inc
--- drush_make.drush.inc	13 Jun 2010 17:37:05 -0000	1.11.2.41
+++ drush_make.drush.inc	13 Jun 2010 19:16:36 -0000
@@ -104,8 +104,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($base_path, $info, $data));
+  $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	13 Jun 2010 19:16:36 -0000
@@ -133,8 +133,10 @@ 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);
-      $valid = $this->queue->addItem('drush_make_validate_info_file', array(), $info);
+      $data    = $this->queue->addItem('drush_make_get_data', $makefile);
+      $info    = $this->queue->addItem('drush_make_parse_info_file', array(), $data);
+      $include = $this->queue->addItem('drush_make_include_info_files', array($build_path), array($info, $data));
+      $valid   = $this->queue->addItem('drush_make_validate_info_file', array(), $include);
       $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.test.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush_make/Attic/drush_make.test.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 drush_make.test.inc
--- drush_make.test.inc	13 Jun 2010 17:54:47 -0000	1.1.2.2
+++ drush_make.test.inc	13 Jun 2010 19:16:36 -0000
@@ -52,6 +52,12 @@ function drush_make_test_get_tests($id =
       'md5'      => '173ae5e2120463e31ff2e2a9cc02491b',
       'options'  => array('no-core' => TRUE),
     ),
+    'include' => array(
+      'name'     => 'Including files',
+      'makefile' => 'tests/include.make',
+      'md5'      => 'f68e6516be32e7dd3f6f422e04fbb4ed',
+      'options'  => array(),
+    ),
   );
   if (isset($id)) {
     return isset($tests[$id]) ? $tests[$id] : FALSE;
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.29
diff -u -p -r1.1.2.29 drush_make.utilities.inc
--- drush_make.utilities.inc	13 Jun 2010 17:37:05 -0000	1.1.2.29
+++ drush_make.utilities.inc	13 Jun 2010 19:16:36 -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($base_path, $info, $source) {
+  $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;
@@ -408,4 +445,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	13 Jun 2010 19:16:36 -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;
     }
Index: tests/include.make
===================================================================
RCS file: tests/include.make
diff -N tests/include.make
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/include.make	13 Jun 2010 19:16:36 -0000
@@ -0,0 +1,4 @@
+core = 6.x
+
+projects[] = drupal
+includes[main] = included.make
\ No newline at end of file
Index: tests/included.make
===================================================================
RCS file: tests/included.make
diff -N tests/included.make
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/included.make	13 Jun 2010 19:16:36 -0000
@@ -0,0 +1,3 @@
+core = 6.x
+
+projects[] = cck
\ No newline at end of file
