Excluding modules from being updated
Sometimes we may have downloaded a dev version of a module because it has some fixes, or maybe he have applied a patch. So in order not to lose our changes in case of an update we must install this module http://drupal.org/project/update_advanced and then go to admin/reports/updates/settings choosing the appropriate module's row tab "WARN IF OUT OF DATE" set to "Never". Drush also respects the settings of the module and as you can see in the above image views does not get updated due to the exclusion from our module.
CAUTION! When we make a "manual update check" you may notice that the module isn't been checked but when we check it to be updated and press update, then the update procedure ignores the module's settings. So you have to be very careful in this case and in order to be on the safe side you should always update through drush.
In my case though I had a module which I found in sandbox and it doesn't appear on the list of our magnificent module. What should we do in case the module comes out of sandbox and drush updates it without our attention after we have applied a patch on it? Well...there is a very nice and neat solution. We exclude it with the below hook code:
<span style="color: #000000"><span style="color: #0000BB"><?php<br></span><span style="color: #FF8000">/**<br> * Implements hook_update_projects_alter().<br> */<br></span><span style="color: #007700">function </span><span style="color: #0000BB">custom_module_update_projects_alter</span><span style="color: #007700">(&</span><span style="color: #0000BB">$projects</span><span style="color: #007700">) {<br> </span><span style="color: #0000BB">$blacklist </span><span style="color: #007700">= array(<br> </span><span style="color: #DD0000">'my_module'</span><span style="color: #007700">,<br> );<p> foreach (</p></span><span style="color: #0000BB">$blacklist </span><span style="color: #007700">as </span><span style="color: #0000BB">$module</span><span style="color: #007700">) {<br> unset(</span><span style="color: #0000BB">$projects</span><span style="color: #007700">[</span><span style="color: #0000BB">$module</span><span style="color: #007700">]);<br> }<br>}<br></span><span style="color: #0000BB">?></span></span>
/**
* EDITED
*/
User "Si Hobbs" also pointed out a very neat approach to the problem also.
You just change the project name from the .info file of your module, let's say with something like "hacked_%modulename%" and you're done!
Altered info structure:
Updates list after alteration: