Changeset 181
- Timestamp:
- Apr 27, 2006, 1:20:07 PM (18 years ago)
- Location:
- CMT/HEAD/source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/source/cmt.h
r109 r181 131 131 static void do_do (const ArgParser& ap); 132 132 static void do_expand_model (const ArgParser& ap); 133 static void do_filter (const ArgParser& ap); 134 static void do_help (const ArgParser& ap); 135 static void do_lock (const ArgParser& ap); 136 static void do_remove (const ArgParser& ap); 133 static void do_filter (const ArgParser& ap); 134 static void do_help (const ArgParser& ap); 135 static void do_lock (const ArgParser& ap); 136 static void do_relocate (const ArgParser& ap); 137 static void do_remove (const ArgParser& ap); 137 138 static void do_remove_library_links (const ArgParser& ap); 138 139 static void do_run (const ArgParser& ap); -
CMT/HEAD/source/cmt_commands.cxx
r151 r181 135 135 pv.push_back (&ArgParser::do_lock); i++; 136 136 137 parsers.add ("re", i); 137 parsers.add ("rel", i); 138 parsers.add ("relo", i); 139 parsers.add ("reloc", i); 140 parsers.add ("reloca", i); 141 parsers.add ("relocat", i); 142 parsers.add ("relocate", i); 143 pv.push_back (&ArgParser::do_relocate); i++; 144 138 145 parsers.add ("rem", i); 139 146 parsers.add ("remo", i); … … 992 999 } 993 1000 } 1001 1002 1003 void ArgParser::do_relocate () 1004 { 1005 cmt.m_action = action_relocate; 1006 } 1007 994 1008 995 1009 void ArgParser::do_remove () … … 2105 2119 help_texts.add () = "load"; 2106 2120 help_texts.add () = "lock [<p> <v> [<path>]] : lock a package"; 2121 help_texts.add () = "relocate : generate only setup scripts"; 2107 2122 help_texts.add () = "remove <package> <version> [<path>] : remove a package version"; 2108 2123 help_texts.add () = "remove library_links : remove symbolic links towards all imported libraries"; … … 2201 2216 help.add (action_load, help_texts[action_load]); 2202 2217 help.add (action_lock, help_texts[action_lock]); 2218 help.add (action_relocate, help_texts[action_relocate]); 2203 2219 help.add (action_remove, help_texts[action_remove]); 2204 2220 help.add (action_remove_library_links, help_texts[action_remove_library_links]); -
CMT/HEAD/source/cmt_commands.h
r109 r181 43 43 void do_cvssubpackages (); 44 44 void do_cvssubprojects (); 45 void do_cvstags (); 46 void do_do (); 47 void do_expand (); 48 void do_filter (); 49 void do_help (); 50 void do_lock (); 51 void do_remove (); 52 void do_run (); 45 void do_cvstags (); 46 void do_do (); 47 void do_expand (); 48 void do_filter (); 49 void do_help (); 50 void do_lock (); 51 void do_relocate (); 52 void do_remove (); 53 void do_run (); 53 54 void do_run_sequence (); 54 55 void do_set (); -
CMT/HEAD/source/cmt_parser.cxx
r180 r181 2175 2175 2176 2176 //cout << "do_config> current style=" << Me.m_current_style << endl; 2177 2178 Me.m_quiet = true; 2179 2180 if (!reach_current_package ()) 2181 { 2182 cout << "Cannot read the requirements file" << endl; 2183 return; 2184 } 2185 2186 install_setup_scripts (); 2187 install_cleanup_scripts (); 2188 2189 CmtSystem::cd (".."); 2190 2191 Branch::BranchVector& branches = Branch::branches (); 2192 2193 int i; 2194 2195 for (i = 0; i < branches.size (); i++) 2196 { 2197 const Branch& branch = branches[i]; 2198 const cmt_string& branch_name = branch.name (); 2199 2200 if (!CmtSystem::test_directory (branch_name)) 2201 { 2202 if (!CmtSystem::mkdir (branch_name)) 2203 { 2204 cout << "Cannot create the " << branch_name <<" branch" << endl; 2205 } 2206 else 2207 { 2208 cout << "Installing the " << branch_name << " directory" << endl; 2209 } 2210 } 2211 else 2212 { 2213 cout << branch_name << " directory already installed" << endl; 2214 } 2215 } 2216 } 2217 2218 2219 //---------------------------------------------------------- 2220 void Cmt::do_relocate (const ArgParser& ap) 2221 { 2222 if (CmtLock::check () == CmtLock::locked_by_another_user) 2223 { 2224 CmtError::set (CmtError::conflicting_lock, "relocate>"); 2225 return; 2226 } 2227 2228 Use& current_use = Use::current (); 2229 2230 if (Me.m_debug) 2231 { 2232 cout << "Cmt::do_relocate> " << endl; 2233 cout << "pwd " << CmtSystem::pwd () << endl; 2234 cout << "current_dir " << Me.m_current_dir << endl; 2235 cout << "default_path " << Me.m_default_path << endl; 2236 cout << "cmt config " << 2237 Me.m_current_package << " " << 2238 Me.m_current_version << " " << 2239 Me.m_current_path << endl; 2240 } 2241 2242 if (Me.m_current_package == "CMT") return; 2243 if (Me.m_current_package == "methods") return; 2244 2245 cmt_string branch; 2246 2247 CmtSystem::basename (Me.m_current_dir, branch); 2248 2249 if ((branch != "mgr") && (branch != "cmt")) 2250 { 2251 2252 // 2253 // Here we are in a standalone package (ie completely unstructured) 2254 // 2255 2256 if (CmtSystem::test_file ("requirements")) 2257 { 2258 cout << "------------------------------------------" << endl; 2259 cout << "Configuring environment for standalone package." << endl; 2260 cout << "CMT version " << Me.m_cmt_version << "." << endl; 2261 cout << "System is " << Me.m_cmt_config << endl; 2262 cout << "------------------------------------------" << endl; 2263 2264 install_test_setup_scripts (); 2265 install_test_cleanup_scripts (); 2266 2267 Generator::build_default_makefile (); 2268 } 2269 else 2270 { 2271 cout << "==============================================" << endl; 2272 cout << "cmt relocate must be operated either upon " 2273 "an existing package" << endl; 2274 cout << " (ie. when a requirements file already exists)" << endl; 2275 cout << " > cd ..." << endl; 2276 cout << " > cmt relocate" << endl; 2277 cout << "or to create a new package" << endl; 2278 cout << " > cmt relocate <package> <version> [<path>]" << endl; 2279 cout << "==============================================" << endl; 2280 } 2281 2282 return; 2283 } 2284 2285 configure_current_package (); 2286 2287 Generator::build_default_makefile (); 2288 2289 CmtSystem::cd (".."); 2290 CmtSystem::cd (branch); 2291 2292 Use& use = Use::current (); 2293 2294 use.set (Me.m_current_package, 2295 Me.m_current_version, 2296 Me.m_current_path, 2297 "", 2298 ""); 2299 2300 use.change_path (Me.m_current_path); 2301 use.style = Me.m_current_style; 2177 2302 2178 2303 Me.m_quiet = true; … … 4905 5030 case action_load : 4906 5031 case action_lock : 5032 case action_relocate: 4907 5033 case action_remove : 4908 5034 case action_remove_library_links : … … 5015 5141 // case action_lock : 5016 5142 // case action_remove : 5143 case action_relocate: 5017 5144 case action_remove_library_links : 5018 5145 case action_run : … … 5118 5245 case action_lock : 5119 5246 // case action_remove : 5247 case action_relocate : 5120 5248 case action_remove_library_links : 5121 5249 case action_run : … … 5231 5359 case action_load : 5232 5360 case action_lock : 5361 case action_relocate : 5233 5362 case action_remove : 5234 5363 case action_remove_library_links : … … 5407 5536 case action_lock : 5408 5537 do_lock (ap); 5538 break; 5539 case action_relocate : 5540 do_relocate (ap); 5409 5541 break; 5410 5542 case action_remove : -
CMT/HEAD/source/cmt_parser.h
r83 r181 1 1 2 //----------------------------------------------------------- 2 3 // Copyright Christian Arnault LAL-Orsay CNRS … … 257 258 action_load, 258 259 action_lock, 260 action_relocate, 259 261 action_remove, 260 262 action_remove_library_links,
Note: See TracChangeset
for help on using the changeset viewer.