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()

I'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.

Regarding 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.

Worked 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.

That'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.