2

We have taken a project where we have to upgrade a site from d6 to d7.

But their module structure is poor, and does not distinguish between custom and contrib modules. We also want to know what's upgradable, and what isn't?

This would be helpful for sending project estimation.

Is there a way to do this using drush perhaps?

  • If you do drush up then it should say "Failed to check available update data for ...." which are the custom modules, all the others are contrib. Probably the same thing as going to the update tab in the modules admin screen (forgot if it's the same for D6). – Beebee Dec 4 '13 at 10:44
6

If you want know which module has been upgraded or not and what things upgrade in module then you can use hacked module of drupal.

Go to hacked module configuration and click on "list project" Let it do the work.It will process the modules and will check for the changes.

Once it completes the process you will get a list of module along with the number of changes done in the modules.

Now open the directory sites/all/modules/ and check the modules which are displayed in the list you got after hacked process.The listed modules in the result are the contrib modules and rest of the modules should be custom.

1

Found a way to do the first part, and list all the custom modules.

Quite cool approach I felt -:

grep -rL --include "*.info" "datestamp" .

Pipe to wc -l to see the number of custom modules grep -rL --include "*.info" "datestamp" . | wc -l

  • 2
    Good one. Possibly not accurate. Once there was a total repackaging, see here. If script is fast enough, you can get duplicated timestamps. Now, if you remove duplicates, you will possibly have some modules counted as one in that situation. But if you do not, you will count things like Views & Views UI as separate modules, and that's not what you usually want. – Mołot Dec 4 '13 at 10:53
0

You can list all contrib modules by running:

drush pm-updatestatus

all other which will say:

No release history was found ...

they're most likely custom modules.


Another way is to list all the project values from .info file and check whether the project exists in Drupal.org, e.g. using callback to https://updates.drupal.org/release-history/project_name/7.x. See: How to download programmatically a module?. E.g.

find . -name "*.info" -exec sh -c 'eval $(grep "project\s\+=.\+" "{}" | tr -d " "); curl -s "https://updates.drupal.org/release-history/$project/7.x" | grep "project_status" && echo {} is contrib || echo {} is custom' ';'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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