Index: CMT/HEAD/ChangeLog
===================================================================
--- CMT/HEAD/ChangeLog	(revision 522)
+++ CMT/HEAD/ChangeLog	(revision 523)
@@ -1,2 +1,15 @@
+2009-10-15    <rybkin@lal.in2p3.fr> 410
+
+	* source/cmt_syntax.cxx: In class KwdSetupStrategy, add new strategy
+	SetupScripts with values scripts and no_scripts
+	* source/cmt_project.cxx: In StrategyMgr default constructor, add the setup
+	strategy values (default: scripts), in function Strategy::update, check if
+	m_off_tag is 0 and, if so, initialise it
+	* source/cmt_parser.cxx: In Cmt::do_show_strategies, show the value of the
+	SetupScripts strategy, in functions Cmt::install_[test_]cleanup_scripts,
+	Cmt::install_[test_]setup_scripts, do not generate (or remove existing)
+	cleanup and setup scripts if SetupScripts strategy is no_scripts (i. e.,
+	setup_strategy includes no_scripts)
+	
 2009-09-18    <rybkin@lal.in2p3.fr> 409
 
Index: CMT/HEAD/source/cmt_parser.cxx
===================================================================
--- CMT/HEAD/source/cmt_parser.cxx	(revision 522)
+++ CMT/HEAD/source/cmt_parser.cxx	(revision 523)
@@ -4302,4 +4302,13 @@
     }
 
+  if (current_use.get_strategy ("SetupScripts"))
+    {
+      cout << " scripts";
+    }
+  else
+    {
+      cout << " no_scripts";
+    }
+
   cout << endl;
   
@@ -4748,4 +4757,23 @@
   static const PrintMode  mode[2]     = {Csh, Sh};
 #endif
+
+  Use& current_use = Use::current ();
+
+  if (!current_use.get_strategy ("SetupScripts"))
+    {
+      for (int i = 0; i < modes; i++)
+	{
+          cmt_string old_file_name = "cleanup";
+          old_file_name += ".";
+          old_file_name += suffix[i];
+	  if (CmtSystem::test_file (old_file_name))
+	    {
+	      if (CmtMessage::active (Error))
+		cerr << "Removing cleanup script " + old_file_name << endl;
+	      CmtSystem::remove_file (old_file_name);
+	    }
+	}
+      return;
+    }
 
   if (CmtMessage::active (Error))
@@ -4836,8 +4864,25 @@
 #endif
 
+  Use& current_use = Use::current ();
+
+  if (!current_use.get_strategy ("SetupScripts"))
+    {
+      for (int i = 0; i < modes; i++)
+	{
+          cmt_string old_file_name = "setup";
+          old_file_name += ".";
+          old_file_name += suffix[i];
+	  if (CmtSystem::test_file (old_file_name))
+	    {
+	      if (CmtMessage::active (Error))
+		cerr << "Removing setup script " + old_file_name << endl;
+	      CmtSystem::remove_file (old_file_name);
+	    }
+	}
+      return;
+    }
+
   if (CmtMessage::active (Error))
     cerr << "Creating setup scripts." << endl;
-
-  Use& current_use = Use::current ();
   
   cmt_string no_cleanup_opt;
@@ -4950,4 +4995,23 @@
   static const PrintMode  mode[2]     = {Csh, Sh};
 #endif
+
+  Use& current_use = Use::current ();
+
+  if (!current_use.get_strategy ("SetupScripts"))
+    {
+      for (int i = 0; i < modes; i++)
+	{
+          cmt_string old_file_name = "cleanup";
+          old_file_name += ".";
+          old_file_name += suffix[i];
+	  if (CmtSystem::test_file (old_file_name))
+	    {
+	      if (CmtMessage::active (Error))
+		cerr << "Removing cleanup script " + old_file_name << endl;
+	      CmtSystem::remove_file (old_file_name);
+	    }
+	}
+      return;
+    }
 
   if (CmtMessage::active (Error))
@@ -5060,8 +5124,25 @@
 #endif
 
+  Use& current_use = Use::current ();
+
+  if (!current_use.get_strategy ("SetupScripts"))
+    {
+      for (int i = 0; i < modes; i++)
+	{
+          cmt_string old_file_name = "setup";
+          old_file_name += ".";
+          old_file_name += suffix[i];
+	  if (CmtSystem::test_file (old_file_name))
+	    {
+	      if (CmtMessage::active (Error))
+		cerr << "Removing setup script " + old_file_name << endl;
+	      CmtSystem::remove_file (old_file_name);
+	    }
+	}
+      return;
+    }
+
   if (CmtMessage::active (Error))
     cerr << "Creating setup scripts." << endl;
-
-  Use& current_use = Use::current ();
 
   cmt_string no_cleanup_opt;
Index: CMT/HEAD/source/cmt_project.cxx
===================================================================
--- CMT/HEAD/source/cmt_project.cxx	(revision 522)
+++ CMT/HEAD/source/cmt_project.cxx	(revision 523)
@@ -1945,4 +1945,5 @@
   set_default_strategy ("SetupRoot");
   set_default_strategy ("SetupCleanup");
+  set_default_strategy ("SetupScripts");
   set_default_strategy ("BuildPrototypes");
   set_default_strategy ("InstallArea");
@@ -2723,4 +2724,14 @@
 
   s = new StrategyDef;
+  s->m_keyword = "setup";
+  s->m_name = "SetupScripts";
+  s->m_on_value = "scripts";
+  s->m_off_value = "no_scripts";
+  s->m_default_value = true;
+  s->m_priority_value = false;
+
+  m_defs.push_back (s);
+
+  s = new StrategyDef;
   s->m_keyword = "structure";
   s->m_name = "VersionDirectory";
@@ -2857,5 +2868,5 @@
   m_off_tag = Tag::find (to_untag_name);
 
-  if (m_on_tag == 0) 
+  if (m_on_tag == 0 || m_off_tag == 0)
     {
       m_on_tag = Tag::add (to_tag_name, PriorityConfig, "PROJECT", 0);
Index: CMT/HEAD/source/cmt_syntax.cxx
===================================================================
--- CMT/HEAD/source/cmt_syntax.cxx	(revision 522)
+++ CMT/HEAD/source/cmt_syntax.cxx	(revision 523)
@@ -1037,4 +1037,12 @@
       {
 	strategy = "SetupCleanup";
+      }
+    else if (value == "scripts")
+      {
+	strategy = "SetupScripts";
+      }
+    else if (value == "no_scripts")
+      {
+	strategy = "SetupScripts";
       }
     else
