drush create makefile or something similar

dmitrig01 - September 3, 2009 - 06:09
Project:Drush Make
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

Takes a current installation and makes a makefile out of it. Maybe?

#1

dmitrig01 - November 7, 2009 - 05:25
Version:<none>» 6.x-2.x-dev
Assigned to:dmitrig01» Anonymous
Status:active» won't fix

too hard, but feel free to re-open if you want to do it, i'm more than happy to accept it

#2

acrollet - November 15, 2009 - 01:45
Status:won't fix» needs work

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.

AttachmentSize
drush_generate_makefile.patch 2.89 KB

#3

acrollet - November 15, 2009 - 01:50

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

AttachmentSize
drush_generate_makefile.patch 2.93 KB

#4

dmitrig01 - November 15, 2009 - 05:49

+++ 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

acrollet - November 17, 2009 - 17:36

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.x
projects[] = "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 core
drush generate makefile modules

Thanks much for the feedback, hopefully we can get this into the project soon!

AttachmentSize
drush_generate_makefile_mkII.patch 6.82 KB

#6

acrollet - November 17, 2009 - 17:40

submitting a slightly cleaned-up patch - please review this instead!

AttachmentSize
drush_generate_makefile_mkIII.patch 6.81 KB

#7

dmitrig01 - November 21, 2009 - 16:31
Status:needs work» fixed

omitted (with many modifications)

#8

System Message - December 5, 2009 - 16:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.