Drush pm, although in some ways very different (relying on an existing drupal install and update module) also has a great deal of code/packaging knowledge that could be shared with drush make. It may also be interesting to try to merge concepts/projects in some distant future.

Comments

moshe weitzman’s picture

I'd like to see this. Note that drush updatecode does require a drupal install and update module. But drush dl requires neither. Lets put the best code we have into drush core for calculating best release, downloading via wget/curl/cvs, and so on. Patches to drush core are always welcome.

I'm quite open to putting all of drush_make into drush core, when you guys think it is time. Lets discuss.

lucidus_neil’s picture

First, GREAT module that standardizes what I suspect many have been creating in a non-standard way. Really enjoying playing with it.

It occurred to me when submitting a patch for the curl part of drush_make that it didn't make sense to have the wget, curl, etc. code in drush_make when drush dl would do the same thing. (Am I missing something as to why drush_make has that? Is there something drush dl doesn't do that's required?).

The power of drush_make is (or could be) parsing of the .make file and applying it to drush commands. I've been creating bash scripts to do pretty much the same thing as drush_make config files and it has the added benefit of creating the database (if desired). Most everything is accomplished using drush commands already available. My sense is that drush_make could/should follow that model.

grendzy’s picture

subscribe.

dmitrig01’s picture

Title: Determine overlap points with drush pm » Eliminate d(r)uplication
Version: 6.x-1.0-beta1 » 6.x-2.x-dev
Assigned: yhahn » dmitrig01
Category: task » bug
Priority: Normal » Critical

Let's get rid of this duplication once and for all.

Unfortunately, just as we never got to 1.0, I think that some major architectural changes (in a positive way) will make us (i.e. me) re-write major portions of the code base, so it might be better to just branch and call it 3.x.

Points of duplication I see:
-- Downloading projects: drush_pm_download() (the bottom of pm.drush.inc) looks too familiar. Let's start using that or write a patch to get it into a state where we can use it.
-- Objects for VCSs. Again, PM has these: version_control/(svn, bzr). PM doesn't do downloading from VCSes, it only does committing after downloading. We should be able to just add new methods into these objects (well actually, integrate our existing ones).
-- package_handler/(cvs, wget) - we have very similar code to this as well

I'm not sure where the code should end up. Since some of it will be used by drush, it might make sense to leave it there, however then there will be code in drush core that it isn't using.

Moshe mentioned the possibility of at some point putting drush make itself into drush core. In that case it would make sense for this code to live in drush.

Other notes for 3.x:
-- the queue goes. It's an unnecessary level of abstraction that confuses everyone (yes, myself included).
-- let's look into drush core's new 3.x awesomeness and see how much of that we can use.

Also:
-- Once we reduce d(r)uplication, we can start looking into integrating more with drush's guts. Imagine making a makefile on top of an existing site, which can download new modules as well as new version of modules and then updating its code.

dmitrig01’s picture

Status: Active » Postponed

I want to kind of shift focus and try to get a stable release asap. once everything actually works i'm going to try to make some progress on this issue.

dmitrig01’s picture

Priority: Critical » Normal

I keep neglecting this issue but I want to use the critical status to keep track of what I want in the next beta.

dmitrig01’s picture

Priority: Normal » Critical
Status: Postponed » Active

Now that .download.inc is just about stable, I think we can take a look at this issue again.

dmitrig01’s picture

Category: bug » task
anarcat’s picture

Maybe the duplicated pm code should just be merged into drush 4 and removed from drush_make 3, but stay in (and therefore not block) drush_make 2?

dmitrig01’s picture

Yeah, I'm just looking at smaller stuff for now, but that was/is the plan

dww’s picture

I've been messing with drush make and drush dl/pm again today and came to similar conclusions. Would love to see this happen, and will attempt to help shed light on things that I have useful knowledge about in this space... If there are specific tricky things I can help with, let me know. Otherwise, I'll try to review/test patches when they materialize, but I sadly can't promise much bandwidth for that...

izmeez’s picture

subscribing

steven jones’s picture

Subscribe

steven jones’s picture

Looking at the download code in drush 5 it is a lot more naive than that in Drush make. Drush make's looks at the headers for the HTTP request, and uses that to possibly rename the file to have an extension of 'zip', 'tar.gz' or 'tar', then these are used later for extraction.

Drush make's downloader is a lot more general than the one in Drush, which is very geared toward downloading Drupal projects and not random files from the internet. Potentially Drush make could be re-worked to use some of the low level plumbing that drush provides, but I don't think there's ever going to be the ability to call one of the high level Drush commands to download.

helmo’s picture

Status: Active » Fixed

[ Powered by #1115636: Issue Macros and Templates - Drush Make]

Drush make is being merged into drush core (discussed in issue:#1310130: Put drush make in drush core)
This means that the issue queue is also moving. The Drush project has a component called 'Make' for this purpose.

We would like to take this opportunity to leave behind old/obsolete issues, allowing us to focus on a stable make command in core. E.g. one of the major tasks ahead is making more use of the Drush core code for handling downloads and decompression.

If you feel that this issue is still relevant, feel free to re-open and move it to the Drush queue.

More information will be posted on the drush_make and drush project pages.

anarcat’s picture

Title: Eliminate d(r)uplication » have drush make use the pm primitives
Project: Drush Make » Drush
Version: 6.x-2.x-dev »
Component: Code » Make
Assigned: dmitrig01 » Unassigned
Status: Fixed » Active

I think this is still relevant - even though make is merged into drush, it still doesn't use the drush PM primitives, which can be a major source of confusion.

moshe weitzman’s picture

kenorb’s picture

Version: » All-versions-4.x-dev

#698104: Cache downloaded files is duplicated of this