Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Nov 2012 at 22:50 UTC
Updated:
11 Sep 2013 at 05:18 UTC
Jump to comment: Most recent file
Comments
Comment #1
mvcComment #2
mvcfrom #drush:
11:57 jonhattan| mvc, check for $extension->info['project'] == 'drupal'
11:58 jonhattan| it should work for both 6 and 7
11:58 jonhattan| also must be checked for drupal 8
11:59 jonhattan| mvc, other way is $extension->info['version'] == VERSION
12:00 jonhattan| as in drush_get_projects()
Comment #3
greg.1.anderson commentedStarted to look at this the other day, but could not test D8 due to #1846058: Invalid arguments on DrupalKernel __construct(), which is now fixed. Jonhattan's advice looks good.
Comment #4
mvcI've redone my patch to check for $extension->info['project']. This works in Drupal 6, 7, and 8. I didn't use version because I think that would give unexpected results when using a contributed module whose version number happens to be the same as the version number of Drupal core.
While testing I noticed that Drupal 6 themes do not set a package, and so are listed as 'Other' (actually, as t('Other')). My first approach didn't handle this, but the new patch should work with Drupal 6 themes and modules.
The latest code in the 7.x-5.x branch (16c782de) blows up on the current Drupal 8 ("PHP Fatal error: Call to undefined function conf_path() in /home/mvc/drush-development/drush/includes/bootstrap.inc on line 784") but I see that the .info files for core modules and themes look the same as in Drupal 7 so I expect this to work once whatever other bug that is gets fixed.
Thanks for the feedback, jonhattan and greg.1.anderson.
Comment #5
greg.1.anderson commentedRegarding testing the version (as Drush formerly did), that never caused a conflict with contrib modules in the past because contrib version numbers follow a different format than core version numbers (e.g. "7.17" for core, and "7.x-1.0" for contrib). However, I think that testing for project == drupal is still best. Code in #4 looks good, but I have not tested it yet.
Comment #6
greg.1.anderson commentedWorked great for me on D6 and D7, so committed #4. I didn't test D8 because I wasn't able to download it due to an invalid checksum. Then I remembered I had a running copy of D8 still (amazing the clarity that 'git push' can bring sometimes), so I tested there and discovered that D8 does not have a 'project' item for Core in D8.
So, I think we need to test 'package' == 'Core' for D7+, and the test from #4 for D6.
Comment #7
greg.1.anderson commentedPushed one more modification to make --core and --no-core work on D6, D7 and D8.
Comment #9
drzraf commentedusing --no-core:
Undefined index: project pm.drush.inc:670using --core:
Undefined index: project pm.drush.inc:677[ but notice is hidden using --pipe ]
Using latest 7.x-5.x + Drupal 6.28
Sample
$extension:Comment #10
drzraf commentedthis works for both D6 and D7
Comment #11
greg.1.anderson commentedThank you for working on this. Could you re-roll against Drush-8.x-6.x and test on Drupal 8 as well?
Comment #12
drzraf commentedplease excuse me but I'm really not willing to spend time into D8.
Comment #13
greg.1.anderson commentedActually, the code already in 8.x-6.x is already working. Backported what was there to the 7.x-5.x branch.
Comment #14
drzraf commentedI'm sorry, but this is not fixed in D6:
This is a 6.20 installation + a patch applied to 6.28.
Please note that the patch provided in comment 10 used
strpos(): rerolledComment #15
greg.1.anderson commentedThat's not the result I am getting with 8.x-6.x and 7.x-5.x using recent, clean versions of Drupal 6 and Drupal 7.
I am not happy with the strpos solution; package can be anything, and there is no saying that someone might not use the word "Core" to mean something other than "Drupal Core". It could match "Corel Reef" or "Core Beliefs". If the existing code really does not work, maybe we can break down and explicitly test for "Core - optional" and "Core - required" iff Drupal major version < 7.
If you would like to continue here, please test on a clean install of the most recent Drupal 6 release. Include a test that fails on Drush 8.x-6.x or 7.x-5.x head, and a patch that fixes the failure. If this only fails with older versions of Drush 6.x, we can discuss with other maintainers how far back we need to support.
Comment #16
mvci can't reproduce this either. using both 8.x-6.x and 7.x-5.x i get the same output:
Comment #17
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.
Comment #17.0
greg.1.anderson commentedbetter description