- Timestamp:
- Feb 1, 2007, 3:12:40 PM (18 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r360 r363 1 1 2007-01-02 Vincent Garonne <garonne@lal.in2p3.fr> 322 2 3 * source/cmt_parser.cxx: update to deal with the action return status code 4 and the -no_auto_imports differents cases. 5 * source/cmt_constituents.cxx: Add support for the -import=PkgA, PkgB 6 * source/cmt_error.*: update to deal with the action return status code 7 * source/cmt.cxx: return status code 8 2 9 2007-31-01 Vincent Garonne <garonne@lal.in2p3.fr> 321 3 10 -
CMT/HEAD/source/cmt.cxx
r11 r363 2 2 // Copyright Christian Arnault LAL-Orsay CNRS 3 3 // arnault@lal.in2p3.fr 4 // Modified by garonne@lal.in2p3.fr 4 5 // See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 //----------------------------------------------------------- 6 7 7 8 #include "cmt.h" 9 10 #include <stdlib.h> 8 11 9 12 /*----------------------------------------------------------*/ … … 12 15 { 13 16 //cout << "argc=" << argc << endl; 14 15 17 int status = Cmt::parser (argc, argv); 16 18 if (status !=0) return -1; 17 19 return (status); 18 20 } -
CMT/HEAD/source/cmt_constituent.cxx
r11 r363 2 2 // Copyright Christian Arnault LAL-Orsay CNRS 3 3 // arnault@lal.in2p3.fr 4 // Modified by garonne@lal.in2p3.fr 4 5 // See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 //----------------------------------------------------------- … … 210 211 } 211 212 else if (w.substr (0, 8) == "-import=") 212 { 213 cmt_string& import = m_constituent.imports.add (); 214 w.substr (8, import); 213 { 214 cmt_string text_imports; 215 w.substr (8, text_imports); 216 217 CmtSystem::cmt_string_vector imports; 218 219 CmtSystem::split (text_imports, ',', imports); 220 221 for (int i = 0; i < imports.size (); i++) 222 { 223 cmt_string& import = m_constituent.imports.add (); 224 import = imports[i] ; 225 } 215 226 } 216 227 else if (w.substr (0, 7) == "-group=") … … 235 246 else if (w.substr (0, 1) == "-") 236 247 { 237 if (!Cmt::get_quiet ())238 {248 //if (!Cmt::get_quiet ()) 249 //{ 239 250 cerr << "#CMT> Warning: bad option " 240 251 << w << " in constituent " << m_constituent.name << endl; 241 252 //CmtError::set (CmtError::execution_error, cmd); 242 }253 //} 243 254 } 244 255 else if ((equal = w.find ("=")) != cmt_string::npos) -
CMT/HEAD/source/cmt_error.cxx
r11 r363 2 2 // Copyright Christian Arnault LAL-Orsay CNRS 3 3 // arnault@lal.in2p3.fr 4 // Modified by garonne@lal.in2p3.fr 4 5 // See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 //----------------------------------------------------------- … … 35 36 error_names.add() = "unknown_command"; 36 37 error_names.add() = "project_release_conflict"; 38 error_names.add() = "execution_failed"; 39 m_execution_error = 0; 37 40 } 38 41 … … 45 48 m_code = CmtError::ok; 46 49 m_text = ""; 50 m_execution_error = 0 ; 47 51 } 48 52 49 void set (CmtError::code code, const cmt_string& text )53 void set (CmtError::code code, const cmt_string& text, const int execution_error) 50 54 { 51 55 m_code = code; 52 56 m_text = text; 57 m_execution_error = execution_error; 53 58 } 54 59 … … 56 61 { 57 62 return (m_code); 63 } 64 65 int get_last_execution_error () 66 { 67 return m_execution_error; 58 68 } 59 69 … … 74 84 cmt_string m_text; 75 85 cmt_vector<cmt_string> error_names; 86 int m_execution_error; 76 87 }; 77 88 … … 110 121 111 122 //--------------------------------------------------------------- 123 int CmtError::get_last_execution_error () 124 { 125 Error& e = Error::instance (); 126 127 return (e.get_last_execution_error ()); 128 } 129 130 //--------------------------------------------------------------- 112 131 const cmt_string& CmtError::get_error_name (code error) 113 132 { … … 118 137 119 138 //--------------------------------------------------------------- 120 void CmtError::set (code error, const cmt_string& text )139 void CmtError::set (code error, const cmt_string& text, const int execution_error) 121 140 { 122 141 Error& e = Error::instance (); 123 142 124 e.set (error, text );143 e.set (error, text, execution_error); 125 144 } 126 145 -
CMT/HEAD/source/cmt_error.h
r11 r363 2 2 // Copyright Christian Arnault LAL-Orsay CNRS 3 3 // arnault@lal.in2p3.fr 4 // Modified by garonne@lal.in2p3.fr 4 5 // See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 //----------------------------------------------------------- … … 35 36 cannot_remove_lock, 36 37 conflicting_lock, 37 unknown_command, 38 project_release_conflict 38 unknown_command, 39 project_release_conflict, 40 execution_failed 39 41 } code; 40 42 43 41 44 static void clear (); 42 45 static code get_last_error_code (); 43 46 static bool has_pending_error (); 44 47 static const cmt_string& get_error_name (code error); 45 static void set (code error, const cmt_string& text); 48 static void set (code error, const cmt_string& text, const int execution_error=0); 49 50 static int get_last_execution_error (); 51 46 52 static cmt_string get_last_error (); 47 53 static void print (); 54 48 55 }; 49 56 -
CMT/HEAD/source/cmt_parser.cxx
r335 r363 2734 2734 cout << "Execute action " << ap.arguments[0] << " => " << cmd << endl; 2735 2735 2736 CmtSystem::execute (cmd); 2736 int status = CmtSystem::execute (cmd); 2737 if (status != 0) 2738 CmtError::set (CmtError::execution_failed, ap.arguments[0], status); 2739 2737 2740 } 2738 2741 } … … 5763 5766 if (CmtError::has_pending_error ()) 5764 5767 { 5765 int code = CmtError::get_last_error_code (); 5768 int code = CmtError::get_last_error_code (); 5769 if (code == CmtError::execution_failed) 5770 { 5771 code = CmtError::get_last_execution_error(); 5772 } 5773 5766 5774 if (!Me.m_quiet) CmtError::print (); 5767 5775 clear (); … … 7154 7162 if (u->discarded) continue; 7155 7163 7156 Package* p = u->get_package ();7157 if (p->is_cmt ()) continue;7164 Package* p = u->get_package (); 7165 if (p->is_cmt ()) continue; 7158 7166 7159 7167 u->fill_macro (buffer, "linkopts"); … … 7197 7205 7198 7206 if (u->discarded) continue; 7199 7207 7200 7208 if (Cmt::get_debug ()) 7201 7209 { … … 7226 7234 for (i = 0; i < base_auto_imports_states.size (); i++) 7227 7235 { 7228 if (auto_imports_states[i] != base_auto_imports_states[i]) 7229 { 7236 7237 if (base_auto_imports_states[i]== On && auto_imports_states[i] == Off) 7238 continue; 7239 7240 //if (auto_imports_states[i] != base_auto_imports_states[i]) 7241 // { 7230 7242 Use* u = Uses[i]; 7231 7243 7232 7244 if (u->discarded) continue; 7233 7234 Package* p = u->get_package (); 7235 if (p->is_cmt ()) continue; 7245 if (u->m_hidden) continue; 7246 7247 Package* p = u->get_package (); 7248 if (p->is_cmt ()) continue; 7236 7249 7237 7250 if (Cmt::get_debug ()) … … 7240 7253 } 7241 7254 7242 if (u->auto_imports != Off) continue;7255 //if (u->auto_imports != Off) continue; 7243 7256 7244 7257 imports.push_back (u); 7245 }7258 // } 7246 7259 } 7247 7260
Note: See TracChangeset
for help on using the changeset viewer.