Posted by dmitrig01 on September 3, 2009 at 6:09am
| Project: | Drush Make |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Takes a current installation and makes a makefile out of it. Maybe?
Comments
#1
too hard, but feel free to re-open if you want to do it, i'm more than happy to accept it
#2
I've got the beginnings of a patch here. It will currently generate output like this:
Chimayo:~/Sites/acquia-drupal-site/acquia-drupal $ drush generate_makefile
core = 6.x
projects[] = drupal
projects[acquia][type] = "profile"
; projects[PROFILENAME][download][type] = "DOWNLOADTYPE"
; projects[PROFILENAME][download][url] = "DOWNLOADURL"
; projects[PROFILENAME][download][branch] = "BRANCHNAME"
projects[] = admin_menu
projects[] = ctools
projects[] = devel
projects[] = jquery_ui
projects[] = libraries
projects[] = wysiwyg
libraries[jsvi][download][type] = "get"
libraries[jsvi][directory_name] = "jsvi"
libraries[jsvi][download][url] = "DOWNLOADURL"
libraries[tinymce][download][type] = "get"
libraries[tinymce][directory_name] = "tinymce"
libraries[tinymce][download][url] = "DOWNLOADURL"
projects[] = acquia_slate
projects[] = acquia_marina
There are obviously limitations to how much can be generated with a tool like this, chief among which being the fact that it's impossible to determine where to download non-contrib modules, themes, libraries etc. Still, a tool like this provides a nice template, and could give n00bs a head-start on a makefile... Would love some feedback on this.
#3
whoops, slight improvement to the patch.
Output now looks like:
Chimayo:~/Sites/acquia-drupal-site/acquia-drupal $ drush generate_makefile
core = 6.x
projects[] = drupal
projects[acquia][type] = "profile"
; projects[acquia][download][type] = "DOWNLOADTYPE"
; projects[acquia][download][url] = "DOWNLOADURL"
; projects[acquia][download][branch] = "BRANCHNAME"
projects[] = admin_menu
projects[] = ctools
projects[] = devel
projects[] = jquery_ui
projects[] = libraries
projects[] = wysiwyg
libraries[jsvi][download][type] = "get"
libraries[jsvi][directory_name] = "jsvi"
libraries[jsvi][download][url] = "DOWNLOADURL"
libraries[tinymce][download][type] = "get"
libraries[tinymce][directory_name] = "tinymce"
libraries[tinymce][download][url] = "DOWNLOADURL"
projects[] = acquia_slate
projects[] = acquia_marina
#4
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -19,6 +19,12 @@ function drush_make_drush_command() {
+ $items['generate_makefile'] = array(
how about "generate makefile" (space instead of underscore)?
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ // core section
Capitalize and period at the end.
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ // surely this is a given
Could be pressflow. There should be some way of detecting it (and special-casing it).
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ // non-default profiles
Maybe add a commend denoting each section?
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ print 'projects[' . $install_profile . '][type] = "profile"' . "\n";
Please find out somehow if it's on d.o. An UpdateXML query should be just fine.
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ //print_r($module_info);
Please remove.
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ print 'projects[] = ' . $module->name . "\n";
Please check for project status url. Also try using the same code as profiles (download). Maybe a helper function.
Also, please check for a custom location (e.g. sites/all/modules/contrib/module) if possible.
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ if (function_exists(libraries_get_libraries)) {
Quotes please.
+++ drush_make.drush.inc 2009-11-14 19:48:23.000000000 -0600@@ -29,7 +35,66 @@ function drush_make_drush_help($section)
+ print 'projects[] = ' . $theme->name . "\n";
Please use the same code as profiles here.
Otherwise, looks great. Thanks for working on this!
#5
new patch attached, the output generated now looks like this:
Beginning makefile generation...
Generating core section...
Generating profile section...
Could not retrieve version information for acquia. ESC[31;40mESC[1m[error]ESC[0m
Generating modules section...
Project information for <em>admin_menu</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>ctools</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>devel</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>jquery_ui</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>libraries</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>wysiwyg</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Generating libraries section...
Generating themes section...
Project information for <em>acquia_slate</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>acquia_marina</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Project information for <em>zen</em> retrieved. ESC[0;33;40mESC[1m[ok]ESC[0m
Could not retrieve version information for northtexas. ESC[31;40mESC[1m[error]ESC[0m
Makefile output follows.
; Makefile auto-generated by drush make on Tue, 17 Nov 09 11:33:59 -0600
core = 6.x
projects[] = "drupal"
projects[acquia][type] = "profile"
; Release information for this profile was not detected on drupal.org.
; Please enter the required information.
; projects[acquia][download][type] = "DOWNLOADTYPE"
; projects[acquia][download][url] = "DOWNLOADURL"
; projects[acquia][download][branch] = "BRANCHNAME"
projects[] = admin_menu
projects[admin_menu][install_path] = "modules/acquia/admin_menu"
projects[] = ctools
projects[] = devel
projects[devel][install_path] = "sites/default/modules/devel"
projects[] = jquery_ui
projects[jquery_ui][install_path] = "modules/acquia/jquery_ui"
projects[] = libraries
projects[libraries][subdir] = "contrib"
projects[] = wysiwyg
libraries[jsvi][download][type] = "get"
libraries[jsvi][directory_name] = "jsvi"
libraries[jsvi][download][url] = "DOWNLOADURL"
libraries[tinymce][download][type] = "get"
libraries[tinymce][directory_name] = "tinymce"
libraries[tinymce][download][url] = "DOWNLOADURL"
projects[] = acquia_slate
projects[acquia_slate][install_path] = "themes/acquia/acquia_slate"
projects[] = acquia_marina
projects[acquia_marina][install_path] = "themes/acquia/acquia_marina"
projects[] = zen
projects[zen][subdir] = "contrib/zen"
projects[] = northtexas
projects[northtexas][install_path] = "sites/default/themes/northtexas"
; Release information for this theme was not detected on drupal.org.
; Please enter the required information.
; projects[northtexas][download][type] = "DOWNLOADTYPE"
; projects[northtexas][download][url] = "DOWNLOADURL"
; projects[northtexas][download][branch] = "BRANCHNAME"
The relevant section from a pressflow installation now looks like this:
core = 6.xprojects[] = "pressflow"
; Non-standard Drupal - Please enter the required information.
; projects[pressflow][download][type] = "DOWNLOADTYPE"
; projects[pressflow][download][url] = "DOWNLOADURL"
; projects[pressflow][download][branch] = "BRANCHNAME"
I believe I've addressed all of the concerns above except for "Maybe add a commend denoting each section?". For clarification, do you mean having commands such as the following?
drush generate makefile coredrush generate makefile modules
Thanks much for the feedback, hopefully we can get this into the project soon!
#6
submitting a slightly cleaned-up patch - please review this instead!
#7
omitted (with many modifications)
#8
Automatically closed -- issue fixed for 2 weeks with no activity.