Index: CMT/HEAD/ChangeLog
===================================================================
--- CMT/HEAD/ChangeLog	(revision 561)
+++ CMT/HEAD/ChangeLog	(revision 562)
@@ -1,2 +1,17 @@
+2011-03-08    <rybkin@lal.in2p3.fr> 445
+
+	* source/cmt_parser.cxx: In class Cmt, in function do_config, remove
+	constituent input requirements file(s), backup Makefile fragments, do not
+	invoke function reach_current_package (done before do_config). In function
+	parser, invoke class SyntaxParser function parse_requirements_text with
+	extra statements, if any, thereby making -e=<extra-statement(s)> functional
+	* source/cmt_commands.cxx: In class ArgParser function option_e, do not
+	print warning when extra statement(s) are provided on command line
+	* mgr/fragments/cleanup_header: With PEDANTIC set, fail for taget without
+	rule, using Make function error
+	* mgr/cmt_svn_checkout.py: Rename cmt/version.cmt and issue warning if
+	under version control and checked out with CMT structuring style
+	with_version_directory
+	
 2011-03-07    <rybkin@lal.in2p3.fr> 444
 
Index: CMT/HEAD/mgr/cmt_svn_checkout.py
===================================================================
--- CMT/HEAD/mgr/cmt_svn_checkout.py	(revision 561)
+++ CMT/HEAD/mgr/cmt_svn_checkout.py	(revision 562)
@@ -23,6 +23,6 @@
 """
 
-__version__ = '0.4.0'
-__date__ = 'Wed Jul 01 2009'
+__version__ = '0.5.0'
+__date__ = 'Wed Feb 22 2011'
 __author__ = 'Grigory Rybkin'
 
@@ -266,4 +266,13 @@
                 if not self.with_version_directory:
                     sc += self.write(os.path.join(p,'version.cmt'), version)
+                elif os.path.exists(os.path.join(p,'version.cmt')):
+                    print >>sys.stderr, 'Warning: file %s normally should not be under version control. Please, consider removing' % os.path.join(d,'version.cmt')
+                    try:
+                        os.rename(os.path.join(p,'version.cmt'),
+                                  os.path.join(p,'version.cmt.orig'))
+                        print >>sys.stderr, 'renamed %s -> %s' % (`os.path.join(p,'version.cmt')`, `os.path.join(p,'version.cmt.orig')`)
+                    except (IOError, os.error), e:
+                        error(e)
+                    
                 if self.config:
                     sc += self.generate(p)
Index: CMT/HEAD/mgr/fragments/cleanup_header
===================================================================
--- CMT/HEAD/mgr/fragments/cleanup_header	(revision 561)
+++ CMT/HEAD/mgr/fragments/cleanup_header	(revision 562)
@@ -7,25 +7,7 @@
 .DEFAULT::
 	$(echo) "(${CONSTITUENT}.make) $@: No rule for such target" >&2
-#	@echo "#CMT> Warning: $@: No rule for such target" >&2; exit
-	if echo $@ | grep '$(package)setup\.make$$' >/dev/null; then\
-	 echo "$(CMTMSGPREFIX)" "(${CONSTITUENT}.make): $@: File no longer generated" >&2; exit 0; fi
 else
 .DEFAULT::
-	$(echo) "(${CONSTITUENT}.make) PEDANTIC: $@: No rule for such target" >&2
-	if echo $@ | grep '$(package)setup\.make$$' >/dev/null; then\
-	 echo "$(CMTMSGPREFIX)" "(${CONSTITUENT}.make): $@: File no longer generated" >&2; exit 0;\
-	 elif test $@ = "$(cmt_final_setup)" -o\
-	 $@ = "$(cmt_final_setup_${CONSTITUENT})" ; then\
-	 found=n; for s in 1 2 3 4 5; do\
-	 sleep $$s; test ! -f $@ || { found=y; break; }\
-	 done; if test $$found = n; then\
-	 test -z "$(cmtmsg)" ||\
-	 echo "$(CMTMSGPREFIX)" "(${CONSTITUENT}.make) PEDANTIC: $@: Seems to be missing. Ignore it for now" >&2; exit 0 ; fi;\
-	 elif test `expr $@ : '.*/'` -ne 0 ; then\
-	 test -z "$(cmtmsg)" ||\
-	 echo "$(CMTMSGPREFIX)" "(${CONSTITUENT}.make) PEDANTIC: $@: Seems to be a missing file. Please check" >&2; exit 2 ; \
-	 else\
-	 test -z "$(cmtmsg)" ||\
-	 echo "$(CMTMSGPREFIX)" "(${CONSTITUENT}.make) PEDANTIC: $@: Seems to be a fake target due to some pattern. Just ignore it" >&2 ; exit 0; fi
+	$(error PEDANTIC: $@: No rule for such target)
 endif
 
Index: CMT/HEAD/source/cmt_commands.cxx
===================================================================
--- CMT/HEAD/source/cmt_commands.cxx	(revision 561)
+++ CMT/HEAD/source/cmt_commands.cxx	(revision 562)
@@ -1976,6 +1976,5 @@
 void ArgParser::option_e ()
 {
-  CmtMessage::warning ("extra statement = " + arg);
-  //  cerr << "#CMT> Warning: extra statement = " << arg << endl;
+  //CmtMessage::warning ("extra statement = " + arg);
   extra_line = arg;
 }
Index: CMT/HEAD/source/cmt_parser.cxx
===================================================================
--- CMT/HEAD/source/cmt_parser.cxx	(revision 561)
+++ CMT/HEAD/source/cmt_parser.cxx	(revision 562)
@@ -2876,5 +2876,6 @@
 
   CmtSystem::cmt_string_vector makes;
-  cmt_regexp expression ("[.]n?make(sav)?$");
+  cmt_regexp expression ("[.](n?make(sav|cmtsave)?|in)$");
+  //  cmt_regexp expression ("[.]n?make(sav)?$");
 
   CmtSystem::scan_dir (".", expression, makes);
@@ -2891,15 +2892,20 @@
           CmtSystem::split (s, '.', words);
           if (words.size()>=2)
-	    if (CmtSystem::get_makefile_suffix () == "nmake" && words[1] == "nmake")
+	    if (CmtSystem::get_makefile_suffix () == "nmake" &&
+		(words[1] == "nmake"|| words[1] == "nmakesav" || words[1] == "nmakecmtsave"))
 	      CmtSystem::remove_file (s);
-	    else if (CmtSystem::get_makefile_suffix () == "make" && words[1] == "make")
+	    else if (CmtSystem::get_makefile_suffix () == "make" &&
+		     (words[1] == "make" || words[1] == "makesav" || words[1] == "makecmtsave"))
 	      CmtSystem::remove_file (s);
         }
     }
-  
-
-  CmtSystem::cd ("..");
-
-  CmtSystem::scan_dir (Me.m_cmt_config, expression, makes); 
+
+  cmt_string bin ("..");
+  bin += CmtSystem::file_separator ();
+  bin += Me.m_cmt_config;
+  //  CmtSystem::cd ("..");
+
+  CmtSystem::scan_dir (bin, expression, makes); 
+  //  CmtSystem::scan_dir (Me.m_cmt_config, expression, makes); 
     
   if (makes.size () > 0) 
@@ -2917,13 +2923,18 @@
           CmtSystem::split (s, '.', words);
           if (words.size()>=2)
-	    if (CmtSystem::get_makefile_suffix () == "nmake" && words[1] == "nmake")
+	    if (CmtSystem::get_makefile_suffix () == "nmake" &&
+		(words[1] == "nmake"|| words[1] == "nmakesav" || words[1] == "nmakecmtsave"))
 	      CmtSystem::remove_file (s);
-	    else if (CmtSystem::get_makefile_suffix () == "make" && words[1] == "make")
+	    else if (CmtSystem::get_makefile_suffix () == "make" &&
+		     (words[1] == "make" || words[1] == "makesav" || words[1] == "makecmtsave"))
 	      CmtSystem::remove_file (s);
-        }    
-    } 
-
-  CmtSystem::cd (branch); 
-
+	    else if (words.size() == 2 && words[1] == "in")
+	      CmtSystem::remove_file (s);
+        }
+    }
+
+  //  CmtSystem::cd (branch); 
+
+  /*
   Use& use = Use::current ();
 
@@ -2946,5 +2957,6 @@
       return;
     }
-
+  */
+  Me.m_quiet = true;
   install_setup_scripts ();
   install_cleanup_scripts ();
@@ -6356,5 +6368,5 @@
 
   //  if (strlen (ap.extra_file.c_str ()) > 0) SyntaxParser::parse_requirements (ap.extra_file, (Use*) 0);
-  if (strlen (ap.extra_line.c_str ()) > 0) SyntaxParser::parse_requirements_line (ap.extra_line, (Use*) 0);
+  //  if (strlen (ap.extra_line.c_str ()) > 0) SyntaxParser::parse_requirements_line (ap.extra_line, (Use*) 0);
 
   //
@@ -6707,5 +6719,8 @@
 	  use_extra_file (ap.extra_file);
 	use_user_context_requirements ();
+	if (strlen (ap.extra_line.c_str ()) > 0)
+	  SyntaxParser::parse_requirements_text (ap.extra_line, "extra statement(s)", (Use*) 0);
 	Me.m_warnings = w;
+	//if (strlen (ap.extra_line.c_str ()) > 0) SyntaxParser::parse_requirements_line (ap.extra_line, &(Use::current ()));
       }
       break;
