- Timestamp:
- Mar 15, 2005, 5:20:10 PM (19 years ago)
- Location:
- CMT/v1r19
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/v1r19/ChangeLog
r15 r16 1 2005-03-15 Christian Arnault <arnault@lal.in2p3.fr> 258 2 3 * source/cmt_parser.cxx (clear): Add m_autoconfigure_cmtpath 4 variable to discard autoconfiguration of CMTPATH during initial 5 phases of the configuration. 6 7 (guess_current_project): Once the current project is known, the 8 CMTPATH is re-generated from the effective knowledge of the 9 project graph. 10 11 (do_setup): Add a check of the configuration when doing cmt setup 12 13 (do_check_configuration): analyze the tags coming from arguments 14 or from CMTSITE to detect mistypings. This is done by checking the 15 effective usage of those tags. 16 17 (configure_cmt_path): Analyze CMTPATH from either the symbol value 18 or from the EV, before asking the project factory to create the 19 projects from it. 20 21 (get_strategy): Add a generic local function to query the strategy elements. 22 23 * source/cmt_project.cxx (add): Manage conflicts between project 24 release requests on a strict basis (no wild card - exact match 25 only) 26 27 * source/cmt_project.h (class ProjectFactory): No longer need m_first and m_previous 28 29 * source/cmt_project.cxx (create_project): Implement a graph of projects. 30 (create_project): Interpret the first top level directory as the project release 31 32 (create_project): Interpret the second top level directory as the 33 project name when it's not defined in the project file. So we 34 don't create a dummy project name anymore Project<n>. 35 36 * source/cmt_commands.cxx (ArgParser): Suppress obsolete +path option 37 (parse): Initialize the m_action value to none to fix a bad management of unknown commands 38 (do_filter): Implement the cmt filter command 39 40 * source/cmt_error.cxx (class Error): Add unknown_command and project_release_conflict errors 41 42 * source/cmt_syntax.cxx (class KwdBuildStrategy): Apply the restructuration of strategy management to strategy decoding 43 (class KwdSetupStrategy): idem 44 (class KwdUse): Support the use statement for project files 45 (SyntaxParser): Support the use statement for project files 46 47 * source/cmt_project.h (class StrategyDef): Create a class to hold the definition of all strategy elements 48 (class Strategy): Create a class to hold the application of a strategy into a project 49 (class StrategyMgr): Create a singleton to manage the strategy definitions 50 (class ProjectFactory): Add parent argument to create_project to handle the project graph 51 (class IProjectVisitor): Create a class to visit the project graph 52 (class Project): Transport all definitions releated with strategies into Strategy objects 53 54 * source/cmt_system.cxx (class CMTPathManager): Add a class to 55 interact with the ProjectFactory to convert CMTPATH specifications 56 into projects 57 58 (get_cmt_paths): Suppress the setting from $CMTPATH. This is 59 replaced by a selective understanding of the source of CMTPATH 60 either from the symbol (when defined in a requirements file) or 61 from the EV. This selection is performed in 62 Cmt::configure_cmt_path. 63 64 (get_cmt_paths): Suppress the definition of a CMTPATH entry for CMT itself 65 1 66 2005-03-10 <arnault@lal.in2p3.fr> 257 2 67 … … 38 103 * source/cmt_tag.cxx (use_operand): Add way of checking internal structure of a tag 39 104 * source/cmt_tag.cxx (use_ref): Add way of checking internal structure of a tag 40 41 105 * source/cmt_tag.h (class Tag): Add way of checking internal structure of a tag 42 43 106 * source/cmt_symbol.h (class Symbol): Add way of checking if a tag is used by symbols. 44 45 107 * source/cmt_symbol.cxx (print): Suppress the "export" action after defining an alias in Sh mode 46 47 108 * source/cmt_project.cxx: Introduce use_action 48 49 109 * source/cmt_syntax.cxx (SyntaxParser): Add support to use statements in project files 50 51 110 * source/cmt_project.cxx (create_project): Add comments 52 111 … … 83 142 2004-12-01 <arnault@lal.in2p3.fr> 247 84 143 85 * source/cmt_version.h (CMTVERSION): Prepare for tagging 20041201144 * source/cmt_version.h (CMTVERSION): Prepare for tagging v1r18p20041201 86 145 87 146 * source/cmt.h (class Cmt): Fix typo -
CMT/v1r19/mgr/cmt
-
Property
svn:executable
set to
*
-
Property
svn:executable
set to
-
CMT/v1r19/source/cmt_parser.cxx
r15 r16 536 536 configure_home (0); 537 537 log << "configure_current_dir" << log_endl; 538 539 540 Me.m_autoconfigure_cmtpath = true; 541 configure_cmt_path (0); 542 Me.m_autoconfigure_cmtpath = false; 543 544 538 545 configure_current_dir (); 539 546 … … 589 596 Me.m_action = action_show_set; 590 597 } 598 } 599 else 600 { 601 s = CmtSystem::getenv ("CMTPATH"); 591 602 } 592 603 … … 3559 3570 void Cmt::do_show_strategies (const ArgParser& /*ap*/) 3560 3571 { 3572 Project::show_specified_strategies_for_all (); 3573 3561 3574 Project* p = Project::get_current (); 3562 3575 … … 3832 3845 } 3833 3846 3834 /** 3835 if current directory is in one of the CMTPATHs, do nothing. 3836 3837 Otherwise, we want to guess the current project => perhaps prepend an item to the CMTPATH?? 3847 /**--------------------------------------------------------- 3848 guess_current_project 3849 3850 if current directory is in one of the CMTPATHs, do nothing. 3851 3852 Otherwise, we want to guess the current project 3838 3853 3839 3854 move up in directories until cmt/project.cmt is found … … 3850 3865 move up 3851 3866 } 3852 3853 3867 */ 3854 3868 void Cmt::guess_current_project () … … 3903 3917 } 3904 3918 3905 cmt_string buffer = "path CMTPATH \n"; 3919 //cmt_string buffer = "path CMTPATH \n"; 3920 cmt_string buffer; 3906 3921 Project::fill_cmtpaths (buffer); 3907 3922 //cerr << "buffer = " << buffer << endl; -
CMT/v1r19/source/cmt_project.cxx
r15 r16 93 93 { 94 94 Project::clear_all (); 95 m_first = 0;96 m_previous = 0;97 m_id = 0;98 95 } 99 96 … … 112 109 CmtSystem::compress_path (compressed_path); 113 110 111 //cerr << "Creating project " << path << " with parent " << ((parent==0)? "0" : parent->get_name ()) << endl; 112 114 113 static Project::ProjectVector& Projects = Project::projects (); 115 114 … … 125 124 p.add_parent (parent); 126 125 parent->add_child (&p); 126 127 // Since p is a new parent, we should propagate the settings UP. 128 129 parent->update_strategies_from_children (); 127 130 } 131 128 132 return (&p); 129 133 } … … 168 172 CmtSystem::dirname (compressed_path, name); 169 173 CmtSystem::basename (name, name); 170 171 /*172 char buffer[20];173 m_id++;174 sprintf (buffer, "Project%d", m_id);175 name = buffer;176 */177 174 } 178 175 } … … 189 186 CmtSystem::dirname (compressed_path, name); 190 187 CmtSystem::basename (name, name); 191 //m_id++;192 //sprintf (buffer, "Project%d", m_id);193 188 } 194 189 } … … 200 195 project->add_parent (parent); 201 196 parent->add_child (project); 197 198 // Since p is a new parent, we should propagate the settings UP. 199 200 parent->update_strategies_from_children (); 202 201 } 203 202 … … 206 205 cmt = project; 207 206 is_current = false; 208 }209 else210 {211 if (m_first == 0)212 {213 m_first = project;214 }215 207 } 216 208 … … 399 391 400 392 Project& project = Projects.add (); 393 project.clear (); 401 394 project.set_name (name); 402 395 project.set_release (release); … … 455 448 } 456 449 450 /*----------------------------------------------------------*/ 451 void Project::show_specified_strategies_for_all () 452 { 453 static ProjectVector& Projects = projects (); 454 455 for (int i = 0; i < Projects.size (); i++) 456 { 457 const Project& project = Projects[i]; 458 project.show_specified_strategies (); 459 } 460 } 461 462 /*----------------------------------------------------------*/ 457 463 class VisitorForShowPaths : public IProjectVisitor 458 464 { … … 850 856 { 851 857 if (p == 0) return; 858 if (p == this) return; 859 860 //cerr << "Adding parent " << p->get_name () << " to " << m_name << endl; 852 861 853 862 int i; … … 878 887 879 888 m_parents.push_back (p); 880 881 // Since p is a new parent, we should propagate the settings UP.882 883 p->update_strategies_from_children ();884 889 } 885 890 … … 888 893 { 889 894 if (p == 0) return; 895 if (p == this) return; 890 896 891 897 int i; … … 954 960 CmtSystem::cmt_string_vector items; 955 961 CmtSystem::split (cmtprojectpath, sep, items); 962 963 bool found = false; 964 956 965 for (int i = 0; i < items.size (); i++) 957 966 { … … 967 976 //cerr << "Project directory " << p << " exists " << endl; 968 977 978 found = true; 979 969 980 IProjectFactory& factory = ProjectFactory::instance (); 970 981 … … 973 984 break; 974 985 } 986 } 987 988 if (!found) 989 { 990 Project* p = Project::find_by_name (name); 991 992 if (p != 0) 993 { 994 found = true; 995 996 p->add_parent (this); 997 add_child (p); 998 999 update_strategies_from_children (); 1000 } 1001 } 1002 1003 if (!found && (cmtprojectpath != "")) 1004 { 1005 cerr << "#CMT> Project " << name << " " << release << " requested by " << m_name << " not found in CMTPROJECTPATH" << endl; 975 1006 } 976 1007 } … … 1056 1087 1057 1088 //---------------------------------------------------------- 1058 void Project::show_strategies () const 1059 { 1089 void Project::show_specified_strategies () const 1090 { 1091 int i; 1092 1093 for (i = 0; i < m_strategies.size (); i++) 1094 { 1095 const Strategy& s = m_strategies[i]; 1096 if (s.m_specified) 1097 { 1098 const StrategyDef* def = s.m_definition; 1099 1100 cout << "# Project " << m_name 1101 << " sets " << def->m_keyword 1102 << " strategy to " << ((s.m_value) ? def->m_on_value : def->m_off_value); 1103 1104 if (s.m_context != "") 1105 { 1106 cout << " (from package " << s.m_context << ")"; 1107 } 1108 1109 cout << endl; 1110 } 1111 } 1060 1112 } 1061 1113 … … 1151 1203 1152 1204 //---------------------------------------------------------- 1153 void Project::set_strategy (const cmt_string& name, const cmt_string& value )1205 void Project::set_strategy (const cmt_string& name, const cmt_string& value, const cmt_string& context) 1154 1206 { 1155 1207 static StrategyMgr& mgr = StrategyMgr::instance (); … … 1178 1230 } 1179 1231 1180 set_strategy (def, b_value );1181 } 1182 1183 //---------------------------------------------------------- 1184 void Project::set_strategy (StrategyDef* definition, bool b_value )1232 set_strategy (def, b_value, context); 1233 } 1234 1235 //---------------------------------------------------------- 1236 void Project::set_strategy (StrategyDef* definition, bool b_value, const cmt_string& context) 1185 1237 { 1186 1238 bool need_strategy = true; … … 1195 1247 // This strategy is already applied in this project. Let's change it's value 1196 1248 s.set (definition, b_value, get_name ()); 1249 if (context != "") 1250 { 1251 if (s.m_context != "") s.m_context += " "; 1252 s.m_context += context; 1253 } 1197 1254 need_strategy = false; 1198 1255 break; … … 1205 1262 1206 1263 Strategy& s = m_strategies.add (); 1264 s.clear (); 1207 1265 s.set (definition, b_value, get_name ()); 1266 s.m_context = context; 1208 1267 } 1209 1268 … … 1227 1286 { 1228 1287 bool need_strategy = true; 1288 bool specified = false; 1229 1289 1230 1290 int i; … … 1235 1295 if (s.m_definition == definition) 1236 1296 { 1237 // This strategy is already applied in this project. Let's change it's value1238 s.update (definition, b_value, get_name ());1239 1297 need_strategy = false; 1298 1299 if (!s.m_specified) 1300 { 1301 // This strategy is already applied in this project. Let's change it's value 1302 s.update (definition, b_value, get_name ()); 1303 } 1304 else 1305 { 1306 specified = true; 1307 } 1240 1308 break; 1241 1309 } … … 1247 1315 1248 1316 Strategy& s = m_strategies.add (); 1317 s.clear (); 1249 1318 s.update (definition, b_value, get_name ()); 1250 1319 } 1251 1252 for (i = 0; i < m_parents.size (); i++)1253 { 1254 Project* project = m_parents[i];1255 1256 if (project->has_strategy (definition)) 1257 { 1320 1321 if (!specified) 1322 { 1323 for (i = 0; i < m_parents.size (); i++) 1324 { 1325 Project* project = m_parents[i]; 1326 1258 1327 project->update_strategy (definition, b_value); 1259 1328 } … … 1271 1340 // If this strategy is specified we don't care what happens from the children 1272 1341 1273 cerr << "Updating strategy " << definition->m_name << " from children for project " << m_name << endl;1342 //cerr << "Updating strategy " << definition->m_name << " from children for project " << m_name << endl; 1274 1343 1275 1344 int i; … … 1286 1355 // There will be no impact since the strategy is specified 1287 1356 1288 cerr << "This strategy is specified in this project" << endl;1357 //cerr << "This strategy is specified in this project" << endl; 1289 1358 return; 1290 1359 } … … 1305 1374 Project* selected = 0; 1306 1375 bool selected_is_specified = false; 1307 bool selected_value = false;1376 bool selected_value = definition->m_default_value; 1308 1377 1309 1378 for (i = 0; i < m_children.size (); i++) … … 1311 1380 Project* p = m_children[i]; 1312 1381 1313 cerr << "Checking strategy for child " << p->get_name () << endl;1382 //cerr << "Checking strategy for child " << p->get_name () << endl; 1314 1383 1315 1384 bool is_specified = p->is_specified (definition); … … 1362 1431 StrategyDef::StrategyDefs& defs = StrategyMgr::get_definitions (); 1363 1432 1364 cerr << "Updating strategies from children for project " << m_name << endl;1433 //cerr << "Updating strategies from children for project " << m_name << endl; 1365 1434 1366 1435 int i; … … 1369 1438 { 1370 1439 StrategyDef* def = defs[i]; 1371 1440 1372 1441 update_strategy_from_children (def); 1442 } 1443 1444 for (i = 0; i < m_parents.size (); i++) 1445 { 1446 Project* p = m_parents[i]; 1447 p->update_strategies_from_children (); 1373 1448 } 1374 1449 } … … 1394 1469 1395 1470 s = new StrategyDef; 1471 s->m_keyword = "build"; 1396 1472 s->m_name = "BuildPrototypes"; 1397 1473 s->m_on_value = "prototypes"; … … 1403 1479 1404 1480 s = new StrategyDef; 1481 s->m_keyword = "build"; 1405 1482 s->m_name = "InstallArea"; 1406 1483 s->m_on_value = "with_installarea"; … … 1412 1489 1413 1490 s = new StrategyDef; 1491 s->m_keyword = "setup"; 1414 1492 s->m_name = "SetupConfig"; 1415 1493 s->m_on_value = "config"; … … 1421 1499 1422 1500 s = new StrategyDef; 1501 s->m_keyword = "setup"; 1423 1502 s->m_name = "SetupRoot"; 1424 1503 s->m_on_value = "root"; … … 1430 1509 1431 1510 s = new StrategyDef; 1511 s->m_keyword = "setup"; 1432 1512 s->m_name = "SetupCleanup"; 1433 1513 s->m_on_value = "cleanup"; … … 1491 1571 } 1492 1572 1573 //----------------------------------------------------------- 1574 Strategy::Strategy () 1575 { 1576 clear (); 1577 } 1578 1579 //----------------------------------------------------------- 1580 void Strategy::clear () 1581 { 1582 m_definition = 0; 1583 m_specified = false; 1584 m_specified_value = false; 1585 m_value = false; 1586 m_on_tag = 0; 1587 m_off_tag = 0; 1588 } 1589 1493 1590 /**---------------------------------------------------------- 1494 1591 Specify a new value for this strategy. … … 1497 1594 void Strategy::set (StrategyDef* definition, bool value, const cmt_string& project_name) 1498 1595 { 1596 //cerr << "Setting strategy " << definition->m_name << " for project " << project_name << " to " << value << endl; 1597 1499 1598 m_definition = definition; 1500 1599 m_specified = true; … … 1511 1610 void Strategy::update (StrategyDef* definition, bool value, const cmt_string& project_name) 1512 1611 { 1612 //cerr << "Updating strategy " << definition->m_name << " for project " << project_name << " to " << value << endl; 1613 1513 1614 m_value = value; 1615 m_definition = definition; 1514 1616 1515 1617 cmt_string to_tag_name = project_name; -
CMT/v1r19/source/cmt_project.h
r15 r16 19 19 typedef cmt_vector <StrategyDef*> StrategyDefs; 20 20 21 cmt_string m_keyword; 21 22 cmt_string m_name; 22 23 cmt_string m_on_value; … … 37 38 Tag* m_on_tag; 38 39 Tag* m_off_tag; 40 cmt_string m_context; 39 41 42 Strategy (); 43 void clear (); 40 44 void set (StrategyDef* definition, bool value, const cmt_string& project_name); 41 45 void update (StrategyDef* definition, bool value, const cmt_string& project_name); … … 67 71 Project* parent); 68 72 69 private:70 Project* m_first;71 Project* m_previous;72 int m_id;73 73 }; 74 74 … … 105 105 static void clear_all (); 106 106 static void show_all (); 107 static void show_specified_strategies_for_all (); 107 108 static void show_paths (); 108 109 static const cmt_string& get_project_file_name (); … … 151 152 152 153 void show (); 153 void show_s trategies () const;154 void show_specified_strategies () const; 154 155 155 156 bool has_strategy (const StrategyDef* definition) const; … … 158 159 bool get_strategy (const cmt_string& name) const; 159 160 void set_default_strategy (const cmt_string& name); 160 void set_strategy (const cmt_string& name, const cmt_string& value );161 void set_strategy (StrategyDef* definition, bool b_value );161 void set_strategy (const cmt_string& name, const cmt_string& value, const cmt_string& context); 162 void set_strategy (StrategyDef* definition, bool b_value, const cmt_string& context); 162 163 void update_strategy (StrategyDef* definition, bool b_value); 163 164 void update_strategy_from_children (StrategyDef* definition); -
CMT/v1r19/source/cmt_syntax.cxx
r15 r16 173 173 if (decode (w, strategy, value)) 174 174 { 175 if (p != 0) p->set_strategy (strategy, value );175 if (p != 0) p->set_strategy (strategy, value, use->get_package_name ()); 176 176 } 177 177 else … … 181 181 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 182 182 } 183 184 if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())185 {186 if (!in_error)187 {188 cerr << "# Package " << use->get_package_name ()189 << " adds " << w << " to build strategy" << endl;190 }191 else192 {193 cerr << "# Error: Package " << use->get_package_name ()194 << " uses unknown " << w << " keyword to build strategy" << endl;195 }196 }197 183 } 198 184 } … … 214 200 if (decode (w, strategy, value)) 215 201 { 216 if (project != 0) project->set_strategy (strategy, value );202 if (project != 0) project->set_strategy (strategy, value, ""); 217 203 } 218 204 else … … 221 207 222 208 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 223 }224 225 if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())226 {227 if (!in_error)228 {229 cerr << "# Project " << project->get_name ()230 << " adds " << w << " to build strategy" << endl;231 }232 else233 {234 cerr << "# Error: Project " << project->get_name ()235 << " uses unknown " << w << " keyword to build strategy" << endl;236 }237 209 } 238 210 } … … 784 756 if (decode (w, strategy, value)) 785 757 { 786 if (p != 0) p->set_strategy (strategy, value );758 if (p != 0) p->set_strategy (strategy, value, use->get_package_name ()); 787 759 } 788 760 else … … 792 764 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 793 765 } 794 795 if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())796 {797 if (!in_error)798 {799 cerr << "# Package " << use->get_package_name ()800 << " adds " << w << " to setup strategy" << endl;801 }802 else803 {804 cerr << "# Error: Package " << use->get_package_name ()805 << " uses unknown " << w << " keyword to setup strategy" << endl;806 }807 }808 766 } 809 767 } … … 825 783 if (decode (w, strategy, value)) 826 784 { 827 if (project != 0) project->set_strategy (strategy, value );785 if (project != 0) project->set_strategy (strategy, value, ""); 828 786 } 829 787 else … … 832 790 833 791 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 834 }835 836 if ((Cmt::get_action () == action_show_strategies) && !Cmt::get_quiet ())837 {838 if (!in_error)839 {840 cerr << "# Project " << project->get_name ()841 << " adds " << w << " to setup strategy" << endl;842 }843 else844 {845 cerr << "# Error: Project " << project->get_name ()846 << " uses unknown " << w << " keyword to setup strategy" << endl;847 }848 792 } 849 793 } -
CMT/v1r19/source/cmt_system.cxx
r11 r16 1477 1477 cmt_string rc_name; 1478 1478 1479 const cmt_string env = CmtSystem::getenv ("CMTPATH");1480 1481 if (env != "")1482 {1483 static cmt_string_vector path_vector;1484 int i;1485 1486 split (env, path_separator (), path_vector);1487 1488 for (i = 0; i < path_vector.size (); i++)1489 {1490 const cmt_string& path = path_vector[i];1491 1492 CMTPathManager::add_cmt_path (path, "${CMTPATH}", factory);1493 }1494 }1495 1496 1479 add_cmt_paths_from_file (".cmtrc", factory); 1497 1480 … … 1516 1499 1517 1500 add_cmt_paths_from_file (rc_name, factory); 1518 1519 // Suppress the definition of a CMTPATH entry for CMT itself1520 //CMTPathManager::add_cmt_path (get_cmt_root (), "default path", factory);1521 1501 1522 1502 CMTPathManager::add_cmt_path (cmt_user_context, "CMTUSERCONTEXT", factory);
Note: See TracChangeset
for help on using the changeset viewer.