Index: nodewords.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/Attic/nodewords.install,v
retrieving revision 1.10.2.74
diff -u -r1.10.2.74 nodewords.install
--- nodewords.install	13 Oct 2009 20:00:18 -0000	1.10.2.74
+++ nodewords.install	13 Oct 2009 21:52:00 -0000
@@ -586,12 +586,57 @@
 }
 
 /**
- * Implementation of hook_update_NN().
+ * Try to re-enable new modules by guessing if they have been used in past.
  */
 function nodewords_update_6134() {
-  drupal_set_message(t('Some modules have been renamed, and they need to be re-enabled. Visit the <a href="@modules_page">modules page</a>, and verify that the modules you need are already enabled.', array('@modules_page' => url('admin/build/modules'))));
+  $ret = array();
 
-  return array();
+  // Re-enable nodewords_basic if supported metatags are found.
+  $nodewords_basic_tags = array(
+    'abstract',
+    'canonical',
+    'copyright',
+    'description',
+    'keywords',
+    'revisit-after',
+    'robots'
+  );
+
+  if (db_result(db_query("SELECT COUNT(1) FROM {nodewords} WHERE name IN (" . db_placeholders($nodewords_basic_tags, 'varchar') . ")", $nodewords_basic_tags))) {
+    module_enable(array('nodewords_basic'));
+    $ret[] = array('success' => TRUE, 'query' => 'Module nodewords basic has been re-enabled.');
+  }
+
+  // Re-enable nodewords_extra if supported metatags are found.
+  $nodewords_extra_tags = array(
+    'dc.contributor',
+    'dc.creator',
+    'dc.date',
+    'dc.publisher',
+    'dc.title',
+    'geourl',
+    'location',
+    'pics-label',
+  );
+
+  if (db_result(db_query("SELECT COUNT(1) FROM {nodewords} WHERE name IN (" . db_placeholders($nodewords_extra_tags, 'varchar') . ")", $nodewords_extra_tags))) {
+    module_enable(array('nodewords_extra'));
+    $ret[] = array('success' => TRUE, 'query' => 'Module nodewords extra has been re-enabled.');
+  }
+
+  // Re-enable nodewords_extra if supported metatags are found.
+  $nodewords_verification_tags = array(
+    'bing_webmaster_center',
+    'google_webmaster_tools',
+    'yahoo_site_explorer',
+  );
+
+  if (db_result(db_query("SELECT COUNT(1) FROM {nodewords} WHERE name IN (" . db_placeholders($nodewords_verification_tags, 'varchar') . ")", $nodewords_verification_tags))) {
+    module_enable(array('$nodewords_verification_tags'));
+    $ret[] = array('success' => TRUE, 'query' => 'Module nodewords verification tags has been re-enabled.');
+  }
+
+  return $ret;
 }
 
 /**
