Changeset 291
- Timestamp:
- Oct 26, 2006, 6:32:41 PM (19 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/mgr/cmt_dependencies.make
r144 r291 24 24 cmt_regexp_cxx_dependencies = ../source/cmt_regexp.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_regexp.h ../source/cmt_vector.h ../source/cmt_system.h 25 25 cmt_model_cxx_dependencies = ../source/cmt_model.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt_model.h ../source/cmt.h ../source/cmt_parser.h ../source/cmt_fragment.h ../source/cmt_map.h ../source/cmt_include.h ../source/cmt_script.h ../source/cmt_pattern.h ../source/cmt_scope_section.h ../source/cmt_use.h ../source/cmt_tag.h ../source/cmt_symbol.h 26 cmt_project_cxx_dependencies = ../source/cmt_project.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_parser.h ../source/cmt_ awk.h ../source/cmt_project.h ../source/cmt_branch.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_map.h ../source/cmt_pattern.h ../source/cmt_include.h ../source/cmt_script.h ../source/cmt_scope_section.h ../source/cmt_use.h ../source/cmt_tag.h ../source/cmt_symbol.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_syntax.h ../source/cmt_error.h26 cmt_project_cxx_dependencies = ../source/cmt_project.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_parser.h ../source/cmt_map.h ../source/cmt_include.h ../source/cmt_script.h ../source/cmt_pattern.h ../source/cmt_scope_section.h ../source/cmt_use.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_branch.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_tag.h ../source/cmt_symbol.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_syntax.h ../source/cmt_error.h 27 27 cmt_syntax_cxx_dependencies = ../source/cmt_syntax.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_map.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_parser.h ../source/cmt_include.h ../source/cmt_script.h ../source/cmt_pattern.h ../source/cmt_scope_section.h ../source/cmt_use.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_syntax.h ../source/cmt_tag.h ../source/cmt_symbol.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_error.h ../source/cmt_branch.h ../source/cmt_language.h ../source/cmt_cmtpath_pattern.h 28 28 cmt_install_area_cxx_dependencies = ../source/cmt_install_area.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt_parser.h ../source/cmt.h ../source/cmt_install_area.h ../source/cmt_map.h ../source/cmt_include.h ../source/cmt_script.h ../source/cmt_pattern.h ../source/cmt_scope_section.h ../source/cmt_use.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_syntax.h ../source/cmt_tag.h ../source/cmt_symbol.h ../source/cmt_cmtpath_pattern.h -
CMT/HEAD/source/cmt_project.cxx
r283 r291 570 570 // Last step is to parse the project file 571 571 572 // First create the Project.m_use for the policy 573 project->m_use = Use::create (project->get_cmtpath(), 574 "project_"+project->get_name()+"_policy", 575 project->get_release (), "", "", ""); 576 project->m_use->done = false; 577 572 578 if (Cmt::get_debug ()) 573 579 { -
CMT/HEAD/source/cmt_project.h
r273 r291 11 11 #include "cmt_parser.h" 12 12 #include "cmt_system.h" 13 #include "cmt_use.h" 13 14 #include "cmt_awk.h" 15 14 16 15 17 class Project; … … 186 188 187 189 void visit (IProjectVisitor& visitor); 190 191 192 Use* m_use; 188 193 189 194 private: … … 207 212 208 213 bool m_configured; 209 210 214 cmt_vector <Strategy> m_strategies; 211 215 }; -
CMT/HEAD/source/cmt_syntax.cxx
r284 r291 109 109 const cmt_string& file_name, 110 110 int line_number) 111 {} 111 { 112 action (words, project->m_use, file_name, line_number); 113 } 112 114 113 115 }; … … 163 165 bool decode (const cmt_string& w, cmt_string& strategy, cmt_string& value) 164 166 { 165 bool result = true; 166 167 value = w; 168 169 if (w == "prototypes") 167 bool result = true; 168 169 value = w; 170 Symbol::expand(value); 171 172 173 if (value == "prototypes") 170 174 { 171 175 strategy = "BuildPrototypes"; 172 176 } 173 else if ( w== "no_prototypes")177 else if (value == "no_prototypes") 174 178 { 175 179 strategy = "BuildPrototypes"; 176 180 } 177 else if (( w == "with_installarea") || (w== "with_install_area"))181 else if ((value == "with_installarea") || (value == "with_install_area")) 178 182 { 179 183 value = "with_installarea"; 180 184 strategy = "InstallArea"; 181 185 } 182 else if (( w == "without_installarea") || (w== "without_install_area"))186 else if ((value == "without_installarea") || (value == "without_install_area")) 183 187 { 184 188 value = "without_installarea"; … … 232 236 int line_number) 233 237 { 234 for (int i = 1; i < words.size (); i++)238 for (int i = 1; i < words.size (); i++) 235 239 { 236 240 const cmt_string& w = words[i]; … … 494 498 Symbol::action (words, CommandMacro, use); 495 499 } 496 void action (const CmtSystem::cmt_string_vector& words, 497 Project* project, 498 const cmt_string& file_name, 499 int line_number) 500 {} 500 501 502 void action (const CmtSystem::cmt_string_vector& words, 503 Project* project, 504 const cmt_string& file_name, 505 int line_number) 506 { 507 action (words, project->m_use, file_name, line_number); 508 } 501 509 }; 502 510 … … 515 523 const cmt_string& file_name, 516 524 int line_number) 517 {} 525 { 526 action (words, project->m_use, file_name, line_number); 527 } 518 528 }; 519 529 … … 532 542 const cmt_string& file_name, 533 543 int line_number) 534 {} 544 { 545 action (words, project->m_use, file_name, line_number); 546 } 535 547 }; 536 548 … … 549 561 const cmt_string& file_name, 550 562 int line_number) 551 {} 563 { 564 action (words, project->m_use, file_name, line_number); 565 } 552 566 }; 553 567 … … 566 580 const cmt_string& file_name, 567 581 int line_number) 568 {} 582 { 583 action (words, project->m_use, file_name, line_number); 584 } 569 585 }; 570 586 … … 583 599 const cmt_string& file_name, 584 600 int line_number) 585 {} 601 { 602 action (words, project->m_use, file_name, line_number); 603 } 586 604 }; 587 605 … … 600 618 const cmt_string& file_name, 601 619 int line_number) 602 {} 620 { 621 action (words, project->m_use, file_name, line_number); 622 } 603 623 }; 604 624 … … 957 977 958 978 value = w; 959 960 if (w == "config") 979 Symbol::expand(value); 980 981 if (value == "config") 961 982 { 962 983 strategy = "SetupConfig"; 963 984 } 964 else if ( w== "no_config")985 else if (value == "no_config") 965 986 { 966 987 strategy = "SetupConfig"; 967 988 } 968 else if ( w== "root")989 else if (value == "root") 969 990 { 970 991 strategy = "SetupRoot"; 971 992 } 972 else if ( w== "no_root")993 else if (value == "no_root") 973 994 { 974 995 strategy = "SetupRoot"; 975 996 } 976 else if ( w== "cleanup")997 else if (value == "cleanup") 977 998 { 978 999 strategy = "SetupCleanup"; 979 1000 } 980 else if ( w== "no_cleanup")1001 else if (value == "no_cleanup") 981 1002 { 982 1003 strategy = "SetupCleanup"; … … 1029 1050 int line_number) 1030 1051 { 1031 for (int i = 1; i < words.size (); i++)1052 for (int i = 1; i < words.size (); i++) 1032 1053 { 1033 1054 const cmt_string& w = words[i]; … … 1060 1081 1061 1082 value = w; 1062 1063 if (w == "with_version_directory") 1083 Symbol::expand(value); 1084 1085 1086 if (value == "with_version_directory") 1064 1087 { 1065 1088 strategy = "VersionDirectory"; 1066 1089 } 1067 else if ( w== "without_version_directory")1090 else if (value == "without_version_directory") 1068 1091 { 1069 1092 strategy = "VersionDirectory"; … … 1116 1139 int line_number) 1117 1140 { 1118 for (int i = 1; i < words.size (); i++)1141 for (int i = 1; i < words.size (); i++) 1119 1142 { 1120 1143 const cmt_string& w = words[i]; … … 1153 1176 const cmt_string& file_name, 1154 1177 int line_number) 1155 {} 1178 { 1179 action (words, project->m_use, file_name, line_number); 1180 } 1156 1181 }; 1157 1182 … … 1170 1195 const cmt_string& file_name, 1171 1196 int line_number) 1172 {} 1197 { 1198 action (words, project->m_use, file_name, line_number); 1199 } 1173 1200 }; 1174 1201 … … 1278 1305 1279 1306 use->fill_standard_macros (buffer); 1280 1281 1307 AccessMode saved_current_access = Cmt::get_current_access (); 1282 1308 Cmt::set_current_access (UserMode); 1283 1309 me.do_parse_text (buffer, "", package_context, use, 0); 1284 1310 Cmt::set_current_access (saved_current_access); 1311 1312 // 1313 Project* p = use->get_project (); 1314 if (p != 0) 1315 { 1316 if (p->m_use !=0) 1317 { 1318 use->sub_uses.push_back (p->m_use); 1319 } 1320 } 1285 1321 } 1286 1322 … … 1436 1472 m_keywords.add ("version", new KwdVersion ()); 1437 1473 1474 // Project 1438 1475 m_project_keywords.add ("author", new KwdAuthor()); 1476 m_project_keywords.add ("apply_tag", new KwdApplyTag ()); 1439 1477 m_project_keywords.add ("build_strategy", new KwdBuildStrategy ()); 1440 1478 m_project_keywords.add ("container", new KwdContainer ()); 1479 1480 m_project_keywords.add ("macro", new KwdMacro ()); 1481 m_project_keywords.add ("macro+", new KwdMacroAppend ()); 1482 m_project_keywords.add ("macro_prepend", new KwdMacroPrepend ()); 1483 m_project_keywords.add ("macro_append", new KwdMacroAppend ()); 1484 m_project_keywords.add ("macro_remove", new KwdMacroRemove ()); 1485 m_project_keywords.add ("macro_remove_regexp", new KwdMacroRemoveRegexp ()); 1486 m_project_keywords.add ("macro_remove_all", new KwdMacroRemoveAll ()); 1487 m_project_keywords.add ("macro_remove_all_regexp", new KwdMacroRemoveAllRegexp ()); 1488 1489 m_project_keywords.add ("tag", new KwdTag ()); 1490 m_project_keywords.add ("tag_exclude", new KwdTagExclude ()); 1491 1441 1492 m_project_keywords.add ("project", new KwdProject ()); 1442 1493 m_project_keywords.add ("setup_strategy", new KwdSetupStrategy ()); -
CMT/HEAD/source/cmt_use.cxx
r290 r291 1373 1373 const cmt_string& new_path, 1374 1374 const cmt_string& new_version_alias, 1375 const cmt_string& new_path_alias) 1375 const cmt_string& new_path_alias, 1376 const cmt_string& native_version) 1376 1377 { 1377 1378 clear (); … … 1387 1388 specified_version = new_version; 1388 1389 version = new_version; 1390 this->native_version = native_version; 1389 1391 path = specified_path; 1390 1392 Symbol::expand (path); … … 1540 1542 1541 1543 if (CmtSystem::test_file ("version.cmt")) 1542 {1543 cmt_string v;1544 1545 v.read ("version.cmt");1546 int pos;1547 pos = v.find ('\n');1548 if (pos != cmt_string::npos) v.erase (pos);1549 pos = v.find ('\r');1550 if (pos != cmt_string::npos) v.erase (pos);1551 1552 CompareStatus s = compare_versions (version, v);1553 1554 if (Cmt::get_debug ())1555 {1556 cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl;1557 }1558 1559 switch (s)1560 {1561 case IdenticalIds:1562 case ExplicitOldMajorIdWinsAgainstWildarded:1563 case ExplicitOldMinorIdWinsAgainstWildarded:1564 case ExplicitOldPatchIdWinsAgainstWildarded:1565 break;1566 case ExplicitNewMajorIdWinsAgainstWildarded:1567 case ExplicitNewMinorIdWinsAgainstWildarded:1568 case NewMinorIdGreaterThanOld:1569 case ExplicitNewPatchIdWinsAgainstWildarded:1570 case NewPatchIdGreaterThanOld:1571 break;1572 case OldMajorIdGreaterThanNew:1573 case NewMajorIdGreaterThanOld:1574 break;1575 case IncompatibleMajorIds:1576 return (0);1577 }1578 version = v;1544 { 1545 cmt_string v; 1546 1547 v.read ("version.cmt"); 1548 int pos; 1549 pos = v.find ('\n'); 1550 if (pos != cmt_string::npos) v.erase (pos); 1551 pos = v.find ('\r'); 1552 if (pos != cmt_string::npos) v.erase (pos); 1553 1554 CompareStatus s = compare_versions (version, v); 1555 1556 if (Cmt::get_debug ()) 1557 { 1558 cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl; 1559 } 1560 1561 switch (s) 1562 { 1563 case IdenticalIds: 1564 case ExplicitOldMajorIdWinsAgainstWildarded: 1565 case ExplicitOldMinorIdWinsAgainstWildarded: 1566 case ExplicitOldPatchIdWinsAgainstWildarded: 1567 break; 1568 case ExplicitNewMajorIdWinsAgainstWildarded: 1569 case ExplicitNewMinorIdWinsAgainstWildarded: 1570 case NewMinorIdGreaterThanOld: 1571 case ExplicitNewPatchIdWinsAgainstWildarded: 1572 case NewPatchIdGreaterThanOld: 1573 break; 1574 case OldMajorIdGreaterThanNew: 1575 case NewMajorIdGreaterThanOld: 1576 break; 1577 case IncompatibleMajorIds: 1578 return (0); 1579 } 1580 version = v; 1579 1581 } 1580 1582 else if (version == "") … … 1630 1632 pos = nv.find ('\r'); 1631 1633 if (pos != cmt_string::npos) nv.erase (pos); 1632 1634 1633 1635 if (nv == n_version) 1634 1636 { … … 2301 2303 if (registered != 0) *old_use = registered; 2302 2304 else *old_use = found; 2305 2306 // Should check native_version ! 2307 if (native_version != "" && !do_need_new) 2308 { 2309 2310 if ((*old_use)->native_version != native_version) 2311 { 2312 do_need_new = true; 2313 *old_use = 0; 2314 } 2315 } 2303 2316 } 2304 2317 … … 2314 2327 Use* Use::create (const cmt_string& path, 2315 2328 const cmt_string& package, 2316 const cmt_string& version, 2329 const cmt_string& version, 2317 2330 const cmt_string& version_alias, 2331 const cmt_string& native_version, 2318 2332 const cmt_string& path_alias) 2319 2333 { … … 2339 2353 Use& use_object = instances.add (); 2340 2354 2341 use_object.set (package, version, path, version_alias, path_alias );2355 use_object.set (package, version, path, version_alias, path_alias, native_version); 2342 2356 2343 2357 return (&use_object); … … 2363 2377 2364 2378 Use* old_use = 0; 2365 Use* use = 0;2379 Use* use = 0; 2366 2380 2367 2381 do_need_new = need_new (path, package_name, version, native_version, &old_use, context_use); 2368 //cout <<"native_version: "<<native_version<<" "<<version<<" "<<do_need_new<<endl;2369 2370 2382 2371 2383 if (Cmt::get_debug ()) … … 2382 2394 if (do_need_new) 2383 2395 { 2384 use = create (path, package_name, version, version_alias, path_alias);2396 use = create (path, package_name, version, version_alias, native_version, path_alias); 2385 2397 //cout <<"need_new native_version: "<<native_version<<" "<<version<<" "<<do_need_new<<endl; 2386 2398 } … … 3479 3491 } 3480 3492 3493 Project* Use::get_project () const 3494 { 3495 Project* p; 3496 cmt_string cmtpath = ""; 3497 cmt_string offset = ""; 3498 get_cmtpath_and_offset (cmtpath, offset); 3499 p = Project::find_by_cmtpath (cmtpath); 3500 return p; 3501 } 3502 3481 3503 int Use::get_index () const 3482 3504 { … … 4243 4265 } 4244 4266 4245 4246 4247 4248 4249 4267 /*---------------------------------------------------*/ 4250 4268 Package* Package::find (const cmt_string& name) 4251 4269 { … … 4259 4277 } 4260 4278 4279 /*---------------------------------------------------*/ 4261 4280 Package* Package::add (const cmt_string& name) 4262 4281 { … … 4293 4312 } 4294 4313 4314 /*---------------------------------------------------*/ 4295 4315 Package::PackageVector& Package::packages () 4296 4316 { … … 4301 4321 } 4302 4322 4323 /*---------------------------------------------------*/ 4303 4324 Package::PackageMap& Package::package_map () 4304 4325 { … … 4309 4330 } 4310 4331 4332 /*---------------------------------------------------*/ 4311 4333 void Package::clear_all () 4312 4334 { … … 4318 4340 } 4319 4341 4342 /*---------------------------------------------------*/ 4320 4343 Package::Package () : m_is_cmt (false) 4321 4344 { … … 4326 4349 } 4327 4350 4351 /*---------------------------------------------------*/ 4328 4352 Package::~Package () 4329 4353 { … … 4331 4355 } 4332 4356 4357 /*---------------------------------------------------*/ 4333 4358 const cmt_string& Package::get_name () const 4334 4359 { … … 4336 4361 } 4337 4362 4363 /*---------------------------------------------------*/ 4338 4364 void Package::add_use (Use* use) 4339 4365 { … … 4347 4373 } 4348 4374 4375 /*---------------------------------------------------*/ 4349 4376 void Package::remove_use (Use* use) 4350 4377 { … … 4372 4399 } 4373 4400 4401 /*---------------------------------------------------*/ 4374 4402 Use::UsePtrVector& Package::get_uses () 4375 4403 { … … 4382 4410 } 4383 4411 4412 /*---------------------------------------------------*/ 4384 4413 static void show_packages () 4385 4414 { … … 4418 4447 cout << endl; 4419 4448 } 4420 4449 /*---------------------------------------------------*/ -
CMT/HEAD/source/cmt_use.h
r290 r291 60 60 static void fill_macro_all (cmt_string& buffer, const cmt_string& suffix); 61 61 62 // Private class methods63 private:64 62 static Use* create (const cmt_string& path, 65 63 const cmt_string& package, 66 64 const cmt_string& version, 67 65 const cmt_string& version_alias, 66 const cmt_string& native_version, 68 67 const cmt_string& path_alias); 68 69 70 // Private class methods 71 private: 69 72 70 73 // Public instance methods … … 79 82 const cmt_string& new_path, 80 83 const cmt_string& new_version_alias = "", 81 const cmt_string& new_path_alias = ""); 84 const cmt_string& new_path_alias = "", 85 const cmt_string& native_version = ""); 82 86 void author_action (const CmtSystem::cmt_string_vector& words); 83 87 void manager_action (const CmtSystem::cmt_string_vector& words); … … 116 120 void set_package_name (const cmt_string& name); 117 121 122 Project* get_project () const; 123 118 124 int get_index () const; 119 125 … … 156 162 IgnorePattern::IgnorePatternVector ignore_patterns; 157 163 164 165 UsePtrVector sub_uses; 158 166 // Private methods 159 167 private: … … 191 199 bool m_has_native_version; 192 200 193 UsePtrVector sub_uses; 201 194 202 cmt_vector<ScopeType> sub_use_scopes; 195 203 cmt_vector<State> sub_use_auto_imports;
Note:
See TracChangeset
for help on using the changeset viewer.