5

With yum you can do yum list available ..., and know the name of the package you want to install.

For example, there is the Mime Mail module in Drupal. What name should I use with drush dl, mime_mail, or mimemail?

So does drush have something like yum list available?

0

5 Answers 5

10

No, drush can't do that.

Why should it when you can see the entire list yourself on drupal.org.

SS

2
  • Thanks, but I want to know the name to use with drush dl.
    – ericj
    Commented Nov 6, 2012 at 12:34
  • 2
    @ericj The name drush used is the machine name, which also is used in the URL on drupal.org. fx drupal.org/project/commerce is the url for the Drupal Commerce project, to dl it use $ drush dl commerce
    – googletorp
    Commented Nov 6, 2012 at 13:33
9

Yes, you can. based on this feature request, I build the functionality, and created a sandbox module.

0

Correct me if I'm wrong but I think you should use the last segment of the URL When I was trying to find out what to use for the "Redirect 403 to User Login" module Example: http://drupal.org/project/r4032login

use: drush dl r4032login

1
  • Why was this answer down voted? It is correct. The OP asked, in comments "Thanks, but I want to know the name to use with drush dl" Commented Apr 3, 2015 at 15:44
0
function get_list_of_drushable_modules(){
$url = "https://www.drupal.org/project/project_module/index";
$content =  get_url_data($url);
$start = '<div class="view-content">';
$end ='</ol>';

$start_i = strpos($content,$start);
$content = substr($content,$start_i);

$projects = explode("</li>",$content);
$new_projects = array();

foreach($projects as $i => $project){
    $st = '<a href="/project/';
    $strlen = strlen($st);
    $st_i = strpos($project,$st);
    $project = substr($project,$st_i+$strlen);
    $project_character = str_split($project);

    $new_project = "";

    foreach($project_character as $char){
        if($char == '"') break;
         $new_project .= $char;
    }

    $new_projects[] = $new_project;
}

return $new_projects;
}

function get_url_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
1
  • Please avoid code-only answers. Explanations of why and how are worth much more than code that happens to work - or not.
    – Mołot
    Commented Jan 15, 2015 at 13:41
-1

No drush does not have this feature

1
  • 3
    would you like to elaborate more on this?
    – AjitS
    Commented Nov 27, 2012 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.