- Timestamp:
- Apr 23, 2007, 11:10:18 AM (17 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r397 r400 1 2007-04-23 <arnault@lal.in2p3.fr> 327 2 3 * source/cmt_system.cxx: activate the support to PWD env. var. 4 Start the definition of the new generic class FilePath to store physical and logical file specifications 5 6 2007-04-20 <arnault@lal.in2p3.fr> 327 7 8 * source/cmt_use.cxx: idem 9 * source/cmt_triggers.cxx: idem 10 * source/cmt_tag.cxx: idem 11 * source/cmt_system.cxx: idem 12 * source/cmt_syntax.cxx: idem 13 * source/cmt_symbol.cxx: idem 14 * source/cmt_sequence.cxx: idem 15 * source/cmt_script.cxx: idem 16 * source/cmt_regexp.cxx: idem 17 * source/cmt_project.cxx: idem 18 * source/cmt_pattern.cxx: idem 19 * source/cmt_parser.cxx: idem 20 * source/cmt_model.cxx: idem 21 * source/cmt_log.cxx: idem 22 * source/cmt_lock.cxx: idem 23 * source/cmt_language.cxx: idem 24 * source/cmt_install_area.cxx: idem 25 * source/cmt_group.cxx: idem 26 * source/cmt_generators.cxx: idem 27 * source/cmt_generator.cxx: idem 28 * source/cmt_fragment.cxx: idem 29 * source/cmt_cvs.cxx: idem 30 Send error & warning messages to stderr instead of stdout 31 32 * source/cmt_constituent.cxx: idem 33 * source/cmt_cmtpath_pattern.cxx : idem 34 * source/cmt_branch.cxx : idem 35 * source/cmt_awk.cxx : idem 36 * source/cmt.cxx: formatting text 37 1 38 2007-03-28 Vincent Garonne <garonne@lal.in2p3.fr> 326 2 39 -
CMT/HEAD/mgr/cmt_dependencies.make
r295 r400 1 cmt_cxx_dependencies = ../source/cmt.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_parser.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h2 cmt_awk_cxx_dependencies = ../source/cmt_awk.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_regexp.h ../source/cmt_awk.h ../source/cmt_vector.h ../source/cmt_system.h3 cmt_branch_cxx_dependencies = ../source/cmt_branch.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_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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h4 cmt_constituent_cxx_dependencies = ../source/cmt_constituent.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_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_awk.h ../source/cmt_deps_builder.h ../source/cmt_generator.h ../source/cmt_branch.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_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h5 cmt_deps_builder_cxx_dependencies = ../source/cmt_deps_builder.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_parser.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_deps_builder.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 ../source/cmt_log.h6 cmt_fragment_cxx_dependencies = ../source/cmt_fragment.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_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 ../source/cmt_branch.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h7 cmt_generator_cxx_dependencies = ../source/cmt_generator.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_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_awk.h ../source/cmt_deps_builder.h ../source/cmt_generator.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 ../source/cmt_generators.h8 cmt_include_cxx_dependencies = ../source/cmt_include.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_include.h ../source/cmt_map.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 ../source/cmt_log.h9 cmt_parser_cxx_dependencies = ../source/cmt_parser.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_version.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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_deps_builder.h ../source/cmt_generator.h ../source/cmt_error.h ../source/cmt_cvs.h ../source/cmt_lock.h ../source/cmt_triggers.h ../source/cmt_model.h ../source/cmt_syntax.h ../source/cmt_install_area.h ../source/cmt_sequence.h ../source/cmt_log.h ../source/cmt_commands.h10 cmt_script_cxx_dependencies = ../source/cmt_script.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_script.h ../source/cmt_map.h ../source/cmt_include.h ../source/cmt_pattern.h ../source/cmt_scope_section.h ../source/cmt_use.h11 cmt_string_cxx_dependencies = ../source/cmt_string.cxx ../source/cmt_std.h ../source/cmt_string.h12 cmt_system_cxx_dependencies = ../source/cmt_system.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt_error.h ../source/cmt_map.h13 cmt_tag_cxx_dependencies = ../source/cmt_tag.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_tag.h ../source/cmt_branch.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_symbol.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_log.h14 cmt_use_cxx_dependencies = ../source/cmt_use.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_tag.h ../source/cmt_symbol.h ../source/cmt_error.h ../source/cmt_branch.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_syntax.h15 cmt_symbol_cxx_dependencies = ../source/cmt_symbol.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_tag.h ../source/cmt_symbol.h ../source/cmt_branch.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h16 cmt_error_cxx_dependencies = ../source/cmt_error.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_error.h ../source/cmt_vector.h17 cmt_pattern_cxx_dependencies = ../source/cmt_pattern.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_parser.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.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_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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_error.h ../source/cmt_syntax.h18 cmt_language_cxx_dependencies = ../source/cmt_language.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_fragment.h ../source/cmt_language.h ../source/cmt_branch.h ../source/cmt_group.h ../source/cmt_constituent.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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h19 cmt_cvs_cxx_dependencies = ../source/cmt_cvs.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_parser.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_cvs.h ../source/cmt_awk.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 ../source/cmt_project.h20 cmt_group_cxx_dependencies = ../source/cmt_group.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_group.h ../source/cmt_branch.h ../source/cmt_fragment.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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h21 cmt_database_cxx_dependencies = ../source/cmt_database.cxx ../source/cmt_vector.h ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_parser.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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h22 cmt_lock_cxx_dependencies = ../source/cmt_lock.cxx ../source/cmt_std.h ../source/cmt_lock.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt_error.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_tag.h ../source/cmt_symbol.h23 cmt_triggers_cxx_dependencies = ../source/cmt_triggers.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_triggers.h ../source/cmt_vector.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt_awk.h ../source/cmt_map.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_tag.h ../source/cmt_symbol.h ../source/cmt_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_project.h ../source/cmt_syntax.h24 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.h25 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.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.h27 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.h28 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.h29 cmt_cmtpath_pattern_cxx_dependencies = ../source/cmt_cmtpath_pattern.cxx ../source/cmt_vector.h ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_parser.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_awk.h ../source/cmt_project.h ../source/cmt_cmtpath_pattern.h ../source/cmt_database.h ../source/cmt_syntax.h30 cmt_sequence_cxx_dependencies = ../source/cmt_sequence.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_regexp.h ../source/cmt_awk.h ../source/cmt_sequence.h ../source/cmt_vector.h ../source/cmt_system.h31 cmt_generators_cxx_dependencies = ../source/cmt_generators.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_fragment.h ../source/cmt_group.h ../source/cmt_constituent.h ../source/cmt_language.h ../source/cmt_awk.h ../source/cmt_deps_builder.h ../source/cmt_generator.h ../source/cmt_generators.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 ../source/cmt_log.h32 cmt_scope_section_cxx_dependencies = ../source/cmt_scope_section.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_scope_section.h33 cmt_log_cxx_dependencies = ../source/cmt_log.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_log.h ../source/cmt_vector.h ../source/cmt_parser.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h34 cmt_commands_cxx_dependencies = ../source/cmt_commands.cxx ../source/cmt_std.h ../source/cmt_string.h ../source/cmt_vector.h ../source/cmt_map.h ../source/cmt_parser.h ../source/cmt_regexp.h ../source/cmt_system.h ../source/cmt.h ../source/cmt_commands.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 ../source/cmt_awk.h ../source/cmt_project.h1 cmt_cxx_dependencies = ../source/cmt.cxx 2 cmt_awk_cxx_dependencies = ../source/cmt_awk.cxx 3 cmt_branch_cxx_dependencies = ../source/cmt_branch.cxx 4 cmt_constituent_cxx_dependencies = ../source/cmt_constituent.cxx 5 cmt_deps_builder_cxx_dependencies = ../source/cmt_deps_builder.cxx 6 cmt_fragment_cxx_dependencies = ../source/cmt_fragment.cxx 7 cmt_generator_cxx_dependencies = ../source/cmt_generator.cxx 8 cmt_include_cxx_dependencies = ../source/cmt_include.cxx 9 cmt_parser_cxx_dependencies = ../source/cmt_parser.cxx 10 cmt_script_cxx_dependencies = ../source/cmt_script.cxx 11 cmt_string_cxx_dependencies = ../source/cmt_string.cxx 12 cmt_system_cxx_dependencies = ../source/cmt_system.cxx 13 cmt_tag_cxx_dependencies = ../source/cmt_tag.cxx 14 cmt_use_cxx_dependencies = ../source/cmt_use.cxx 15 cmt_symbol_cxx_dependencies = ../source/cmt_symbol.cxx 16 cmt_error_cxx_dependencies = ../source/cmt_error.cxx 17 cmt_pattern_cxx_dependencies = ../source/cmt_pattern.cxx 18 cmt_language_cxx_dependencies = ../source/cmt_language.cxx 19 cmt_cvs_cxx_dependencies = ../source/cmt_cvs.cxx 20 cmt_group_cxx_dependencies = ../source/cmt_group.cxx 21 cmt_database_cxx_dependencies = ../source/cmt_database.cxx 22 cmt_lock_cxx_dependencies = ../source/cmt_lock.cxx 23 cmt_triggers_cxx_dependencies = ../source/cmt_triggers.cxx 24 cmt_regexp_cxx_dependencies = ../source/cmt_regexp.cxx 25 cmt_model_cxx_dependencies = ../source/cmt_model.cxx 26 cmt_project_cxx_dependencies = ../source/cmt_project.cxx 27 cmt_syntax_cxx_dependencies = ../source/cmt_syntax.cxx 28 cmt_install_area_cxx_dependencies = ../source/cmt_install_area.cxx 29 cmt_cmtpath_pattern_cxx_dependencies = ../source/cmt_cmtpath_pattern.cxx 30 cmt_sequence_cxx_dependencies = ../source/cmt_sequence.cxx 31 cmt_generators_cxx_dependencies = ../source/cmt_generators.cxx 32 cmt_scope_section_cxx_dependencies = ../source/cmt_scope_section.cxx 33 cmt_log_cxx_dependencies = ../source/cmt_log.cxx 34 cmt_commands_cxx_dependencies = ../source/cmt_commands.cxx -
CMT/HEAD/source/cmt.cxx
r389 r400 14 14 /*----------------------------------------------------------*/ 15 15 { 16 //cout << "argc=" << argc << endl;17 16 int status = Cmt::parser (argc, argv); 17 18 18 // Extract the pure status code 19 19 if (status > 255) 20 status = status/256; 20 { 21 status = status/256; 22 } 23 21 24 return (status); 22 25 } -
CMT/HEAD/source/cmt_awk.cxx
r344 r400 18 18 public: 19 19 Parser (Awk* awk, const cmt_string pattern, const cmt_regexp* expression) : 20 m_pattern (pattern), m_expression (expression), m_awk(awk) 20 m_pattern (pattern), m_expression (expression), m_awk(awk) 21 { 22 } 23 24 /** 25 * this first level parsing function extracts individual lines 26 * from the text, taking care of both Unix and Windows EOL styles. 27 * 28 * Then the second level parsing function parse_line is called. 29 */ 30 Awk::condition parse (const cmt_string& text) 31 { 32 Awk::condition result = Awk::ok; 33 34 cmt_string line; 35 int pos; 36 int max_pos; 37 38 pos = 0; 39 max_pos = text.size (); 40 41 m_accumulator.erase (0); 42 43 for (pos = 0; pos < max_pos;) 21 44 { 45 int eol = text.find (pos, '\n'); 46 47 if (eol == cmt_string::npos) 48 { 49 // Last line, since there is no eol at all 50 text.substr (pos, line); 51 pos = max_pos; 52 } 53 else 54 { 55 int length = 1; 56 57 int cr = text.find (pos, "\r\n"); 58 59 if (cr == (eol-1)) 60 { 61 eol = cr; 62 length = 2; 63 } 64 65 if (eol == pos) 66 { 67 // this is an empty line 68 line = ""; 69 pos += length; 70 } 71 else 72 { 73 // The eol was found beyond the current position 74 // (ie. this is a non empty line) 75 text.substr (pos, eol - pos, line); 76 pos = eol + length; 77 } 78 } 79 80 if (m_awk != 0) m_awk->inc_line_number (); 81 82 result = parse_line (line); 83 if (result != Awk::ok) break; 22 84 } 23 85 24 /** 25 * this first level parsing function extracts individual lines 26 * from the text, taking care of both Unix and Windows EOL styles. 27 * 28 * Then the second level parsing function parse_line is called. 29 */ 30 Awk::condition parse (const cmt_string& text) 86 return (result); 87 } 88 89 /** 90 * This second level parsing function accumulates individual lines 91 * with real trailing back slashes. 92 * Eventually the possible text pattern or regular expression is 93 * checked and the Awk::filter function is called in case of 94 * succesful match onto the accumulated line. 95 */ 96 Awk::condition parse_line (const cmt_string& line) 97 { 98 Awk::condition result = Awk::ok; 99 int length; 100 cmt_string temp_line = line; 101 102 // 103 // We scan the line for handling backslashes. 104 // 105 // Really terminating backslashes (ie those only followed by spaces/tabs 106 // mean continued line 107 // 108 // 109 110 bool finished = true; 111 112 length = temp_line.size (); 113 114 if (length == 0) 31 115 { 32 Awk::condition result = Awk::ok; 33 34 cmt_string line; 35 int pos; 36 int max_pos; 37 38 pos = 0; 39 max_pos = text.size (); 40 41 m_accumulator.erase (0); 42 43 for (pos = 0; pos < max_pos;) 44 { 45 int eol = text.find (pos, '\n'); 116 // An empty line following a backslash terminates the continuation. 117 finished = true; 118 } 119 else 120 { 121 int back_slash = temp_line.find_last_of ('\\'); 122 123 if (back_slash != cmt_string::npos) 124 { 125 // 126 // This is the last backslash 127 // check if there are only space chars after it 128 // 46 129 47 if (eol == cmt_string::npos) 48 { 49 // Last line, since there is no eol at all 50 text.substr (pos, line); 51 pos = max_pos; 52 } 53 else 54 { 55 int length = 1; 56 57 int cr = text.find (pos, "\r\n"); 58 59 if (cr == (eol-1)) 60 { 61 eol = cr; 62 length = 2; 63 } 64 65 if (eol == pos) 66 { 67 // this is an empty line 68 line = ""; 69 pos += length; 70 } 71 else 72 { 73 // The eol was found beyond the current position 74 // (ie. this is a non empty line) 75 text.substr (pos, eol - pos, line); 76 pos = eol + length; 77 } 78 } 79 80 if (m_awk != 0) m_awk->inc_line_number (); 81 82 //cout << "parse> line=[" << line << "]" << endl; 83 84 result = parse_line (line); 85 if (result != Awk::ok) break; 86 } 87 88 return (result); 130 bool at_end = true; 131 132 for (int i = (back_slash + 1); i < length; i++) 133 { 134 char c = temp_line[i]; 135 if ((c != ' ') && (c != '\t')) 136 { 137 at_end = false; 138 break; 139 } 140 } 141 142 if (at_end) 143 { 144 temp_line.erase (back_slash); 145 finished = false; 146 } 147 else 148 { 149 // This was not a trailing backslash. 150 finished = true; 151 } 152 } 153 154 m_accumulator += temp_line; 89 155 } 90 156 91 /** 92 * This second level parsing function accumulates individual lines 93 * with real trailing back slashes. 94 * Eventually the possible text pattern or regular expression is 95 * checked and the Awk::filter function is called in case of 96 * succesful match onto the accumulated line. 97 */ 98 Awk::condition parse_line (const cmt_string& line) 157 if (!finished) 99 158 { 100 Awk::condition result = Awk::ok; 101 int length; 102 cmt_string temp_line = line; 103 104 // 105 // We scan the line for handling backslashes. 106 // 107 // Really terminating backslashes (ie those only followed by spaces/tabs 108 // mean continued line 109 // 110 // 111 112 bool finished = true; 113 114 length = temp_line.size (); 115 116 if (length == 0) 117 { 118 // An empty line following a backslash terminates the continuation. 119 finished = true; 120 } 121 else 122 { 123 int back_slash = temp_line.find_last_of ('\\'); 159 // We still need to accumulate forthcoming lines 160 // before parsing the resulting text. 161 return (Awk::ok); 162 } 163 164 // now filter the complete accumulated line (if non empty) 165 166 if (m_accumulator != "") 167 { 168 bool ok = false; 169 170 if (m_expression != 0) 171 { 172 if (m_expression->match (m_accumulator)) 173 { 174 ok = true; 175 } 176 } 177 else 178 { 179 if ((m_pattern == "") || 180 (m_accumulator.find (m_pattern) != cmt_string::npos)) 181 { 182 ok = true; 183 } 184 } 185 186 if (ok && (m_awk != 0)) 187 { 188 m_awk->filter (m_accumulator); 189 result = m_awk->get_last_condition (); 190 } 191 192 m_accumulator.erase (0); 193 } 124 194 125 if (back_slash != cmt_string::npos) 126 { 127 // 128 // This is the last backslash 129 // check if there are only space chars after it 130 // 131 132 bool at_end = true; 133 134 for (int i = (back_slash + 1); i < length; i++) 135 { 136 char c = temp_line[i]; 137 if ((c != ' ') && (c != '\t')) 138 { 139 at_end = false; 140 break; 141 } 142 } 143 144 if (at_end) 145 { 146 temp_line.erase (back_slash); 147 finished = false; 148 } 149 else 150 { 151 // This was not a trailing backslash. 152 finished = true; 153 } 154 } 155 156 m_accumulator += temp_line; 157 } 158 159 //cout << "parse_line1> accumulator=[" << m_accumulator << "]" << endl; 160 //cout << "parse_line1> finished=[" << finished << "]" << endl; 161 162 if (!finished) 163 { 164 // We still need to accumulate forthcoming lines 165 // before parsing the resulting text. 166 return (Awk::ok); 167 } 168 169 // now filter the complete accumulated line (if non empty) 170 171 if (m_accumulator != "") 172 { 173 bool ok = false; 174 175 if (m_expression != 0) 176 { 177 if (m_expression->match (m_accumulator)) 178 { 179 ok = true; 180 } 181 } 182 else 183 { 184 if ((m_pattern == "") || 185 (m_accumulator.find (m_pattern) != cmt_string::npos)) 186 { 187 ok = true; 188 } 189 } 190 191 if (ok && (m_awk != 0)) 192 { 193 //cout << "parse_line> accumulator=[" << m_accumulator << "]" << endl; 194 195 m_awk->filter (m_accumulator); 196 result = m_awk->get_last_condition (); 197 } 198 199 m_accumulator.erase (0); 200 } 201 202 return (result); 203 } 195 return (result); 196 } 204 197 205 198 private: … … 252 245 int nl = text.find (pos, '\n'); 253 246 254 255 256 257 258 259 260 261 262 263 264 265 247 // Get the first end-of-line (either lf or cr-lf) 248 249 //-------------------- 250 // 251 // cr 1 0 252 // nl 253 // 254 // 1 a b 255 // 256 // 0 c d 257 // 258 //-------------------- 266 259 267 260 int first = nl; … … 269 262 if (cr != cmt_string::npos) 270 263 { 271 264 // cases a or c 272 265 273 266 if (nl == cmt_string::npos) 274 267 { 275 268 // case a 276 269 first = cr; 277 270 } 278 271 else 279 272 { 280 273 // case c 281 274 first = (nl < cr) ? nl : cr; 282 275 } … … 285 278 if (first == cmt_string::npos) 286 279 { 287 280 // This is likely the last line since there is no end-of-line 288 281 text.substr (pos, line); 289 282 pos = max_pos; … … 291 284 else if (first > pos) 292 285 { 293 294 286 // The eol was found beyond the current position 287 // (ie. this is a non empty line) 295 288 text.substr (pos, first - pos, line); 296 289 pos = first + 1; … … 298 291 else 299 292 { 300 293 // an empty line 301 294 line = ""; 302 295 pos++; … … 337 330 if (m_condition != ok) return (m_condition); 338 331 339 340 if (CmtSystem::testenv ("CMTTESTAWK"))341 { 342 } 343 else344 { 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 } 404 332 /* 333 if (CmtSystem::testenv ("CMTTESTAWK")) 334 { 335 } 336 else 337 { 338 cmt_string line; 339 int pos = 0; 340 int max_pos; 341 342 max_pos = text.size (); 343 344 for (pos = 0; pos < max_pos;) 345 { 346 int cr = text.find (pos, "\r\n"); 347 int nl = text.find (pos, '\n'); 348 349 // Get the first end-of-line (either lf or cr-lf) 350 351 int first = nl; 352 353 if (cr != cmt_string::npos) 354 { 355 if (nl == cmt_string::npos) 356 { 357 first = cr; 358 } 359 else 360 { 361 first = (nl < cr) ? nl : cr; 362 } 363 } 364 365 if (first == cmt_string::npos) 366 { 367 // This is likely the last line since there is no end-of-line 368 text.substr (pos, line); 369 pos = max_pos; 370 } 371 else if (first > pos) 372 { 373 // The eol was found beyond the current position 374 // (ie. this is a non empty line) 375 text.substr (pos, first - pos, line); 376 pos = first + 1; 377 } 378 else 379 { 380 // an empty line 381 line = ""; 382 pos++; 383 } 384 385 m_line_number++; 386 387 if (line != "") 388 { 389 if (expression.match (line)) 390 { 391 filter (line); 392 if (m_condition != ok) return (m_condition); 393 } 394 } 395 } 396 } 397 */ 405 398 406 399 end (); … … 441 434 void Awk::filter (const cmt_string& /*line*/) 442 435 { 443 //cout << "awk> " << line << endl;444 436 } 445 437 … … 612 604 if (level > 10) 613 605 { 614 //cout << "#PathScanner::scan_path> too deep search path=" << path << endl;615 606 return; 616 607 } … … 652 643 CmtSystem::basename (here, entry); 653 644 CmtSystem::dirname (path, where); 654 655 //cout << "## here=" << here << " entry=" << entry << " where=" << where << endl;656 645 657 646 if ((level == 0) && (entry == "InstallArea")) continue; … … 674 663 version = entry; 675 664 CmtSystem::basename (path, name); 676 677 //cout << "#1" << endl;678 665 679 666 a.run (name, version, where); … … 719 706 pos = version.find ('\r'); 720 707 if (pos != cmt_string::npos) version.erase (pos); 721 722 //cout << "#2" << endl;723 708 724 709 a.run (entry, version, path, true); … … 755 740 // The structure is without the version directory. 756 741 757 //cout << "#3" << endl;758 759 742 a.run (name, "v1", path); 760 743 has_package = true; … … 771 754 { 772 755 // The structure is with the version directory. 773 774 //cout << "#4" << endl;775 756 776 757 a.run (name, version, where); … … 796 777 if (CmtSystem::is_version_directory (version)) 797 778 { 798 //cout << "#5" << endl;799 800 779 a.run (entry, version, where); 801 780 has_package = true; … … 814 793 where += entry; 815 794 816 //cout << "#6" << endl;817 818 795 a.run (name, "v1", where); 819 796 has_package = true; … … 826 803 // 827 804 // Here this is a non-package directory. Let's search further down 828 //cout << "#7" << endl;829 805 830 806 scan_path (here, level + 1, a); … … 845 821 p += e; 846 822 847 848 /*849 for (int j = 1; j < _level; j++) cout << " ";850 cout << "Restarting scan_path on p=" << p << endl;851 852 853 cout << "#PathScanner::scan_path> Restarting scan_path on p=" << p << endl;854 */855 856 823 scan_path (p, 1, a); 857 824 } … … 907 874 if (CmtSystem::test_file (req)) 908 875 { 909 //cout << " -> no version" << endl;910 911 876 cmt_string req; 912 877 … … 930 895 } 931 896 932 cout << package << " " << version << " " << path << endl;933 934 897 result = true; 935 898 } … … 947 910 if (CmtSystem::test_file (req)) 948 911 { 949 //cout << " -> cmt" << endl;950 951 912 cout << package << " " << version << " " << path << endl; 952 913 … … 955 916 else 956 917 { 957 //cout << " -> no cmt" << endl;958 959 918 req = name; 960 919 req += CmtSystem::file_separator (); … … 965 924 if (CmtSystem::test_file (req)) 966 925 { 967 //cout << " -> mgr" << endl;968 969 926 cout << package << " " << version << " " << path << endl; 970 927 … … 973 930 else 974 931 { 975 //cout << " -> no mgr" << endl;976 932 } 977 933 } … … 979 935 else 980 936 { 981 //cout << " -> stop" << endl;982 937 } 983 938 } -
CMT/HEAD/source/cmt_branch.cxx
r11 r400 21 21 /*----------------------------------------------------------*/ 22 22 void Branch::action (const CmtSystem::cmt_string_vector& words) 23 /*----------------------------------------------------------*/23 /*----------------------------------------------------------*/ 24 24 { 25 25 for (int i = 1; i < words.size (); i++) … … 34 34 /*----------------------------------------------------------*/ 35 35 Branch* Branch::find (const cmt_string& name) 36 /*----------------------------------------------------------*/36 /*----------------------------------------------------------*/ 37 37 { 38 38 static BranchVector& Branches = branches (); … … 59 59 /*----------------------------------------------------------*/ 60 60 void Branch::add (const cmt_string& name) 61 /*----------------------------------------------------------*/61 /*----------------------------------------------------------*/ 62 62 { 63 63 static BranchVector& Branches = branches (); … … 77 77 /*----------------------------------------------------------*/ 78 78 void Branch::print_all (PrintMode mode) 79 /*----------------------------------------------------------*/79 /*----------------------------------------------------------*/ 80 80 { 81 81 static BranchVector& Branches = branches (); … … 93 93 /*----------------------------------------------------------*/ 94 94 void Branch::clear_all () 95 /*----------------------------------------------------------*/95 /*----------------------------------------------------------*/ 96 96 { 97 97 static BranchVector& Branches = branches (); … … 111 111 /*----------------------------------------------------------*/ 112 112 Branch::BranchVector& Branch::branches () 113 /*----------------------------------------------------------*/113 /*----------------------------------------------------------*/ 114 114 { 115 115 static Database& db = Database::instance (); … … 121 121 /*----------------------------------------------------------*/ 122 122 Branch::Branch () 123 /*----------------------------------------------------------*/123 /*----------------------------------------------------------*/ 124 124 { 125 125 } … … 127 127 /*----------------------------------------------------------*/ 128 128 Branch::~Branch () 129 /*----------------------------------------------------------*/129 /*----------------------------------------------------------*/ 130 130 { 131 131 } … … 133 133 /*----------------------------------------------------------*/ 134 134 const cmt_string& Branch::name () const 135 /*----------------------------------------------------------*/135 /*----------------------------------------------------------*/ 136 136 { 137 137 return (m_name); … … 140 140 /*----------------------------------------------------------*/ 141 141 void Branch::print (PrintMode mode) const 142 /*----------------------------------------------------------*/142 /*----------------------------------------------------------*/ 143 143 { 144 144 cout << m_name; -
CMT/HEAD/source/cmt_cmtpath_pattern.cxx
r283 r400 19 19 if (words.size () < 1) return; 20 20 21 22 23 24 25 26 27 28 29 30 21 // 22 // expected syntax is: 23 // 24 // cmtpath_pattern any-cmt-statement 25 // 26 // where any-cmt-statement may contain the "template" 27 // 28 // <path> 29 // <project> 30 // 31 31 32 32 add (words, use, revert); … … 51 51 int first_word = 1; 52 52 53 54 55 53 // 54 // Install the cmt-statement as a vector of words. 55 // 56 56 for (int i = first_word; i < words.size (); i++) 57 57 { -
CMT/HEAD/source/cmt_constituent.cxx
r363 r400 121 121 public: 122 122 typedef enum 123 {124 ready,125 need_include126 } states;123 { 124 ready, 125 need_include 126 } states; 127 127 128 128 constituents_action_iterator (Constituent& c) : m_constituent (c) … … 178 178 if (m_constituent.type == Library) 179 179 { 180 180 //m_constituent.build_triggers = true; 181 181 } 182 182 } … … 212 212 else if (w.substr (0, 8) == "-import=") 213 213 { 214 215 216 217 218 219 220 221 222 223 224 225 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 } 226 226 } 227 227 else if (w.substr (0, 7) == "-group=") … … 246 246 else if (w.substr (0, 1) == "-") 247 247 { 248 249 250 251 252 253 248 //if (!Cmt::get_quiet ()) 249 //{ 250 cerr << "#CMT> Warning: bad option " 251 << w << " in constituent " << m_constituent.name << endl; 252 //CmtError::set (CmtError::execution_error, cmd); 253 //} 254 254 } 255 255 else if ((equal = w.find ("=")) != cmt_string::npos) … … 576 576 switch (type) 577 577 { 578 579 580 581 582 583 584 585 586 578 case Library: 579 cout << "library"; 580 break; 581 case Application: 582 cout << "application"; 583 break; 584 case Document: 585 cout << "document " << generator; 586 break; 587 587 } 588 588 -
CMT/HEAD/source/cmt_cvs.cxx
r295 r400 17 17 /** 18 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 19 Grep : perform a grep like operation onto a cmt_string 20 21 o All lines of the input string are collected when they contain 22 the specified pattern. 23 o The input string and the selector pattern are specified in 24 the constructor: 25 26 Grep (input_string, pattern) 27 28 o All selected lines are accumulated (appended) into the internal 29 variable m_result . 'space' is the separator. 30 31 o The accumulator is retrieved by the result () method. 32 33 */ 34 34 class Grep : public Awk 35 35 { … … 46 46 /** 47 47 48 49 50 51 52 53 54 55 56 57 48 Cut : perform a cut-like operation : 49 50 o collect the <field>'th field of every line into the m_result 51 internal variable 52 53 o the field number is given in the constructor and starts at zero. 54 55 o selected fields are accumulated with a space as separator. 56 57 */ 58 58 class Cut : public Awk 59 59 { … … 244 244 /** 245 245 Filter out the space-separated words of a text that don't match a regexp. 246 246 */ 247 247 void filter_list (cmt_string& text, const cmt_regexp& exp) 248 248 { … … 272 272 if (m_verbose || m_simulation) 273 273 { 274 c out<< "#CMT> Executing [" << command << "]" << endl;274 cerr << "#CMT> Executing [" << command << "]" << endl; 275 275 } 276 276 … … 296 296 retry++; 297 297 298 c out<< "# " << message << ": status=" << status << endl;299 c out<< "#---------------------------------------------------------" << endl;298 cerr << "# " << message << ": status=" << status << endl; 299 cerr << "#---------------------------------------------------------" << endl; 300 300 301 301 if (retry > 5) exit(0); … … 314 314 if (m_verbose || m_simulation) 315 315 { 316 c out<< "#CMT> Executing [" << command << "]" << endl;316 cerr << "#CMT> Executing [" << command << "]" << endl; 317 317 } 318 318 … … 325 325 //if (m_verbose || m_simulation) 326 326 // { 327 // c out<< out << endl;327 // cerr << out << endl; 328 328 // } 329 329 330 return (status); 330 331 } … … 350 351 351 352 In simulation mode we suppose the expected protocol has been found. 352 353 */ 353 354 bool check_protocol () 354 355 { … … 403 404 if (found) 404 405 { 405 c out<< "#CMT> Protocol level " << m_protocol_level << endl;406 cerr << "#CMT> Protocol level " << m_protocol_level << endl; 406 407 } 407 408 else 408 409 { 409 c out<< "#CMT> The CVS pluggin is not installed or is not at protocol level " << m_protocol_level << endl;410 cerr << "#CMT> The CVS pluggin is not installed or is not at protocol level " << m_protocol_level << endl; 410 411 } 411 412 } … … 420 421 We create a temporary directory just to lauch the command. However nothing 421 422 should change in this temporary directory since the pluggin returns an error status. 422 423 */ 423 424 void retreive_cvs_infos (const cmt_string& module) 424 425 { … … 456 457 if (!CmtSystem::mkdir (tmp_dir)) 457 458 { 458 c out<< "#CMT> Cannot create the temporary directory [" << tmp_dir << "]" << endl;459 cerr << "#CMT> Cannot create the temporary directory [" << tmp_dir << "]" << endl; 459 460 return; 460 461 } … … 465 466 if (!CmtSystem::cd (tmp_dir)) 466 467 { 467 c out<< "#CMT> Cannot move to the temporary directory " << tmp_dir << endl;468 cerr << "#CMT> Cannot move to the temporary directory " << tmp_dir << endl; 468 469 469 470 if (m_verbose) 470 471 { 471 c out<< "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl;472 cerr << "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl; 472 473 } 473 474 … … 479 480 if (m_verbose) 480 481 { 481 c out<< "#CMT> cvs infos are now obtained from the temporary directory " << CmtSystem::pwd () << endl;482 cerr << "#CMT> cvs infos are now obtained from the temporary directory " << CmtSystem::pwd () << endl; 482 483 } 483 484 484 485 /** 485 486 The script associated to such entries is supposed to : 486 487 488 489 487 1) extract the set of <infos> from ${module}/cmt/requirements 488 or ${module}/cmt/project.cmt 489 2) build an output of the form : 490 <infos>=info1 info2 info3 ... 490 491 491 492 Currently this script can be found in … … 535 536 if (m_verbose) 536 537 { 537 c out<< "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl;538 cerr << "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl; 538 539 } 539 540 … … 549 550 the script named cmt_buildcvsinfos2.sh (referenced in the loginfo script) 550 551 551 552 This script performs a scan in the CVS repository for the following types of 552 553 information : 553 554 554 555 556 557 558 559 560 561 562 563 564 565 555 the recognized structure below this module (none, project, package) 556 all top symbolic tags installed for the module 557 all symbolic tags installed for the module 558 all branches available below this module 559 all subpackages installed below the module. 560 all subprojects installed below the module. 561 562 In principle, only modules corresponding to true CMT products (packages or projects) are considered. 563 o tags are obtained from the requirements or the project file 564 o branches are sub-directories which are not themselves packages 565 o subpackages are sub-directories which are CMT packages 566 (a subdirectory is always either a branch or a subpackage) 566 567 */ 567 568 void get_cvs_infos_with_offset (const cmt_string& module) … … 569 570 if (!check_protocol ()) 570 571 { 571 c out<< "#CMT> The CVS pluggin is not installed or is not at protocol level " << m_protocol_level << endl;572 cerr << "#CMT> The CVS pluggin is not installed or is not at protocol level " << m_protocol_level << endl; 572 573 return; 573 574 } … … 575 576 if (module == "") 576 577 { 577 c out<< "#CMT> cmt cvs needs a module name" << endl;578 cerr << "#CMT> cmt cvs needs a module name" << endl; 578 579 return; 579 580 } … … 583 584 if (m_verbose) 584 585 { 585 c out<< "#CMT> cvs infos for module " << module << " already there" << endl;586 cerr << "#CMT> cvs infos for module " << module << " already there" << endl; 586 587 } 587 588 } … … 712 713 from the answr of the CVS pluggin. 713 714 The pattern is a regexp but it may also contain the <package> template 714 715 */ 715 716 cmt_string tag_filter = CmtSystem::getenv ("CMTCVSTAGFILTER"); 716 717 … … 758 759 matching a given regular expression. 759 760 760 761 762 763 761 o The first matching tag is returned into 'version' 762 o Success is returned as function value. 763 764 */ 764 765 bool match_version_request (const cmt_string& text, 765 766 const cmt_regexp& version_exp, … … 835 836 if (m_verbose) 836 837 { 837 cout<< "#CMT> requesting cvs infos onto module " << module << endl;838 cerr << "#CMT> requesting cvs infos onto module " << module << endl; 838 839 } 839 840 … … 843 844 { 844 845 versions = ""; 845 c out<< "#CMT> Product " << product << " not found in ${CVSROOT}" << endl;846 cerr << "#CMT> Product " << product << " not found in ${CVSROOT}" << endl; 846 847 return (false); 847 848 } … … 927 928 bool do_need_version () 928 929 { 929 930 bool need_version = false; 930 931 931 932 if (structure_info == "project") 932 {933 934 935 936 937 938 939 940 941 942 943 // cout<<"need version"<<need_version<<endl;944 933 { 934 need_version = true; 935 //CmtStructuringStyle style = Cmt::get_current_structuring_style (); 936 //if (style == default_structuring_style) 937 //{ 938 // Use& current_use = Use::current (); 939 // if (current_use.get_strategy ("VersionDirectory")) 940 // need_version = true; 941 //} 942 //else if (style == with_version_directory) 943 // need_version = true; 944 // cerr<<"need version"<<need_version<<endl; 945 } 945 946 else 946 947 { 947 948 949 950 951 952 953 954 955 948 CmtStructuringStyle style = Cmt::get_current_structuring_style (); 949 if (style == default_structuring_style) 950 { 951 Use& current_use = Use::current (); 952 if (current_use.get_strategy ("VersionDirectory")) 953 need_version = true; 954 } 955 else if (style == with_version_directory) 956 need_version = true; 956 957 } 957 958 … … 961 962 /** 962 963 Take care of structuring style for packages and of project vs package conventions 963 964 */ 964 965 cmt_string build_version_directory (const cmt_string& offset, 965 966 const cmt_string& product, … … 994 995 /** 995 996 Wrapper to mkdir handling simulation and verbose options. 996 997 */ 997 998 bool mkdir (const cmt_string& dir) 998 999 { 999 1000 if (m_simulation) 1000 1001 { 1001 c out<< "#CMT> Would create the " << dir << " directory" << endl;1002 cerr << "#CMT> Would create the " << dir << " directory" << endl; 1002 1003 } 1003 1004 else … … 1007 1008 if (m_verbose) 1008 1009 { 1009 c out<< "#CMT> About to mkdir " << dir << endl;1010 cerr << "#CMT> About to mkdir " << dir << endl; 1010 1011 } 1011 1012 … … 1013 1014 if (!CmtSystem::cd (dir)) 1014 1015 { 1015 c out<< "# Error creating the directory :" << dir << endl;1016 c out<< "#---------------------------------------------------------" << endl;1016 cerr << "# Error creating the directory :" << dir << endl; 1017 cerr << "#---------------------------------------------------------" << endl; 1017 1018 return (false); 1018 1019 } … … 1026 1027 package context. Thus it's likely that CMTPATH are not completely defined. 1027 1028 This function manually prepends CMTPATH entries to the environment variable. 1028 1029 */ 1029 1030 void add_cmtpath (const cmt_string& dir) 1030 1031 { … … 1044 1045 if (m_verbose) 1045 1046 { 1046 c out<< "#CMT> CMTPATH=" << CmtSystem::getenv ("CMTPATH") << endl;1047 cerr << "#CMT> CMTPATH=" << CmtSystem::getenv ("CMTPATH") << endl; 1047 1048 } 1048 1049 } … … 1050 1051 /** 1051 1052 Specific checkout of one project 1052 1053 */ 1053 1054 bool really_checkout_project_contents (const cmt_string& offset, 1054 1055 const cmt_string& project, … … 1062 1063 cmt_string dir = currentdir; 1063 1064 1064 c out<< " # get project files into " << dir << endl;1065 cerr << " # get project files into " << dir << endl; 1065 1066 1066 1067 … … 1096 1097 if the top directory of a product is empty. (In this case the 1097 1098 co -l results in nothing) 1098 1099 */ 1099 1100 void make_management_files (const cmt_string& module, 1100 1101 const cmt_string& entries_text) … … 1126 1127 if (m_simulation) 1127 1128 { 1128 c out<< "#CMT> Would fill in the CVS/Root file with " << endl;1129 c out<< s << endl;1129 cerr << "#CMT> Would fill in the CVS/Root file with " << endl; 1130 cerr << s << endl; 1130 1131 } 1131 1132 else … … 1133 1134 if (m_verbose) 1134 1135 { 1135 c out<< "#CMT> Fill in the CVS/Root file with " << endl;1136 c out<< s << endl;1136 cerr << "#CMT> Fill in the CVS/Root file with " << endl; 1137 cerr << s << endl; 1137 1138 } 1138 1139 s.write (f); … … 1159 1160 if (m_simulation) 1160 1161 { 1161 c out<< "#CMT> Would fill in the CVS/Repository file with " << endl;1162 c out<< s << endl;1162 cerr << "#CMT> Would fill in the CVS/Repository file with " << endl; 1163 cerr << s << endl; 1163 1164 } 1164 1165 else … … 1166 1167 if (m_verbose) 1167 1168 { 1168 c out<< "#CMT> Fill in the CVS/Repository file with " << endl;1169 c out<< s << endl;1169 cerr << "#CMT> Fill in the CVS/Repository file with " << endl; 1170 cerr << s << endl; 1170 1171 } 1171 1172 s.write (f); … … 1175 1176 if (m_simulation) 1176 1177 { 1177 c out<< "#CMT> Would write the top CVS/Entries file with " << endl;1178 c out<< entries_text << endl;1178 cerr << "#CMT> Would write the top CVS/Entries file with " << endl; 1179 cerr << entries_text << endl; 1179 1180 } 1180 1181 else … … 1198 1199 if (m_verbose) 1199 1200 { 1200 c out<< "#CMT> Fill in the top CVS/Entries file with " << endl;1201 c out<< text << endl;1201 cerr << "#CMT> Fill in the top CVS/Entries file with " << endl; 1202 cerr << text << endl; 1202 1203 } 1203 1204 … … 1214 1215 3) build the CVS/Entries file for subdirs and co individual subdirs 1215 1216 4) write the CVS management files if CVS did not do it. 1216 1217 */ 1217 1218 bool really_checkout_package_contents (const cmt_string& offset, 1218 1219 const cmt_string& package, … … 1225 1226 cmt_string dir = currentdir; 1226 1227 1227 c out<< " # get top files " << endl;1228 cerr << " # get top files " << endl; 1228 1229 1229 1230 cmt_string command = "cvs -f -Q co -l "; … … 1258 1259 if (need_version) 1259 1260 { 1260 1261 1262 1261 if (!mkdir (version)) return (false); 1262 dir += CmtSystem::file_separator (); 1263 dir += version; 1263 1264 } 1264 1265 else … … 1272 1273 if (m_verbose) 1273 1274 { 1274 c out<< "#CMT> Now getting subdirectories pwd=" << CmtSystem::pwd () << " dir=" << dir << endl;1275 cerr << "#CMT> Now getting subdirectories pwd=" << CmtSystem::pwd () << " dir=" << dir << endl; 1275 1276 } 1276 1277 … … 1279 1280 if (branches == "") 1280 1281 { 1281 1282 branches = branches_info; 1282 1283 } 1283 1284 … … 1292 1293 if (!CmtSystem::test_directory ("CVS")) 1293 1294 { 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1295 int i; 1296 for (i = 0; i < branch_vector.size (); i++) 1297 { 1298 cmt_string& branch = branch_vector[i]; 1299 if (i > 0) 1300 { 1301 command += CmtSystem::command_separator (); 1302 } 1303 1304 command += "cvs -f -Q co "; 1305 1306 if (!at_head) 1307 { 1308 command += "-r "; 1309 command += version; 1310 } 1311 1312 command += " -d "; 1313 command += branch; 1314 command += " "; 1315 command += module; 1316 command += "/"; // CVS uses the '/' notation on all platforms!! 1317 command += branch; 1318 1319 text += "D/"; 1320 text += branch; 1321 text += "////\n"; 1322 } 1322 1323 execute_and_retry (command, "Error getting package contents"); 1323 1324 … … 1325 1326 1326 1327 if (need_touch_files) 1327 1328 1329 c out<< "# --> udapte the file timestamps" << endl;1328 { 1329 1330 cerr << "# --> udapte the file timestamps" << endl; 1330 1331 for (i = 0; i < branch_vector.size (); i++) 1331 1332 1332 { 1333 cmt_string& branch = branch_vector[i]; 1333 1334 CmtSystem::cmt_string_vector& list = CmtSystem::scan_dir (branch); 1334 1335 int j; 1335 1336 for (j = 0; j < list.size (); j++) 1336 1337 1338 1339 1337 if (CmtSystem::test_file(list[j])) 1338 CmtSystem::touch_file (list[j]); 1339 } 1340 } 1340 1341 return (true); 1341 1342 } … … 1353 1354 for (i = 0; i < branch_vector.size (); i++) 1354 1355 { 1355 1356 1357 1358 1359 1360 1356 cmt_string& branch = branch_vector[i]; 1357 if (branch != "CVS") 1358 { 1359 command += " "; 1360 command += branch; 1361 } 1361 1362 } 1362 1363 … … 1368 1369 1369 1370 if (need_touch_files) 1370 {1371 1372 c out<< "# --> udapte the file timestamps" << endl;1371 { 1372 1373 cerr << "# --> udapte the file timestamps" << endl; 1373 1374 for (i = 0; i < branch_vector.size (); i++) 1374 1375 1375 { 1376 cmt_string& branch = branch_vector[i]; 1376 1377 CmtSystem::cmt_string_vector& list = CmtSystem::scan_dir (branch); 1377 1378 int j; 1378 1379 for (j = 0; j < list.size (); j++) 1379 1380 1381 1382 }1380 if (CmtSystem::test_file(list[j])) 1381 CmtSystem::touch_file (list[j]); 1382 } 1383 } 1383 1384 return (true); 1384 1385 } … … 1386 1387 /** 1387 1388 Effective checkout of a package or a project 1388 1389 */ 1389 1390 bool really_checkout (const cmt_string& offset, 1390 1391 const cmt_string& product, … … 1398 1399 cmt_string out; 1399 1400 1400 c out<< "# ================= working on " << structure_info << " " << product1401 cerr << "# ================= working on " << structure_info << " " << product 1401 1402 << " version " << version; 1402 1403 1403 if (at_head) c out<< " (At head) ";1404 if (at_head) cerr << " (At head) "; 1404 1405 1405 1406 cmt_string full_offset; … … 1416 1417 } 1417 1418 1418 c out<< echo_ppath << " in " << dir << endl;1419 cerr << echo_ppath << " in " << dir << endl; 1419 1420 1420 1421 if (do_need_version ()) … … 1457 1458 FME is first converted into a RE then a directory search is performed. 1458 1459 An empty string is returned if no match is found. 1459 1460 */ 1460 1461 cmt_string find_matching_version (const cmt_string& expression) 1461 1462 { … … 1562 1563 add_cmtpath (here); 1563 1564 1564 c out<< " # --> now getting project packages from the " << container << " " << here << endl;1565 cerr << " # --> now getting project packages from the " << container << " " << here << endl; 1565 1566 1566 1567 CmtSystem::cd (here); … … 1582 1583 Check whether a given directory structure matches an expected product structure 1583 1584 given by the structure info obtained from the most recent request to the CVS pluggin 1584 1585 */ 1585 1586 bool check_structure (const cmt_string& dir, const cmt_string& version) 1586 1587 { … … 1588 1589 if (!CmtSystem::test_directory (dir)) 1589 1590 { 1590 1591 return (false); 1591 1592 } 1592 1593 … … 1604 1605 if (CmtSystem::test_file (file_name)) 1605 1606 { 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 //cout<<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl;1617 1618 1619 1620 1607 if (!do_need_version ()) 1608 { 1609 // open the version.cmt file and compare the version 1610 cmt_string current_version; 1611 cmt_string version_file = dir; 1612 version_file += CmtSystem::file_separator (); 1613 version_file += "CVS"; 1614 version_file += CmtSystem::file_separator (); 1615 version_file += "Tag"; 1616 current_version.read (version_file); 1617 //cerr <<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl; 1618 return current_version=="N"+version+"\n"; 1619 } 1620 else 1621 result = true; 1621 1622 } 1622 1623 else … … 1631 1632 if (CmtSystem::test_file (file_name)) 1632 1633 { 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 //cout<<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl;1644 1645 1634 if (!do_need_version ()) 1635 { 1636 // open the version.cmt file and compare the version 1637 cmt_string current_version; 1638 cmt_string version_file = dir; 1639 version_file += CmtSystem::file_separator (); 1640 version_file += "CVS"; 1641 version_file += CmtSystem::file_separator (); 1642 version_file += "Tag"; 1643 current_version.read (version_file); 1644 //cerr <<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl; 1645 return current_version=="N"+version+"\n"; 1646 } 1646 1647 else 1647 1648 result = true; 1648 1649 } 1649 1650 } … … 1663 1664 result = true; 1664 1665 } 1665 }1666 } 1666 1667 1667 1668 return (result); … … 1678 1679 - the version directory 1679 1680 - the CVS tag 1680 1681 */ 1681 1682 void do_checkout_phase2 (const cmt_string& offset, 1682 1683 const cmt_string& product, … … 1686 1687 if (m_verbose) 1687 1688 { 1688 c out<< "#CMT> do_checkout_phase2> offset=" << offset1689 cerr << "#CMT> do_checkout_phase2> offset=" << offset 1689 1690 << " " << structure_info << "=" << product 1690 1691 << " specified_version=" << specified_version … … 1711 1712 if (version == "") 1712 1713 { 1713 c out<< "# ================= No version specified for " << structure_info << " " << product << endl;1714 cerr << "# ================= No version specified for " << structure_info << " " << product << endl; 1714 1715 return; 1715 1716 } … … 1731 1732 cmt_string effective_version = ""; 1732 1733 if (do_need_version ()) 1733 {1734 1735 1736 1734 { 1735 /* Important this part should be enhanced ASAP 1736 and deal with many other cases.... arghhhh !! 1737 */ 1737 1738 effective_version = find_matching_version (dir); 1738 }1739 } 1739 1740 1740 1741 … … 1762 1763 if (cvs_tag.find ("*") != cmt_string::npos) 1763 1764 { 1764 c out<< "# ================= " << structure_info << " " << product1765 cerr << "# ================= " << structure_info << " " << product 1765 1766 << " version " << cvs_tag << echo_ppath 1766 1767 << " has wild cards and will not be considered." << endl; … … 1801 1802 if (check_structure (dir, version)) 1802 1803 { 1803 cout<< "# ================= " << structure_info << " " << product1804 1805 1806 1804 cerr << "# ================= " << structure_info << " " << product 1805 << " version " << version << echo_ppath 1806 << " already installed." << endl; 1807 recursive = false; 1807 1808 } 1808 1809 else … … 1814 1815 if (!really_checkout (offset, product, version, cvs_tag, module, dir, at_head)) 1815 1816 { 1816 c out<< "# bad return from really_checkout_product" << endl;1817 cerr << "# bad return from really_checkout_product" << endl; 1817 1818 return; 1818 1819 } … … 1825 1826 if (m_simulation) 1826 1827 { 1827 c out<< "#CMT> " << structure_info << " directory not really created " << dir << endl;1828 cerr << "#CMT> " << structure_info << " directory not really created " << dir << endl; 1828 1829 } 1829 1830 else if (structure_info == "package") … … 1831 1832 if (!CmtSystem::cd (dir)) 1832 1833 { 1833 c out<< "#CMT> Package directory not created " << dir << endl;1834 cerr << "#CMT> Package directory not created " << dir << endl; 1834 1835 return; 1835 1836 } … … 1870 1871 else 1871 1872 { 1872 c out<< "# " << product << " not a CMT package" << endl;1873 cerr << "# " << product << " not a CMT package" << endl; 1873 1874 return; 1874 1875 } … … 1885 1886 if (did_recurse) 1886 1887 { 1887 1888 1888 if (no_config==false) 1889 execute ("cmt -quiet broadcast cmt -quiet config"); 1889 1890 1890 1891 } 1891 1892 else 1892 1893 { 1893 1894 1894 if (no_config==false) 1895 execute ("cmt -quiet config"); 1895 1896 } 1896 1897 } … … 1898 1899 { 1899 1900 if (no_config==false) 1900 1901 execute ("cmt -quiet config"); 1901 1902 } 1902 1903 } … … 1906 1907 if (m_verbose) 1907 1908 { 1908 c out<< "#CMT> dir=" << dir << endl;1909 cerr << "#CMT> dir=" << dir << endl; 1909 1910 } 1910 1911 1911 1912 if (!CmtSystem::cd (dir)) 1912 1913 { 1913 c out<< "#CMT> Project directory not created " << dir << endl;1914 cerr << "#CMT> Project directory not created " << dir << endl; 1914 1915 return; 1915 1916 } … … 1923 1924 if (!CmtSystem::test_file (file_name)) 1924 1925 { 1925 c out<< "# " << product << " not a CMT project" << endl;1926 cerr << "# " << product << " not a CMT project" << endl; 1926 1927 return; 1927 1928 } … … 1932 1933 } 1933 1934 1934 c out<< "# ================= Project " << product << " completed" << endl;1935 cerr << "# ================= Project " << product << " completed" << endl; 1935 1936 1936 1937 } … … 1946 1947 o perform the cmt config for packages. 1947 1948 1948 1949 */ 1949 1950 void do_checkout_phase1 (const cmt_string& module, 1950 1951 const cmt_string& version_dir, … … 1961 1962 if (m_verbose) 1962 1963 { 1963 c out<< "#CMT> Missing module name" << endl;1964 cerr << "#CMT> Missing module name" << endl; 1964 1965 } 1965 1966 return; … … 1980 1981 if (error_info != "") 1981 1982 { 1982 c out<< error_info << endl;1983 cerr << error_info << endl; 1983 1984 return; 1984 1985 } … … 2022 2023 if (m_verbose) 2023 2024 { 2024 c out<< "#CMT> about to checkout " << structure_info2025 cerr << "#CMT> about to checkout " << structure_info 2025 2026 << " " << product << " version " << version << " into " << top_dir << endl; 2026 2027 } … … 2043 2044 if (!CmtSystem::test_file (file_name)) 2044 2045 { 2045 c out<< "# " << product << " was not properly checked out and is missing its cmt/project.cmt file" << endl;2046 cerr << "# " << product << " was not properly checked out and is missing its cmt/project.cmt file" << endl; 2046 2047 return; 2047 2048 } … … 2075 2076 else 2076 2077 { 2077 c out<< "# " << product << " was not properly checked out and is missing its cmt/requirements file" << endl;2078 cerr << "# " << product << " was not properly checked out and is missing its cmt/requirements file" << endl; 2078 2079 return; 2079 2080 } … … 2082 2083 if (m_verbose) 2083 2084 { 2084 c out<< "#CMT> product " << product << " has been checked out" << endl;2085 cerr << "#CMT> product " << product << " has been checked out" << endl; 2085 2086 } 2086 2087 2087 2088 if (!m_recursive) 2088 2089 { 2089 2090 2090 if (no_config==false) 2091 execute ("cmt -quiet config"); 2091 2092 } 2092 2093 } … … 2095 2096 void help () 2096 2097 { 2097 c out<< "> cd <some work area>" << endl;2098 c out<< "> cmt checkout [modifier ...] <package|project>" << endl;2099 c out<< "" << endl;2100 c out<< " modifier :" << endl;2101 c out<< " -l Do not process used packages (default)." << endl;2102 c out<< " -R Process used products recursively." << endl;2103 c out<< " -r rev Check out version tag. (is sticky)" << endl;2104 c out<< " -vd dir Use this version directory instead of CVS tag." << endl;2105 c out<< " -d dir Check out into dir instead of module name." << endl;2106 c out<< " -o offset Offset in the CVS repository" << endl;2107 c out<< " -requirements <requirements file path> Check out packages referenced in this requirements file" << endl;2108 c out<< " -t Change file timestamps to the date of checkout" << endl;2109 c out<< " -n simulation mode on" << endl;2110 c out<< " -no_config Disable config step after checkout" << endl;2111 c out<< " -v verbose mode on" << endl;2112 c out<< " --help print this help" << endl;2113 c out<< "" << endl;2114 c out<< "> cmt cvstags <package|project>" << endl;2115 c out<< "> cmt cvssubpackages <directory>" << endl;2116 c out<< "> cmt cvssubprojects <directory>" << endl;2117 c out<< "" << endl;2098 cerr << "> cd <some work area>" << endl; 2099 cerr << "> cmt checkout [modifier ...] <package|project>" << endl; 2100 cerr << "" << endl; 2101 cerr << " modifier :" << endl; 2102 cerr << " -l Do not process used packages (default)." << endl; 2103 cerr << " -R Process used products recursively." << endl; 2104 cerr << " -r rev Check out version tag. (is sticky)" << endl; 2105 cerr << " -vd dir Use this version directory instead of CVS tag." << endl; 2106 cerr << " -d dir Check out into dir instead of module name." << endl; 2107 cerr << " -o offset Offset in the CVS repository" << endl; 2108 cerr << " -requirements <requirements file path> Check out packages referenced in this requirements file" << endl; 2109 cerr << " -t Change file timestamps to the date of checkout" << endl; 2110 cerr << " -n simulation mode on" << endl; 2111 cerr << " -no_config Disable config step after checkout" << endl; 2112 cerr << " -v verbose mode on" << endl; 2113 cerr << " --help print this help" << endl; 2114 cerr << "" << endl; 2115 cerr << "> cmt cvstags <package|project>" << endl; 2116 cerr << "> cmt cvssubpackages <directory>" << endl; 2117 cerr << "> cmt cvssubprojects <directory>" << endl; 2118 cerr << "" << endl; 2118 2119 } 2119 2120 … … 2121 2122 Implementation of the cmt cvstags 2122 2123 Get the CVS tags of a module 2123 2124 */ 2124 2125 void tags (const CmtSystem::cmt_string_vector& arguments) 2125 2126 { … … 2132 2133 if (CmtSystem::getenv ("CVSROOT") == "") 2133 2134 { 2134 c out<< "# Please set CVSROOT first !" << endl;2135 cerr << "# Please set CVSROOT first !" << endl; 2135 2136 return; 2136 2137 } … … 2159 2160 if (error_info != "") 2160 2161 { 2161 c out<< error_info << endl;2162 cerr << error_info << endl; 2162 2163 } 2163 2164 else … … 2184 2185 { 2185 2186 const cmt_string& s = v[i]; 2186 c out<< s << endl;2187 cerr << s << endl; 2187 2188 } 2188 2189 } … … 2194 2195 Implementation of the cmt cvsbranches 2195 2196 Get the subdirs of a module that are not subackages 2196 2197 */ 2197 2198 void branches (const cmt_string& module) 2198 2199 { … … 2203 2204 if (error_info != "") 2204 2205 { 2205 c out<< error_info << endl;2206 cerr << error_info << endl; 2206 2207 } 2207 2208 else 2208 2209 { 2209 c out<< branches_info << endl;2210 cerr << branches_info << endl; 2210 2211 } 2211 2212 } … … 2214 2215 Implementation of the cmt cvssubpackages 2215 2216 Get the subdirs of a module that ARE CMT subpackages 2216 2217 */ 2217 2218 void subpackages (const cmt_string& module) 2218 2219 { … … 2223 2224 if (error_info != "") 2224 2225 { 2225 c out<< error_info << endl;2226 cerr << error_info << endl; 2226 2227 } 2227 2228 else 2228 2229 { 2229 c out<< subpackages_info << endl;2230 cerr << subpackages_info << endl; 2230 2231 } 2231 2232 } … … 2234 2235 Implementation of the cmt cvssubrojects 2235 2236 Get the subdirs of a module that ARE CMT projects 2236 2237 */ 2237 2238 void subprojects (const cmt_string& module) 2238 2239 { … … 2243 2244 if (error_info != "") 2244 2245 { 2245 c out<< error_info << endl;2246 cerr << error_info << endl; 2246 2247 } 2247 2248 else 2248 2249 { 2249 c out<< subprojects_info << endl;2250 cerr << subprojects_info << endl; 2250 2251 } 2251 2252 } … … 2255 2256 Parse the arguments 2256 2257 Then call do_checkout for each argument 2257 2258 */ 2258 2259 void checkout (const CmtSystem::cmt_string_vector& arguments) 2259 2260 { … … 2266 2267 if (CmtSystem::getenv ("CVSROOT") == "") 2267 2268 { 2268 c out<< "# Please set CVSROOT first !" << endl;2269 cerr << "# Please set CVSROOT first !" << endl; 2269 2270 return; 2270 2271 } … … 2350 2351 } 2351 2352 else if (option == "-t") 2352 {2353 2354 }2353 { 2354 need_touch_files = true; 2355 } 2355 2356 else if (option == "-l") 2356 2357 { … … 2376 2377 else if (option == "-no_config") 2377 2378 { 2378 2379 no_config = true; 2379 2380 } 2380 2381 else if (option == "-v") … … 2445 2446 void Grep::filter (const cmt_string& line) 2446 2447 { 2447 //if (CmtSystem::testenv ("CMTTESTAWK")) cout<< "Grep::filter" << endl;2448 //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "Grep::filter" << endl; 2448 2449 2449 2450 if (m_result != "") m_result += " "; … … 2465 2466 void Cut::begin () 2466 2467 { 2467 //if (CmtSystem::testenv ("CMTTESTAWK")) cout<< "Cut::begin" << endl;2468 //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "Cut::begin" << endl; 2468 2469 m_result = ""; 2469 2470 } … … 2471 2472 void Cut::filter (const cmt_string& line) 2472 2473 { 2473 //if (CmtSystem::testenv ("CMTTESTAWK")) cout<< "Cut::filter" << endl;2474 //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "Cut::filter" << endl; 2474 2475 2475 2476 static CmtSystem::cmt_string_vector words; … … 2534 2535 void RecursivePass1::filter (const cmt_string& line) 2535 2536 { 2536 //if (CmtSystem::testenv ("CMTTESTAWK")) cout<< "RecursivePass1::filter> "2537 2537 //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "RecursivePass1::filter> " 2538 // << "line=[" << line << "]" << endl; 2538 2539 2539 2540 if (line.find ("use CMT") != cmt_string::npos) return; … … 2549 2550 2550 2551 enum 2551 {2552 need_package,2553 need_version,2554 need_path,2555 no_need2556 } state = need_package;2552 { 2553 need_package, 2554 need_version, 2555 need_path, 2556 no_need 2557 } state = need_package; 2557 2558 2558 2559 cmt_string package; … … 2568 2569 switch (state) 2569 2570 { 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2571 case need_package: 2572 package = s; 2573 state = need_version; 2574 break; 2575 case need_version: 2576 version = s; 2577 state = need_path; 2578 break; 2579 case need_path: 2580 path = s; 2581 state = no_need; 2582 break; 2582 2583 } 2583 2584 } … … 2585 2586 if (version.find ("*") != cmt_string::npos) 2586 2587 { 2587 2588 cout<< "# ================= Package " << package2589 2590 2591 2588 /* 2589 cerr << "# ================= Package " << package 2590 << " version " << version << " " << path 2591 << " has wild cards and will not be considered." << endl; 2592 */ 2592 2593 return; 2593 2594 } … … 2604 2605 { 2605 2606 m_first = false; 2606 c out<< " # --> now propagate cmt checkout to :" << endl;2607 cerr << " # --> now propagate cmt checkout to :" << endl; 2607 2608 } 2608 2609 2609 c out<< " # " << package << " " << version << " " << path << endl;2610 cerr << " # " << package << " " << version << " " << path << endl; 2610 2611 } 2611 2612 … … 2627 2628 void RecursivePass2::filter (const cmt_string& line) 2628 2629 { 2629 //if (CmtSystem::testenv ("CMTTESTAWK")) cout<< "RecursivePass2::filter> "2630 2630 //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "RecursivePass2::filter> " 2631 // << "line=[" << line << "]" << endl; 2631 2632 2632 2633 /** … … 2647 2648 2648 2649 enum 2649 {2650 need_package,2651 need_version,2652 need_path,2653 no_need2654 } state = need_package;2650 { 2651 need_package, 2652 need_version, 2653 need_path, 2654 no_need 2655 } state = need_package; 2655 2656 2656 2657 cmt_string package; … … 2666 2667 switch (state) 2667 2668 { 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2669 case need_package: 2670 package = s; 2671 state = need_version; 2672 break; 2673 case need_version: 2674 version = s; 2675 state = need_path; 2676 break; 2677 case need_path: 2678 path = s; 2679 state = no_need; 2680 break; 2680 2681 } 2681 2682 } … … 2683 2684 if (version.find ("*") != cmt_string::npos) 2684 2685 { 2685 2686 cout<< "# ================= Package " << package2687 2688 2689 2686 /* 2687 cerr << "# ================= Package " << package 2688 << " version " << version << " " << path 2689 << " has wild cards and will not be considered." << endl; 2690 */ 2690 2691 } 2691 2692 else … … 2715 2716 2716 2717 enum 2717 {2718 need_project,2719 need_version,2720 need_tag,2721 no_need2722 } state = need_project;2718 { 2719 need_project, 2720 need_version, 2721 need_tag, 2722 no_need 2723 } state = need_project; 2723 2724 2724 2725 cmt_string project; … … 2732 2733 switch (state) 2733 2734 { 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2735 case need_project: 2736 project = s; 2737 state = need_version; 2738 break; 2739 case need_version: 2740 version = s; 2741 state = need_tag; 2742 break; 2743 case need_tag: 2744 tag = s; 2745 state = no_need; 2746 break; 2746 2747 } 2747 2748 } … … 2749 2750 if (version.find ("*") != cmt_string::npos) 2750 2751 { 2751 2752 cout<< "# ================= Project " << project2753 2754 2755 2752 /* 2753 cerr << "# ================= Project " << project 2754 << " version " << version << " " << path 2755 << " has wild cards and will not be considered." << endl; 2756 */ 2756 2757 return; 2757 2758 } … … 2768 2769 { 2769 2770 m_first = false; 2770 c out<< " # --> now propagate cmt checkout to :" << endl;2771 cerr << " # --> now propagate cmt checkout to :" << endl; 2771 2772 } 2772 2773 2773 c out<< " # " << project << " " << version << " " << tag << endl;2774 cerr << " # " << project << " " << version << " " << tag << endl; 2774 2775 } 2775 2776 … … 2791 2792 void RecursivePass4::filter (const cmt_string& line) 2792 2793 { 2793 //if (CmtSystem::testenv ("CMTTESTAWK")) cout<< "RecursivePass4::filter> "2794 2794 //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "RecursivePass4::filter> " 2795 // << "line=[" << line << "]" << endl; 2795 2796 2796 2797 /** … … 2811 2812 2812 2813 enum 2813 {2814 need_project,2815 need_version,2816 need_tag,2817 no_need2818 } state = need_project;2814 { 2815 need_project, 2816 need_version, 2817 need_tag, 2818 no_need 2819 } state = need_project; 2819 2820 2820 2821 cmt_string project; … … 2828 2829 switch (state) 2829 2830 { 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2831 case need_project: 2832 project = s; 2833 state = need_version; 2834 break; 2835 case need_version: 2836 version = s; 2837 state = need_tag; 2838 break; 2839 case need_tag: 2840 tag = s; 2841 state = no_need; 2842 break; 2842 2843 } 2843 2844 } … … 2845 2846 if (version.find ("*") != cmt_string::npos) 2846 2847 { 2847 2848 cout<< "# ================= Project " << project2849 2850 2851 2848 /* 2849 cerr << "# ================= Project " << project 2850 << " version " << version 2851 << " has wild cards and will not be considered." << endl; 2852 */ 2852 2853 } 2853 2854 else -
CMT/HEAD/source/cmt_deps_builder.cxx
r399 r400 18 18 // 19 19 enum state_def 20 {21 at_start, // beginning of the file22 in_line, // along a line23 in_string, // inside a quoted string24 in_char, // inside a quoted char25 in_comment, // inside a multi-line comment26 in_string_comment, // inside a quoted string in a comment27 in_char_comment, // inside a quoted char in a comment28 in_line_comment // inside a single-line comment29 };20 { 21 at_start, // beginning of the file 22 in_line, // along a line 23 in_string, // inside a quoted string 24 in_char, // inside a quoted char 25 in_comment, // inside a multi-line comment 26 in_string_comment, // inside a quoted string in a comment 27 in_char_comment, // inside a quoted char in a comment 28 in_line_comment // inside a single-line comment 29 }; 30 30 31 31 //-------------------------------------------------- … … 122 122 // To ignore leading spaces and tabs 123 123 while ( (*ptr == ' ') || (*ptr == '\t')) 124 {125 ptr++;126 }124 { 125 ptr++; 126 } 127 127 128 128 if (*ptr == '#') … … 246 246 Any line with no header inclusion 247 247 step through comments and strings 248 248 */ 249 249 static char* in_line_action (char* ptr, state_def& state) 250 250 { … … 304 304 if (pos == 0) 305 305 { 306 307 308 306 // This string is not finished till the end of the line.. 307 // we expect it to continue to the next line... 308 // thus we leave the state as it is 309 309 ptr += strlen (ptr); 310 310 } … … 333 333 if (pos == 0) 334 334 { 335 336 337 335 // This string is not finished till the end of the line.. 336 // we expect it continues to the nex line... 337 // thus we leave the state as it is 338 338 ptr += strlen (ptr); 339 339 } … … 362 362 363 363 364 364 /* 365 365 Even if we are inside a comment, we must detect strings since comment markers may 366 366 be written inside them. 367 367 368 pos = strchr (ptr, '"');369 370 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\'))371 { 372 373 374 375 } 376 377 pos = strchr (ptr, '\'');378 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\'))379 { 380 381 382 383 } 384 */368 pos = strchr (ptr, '"'); 369 370 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\')) 371 { 372 state = in_string_comment; 373 pattern = pos; 374 length = 1; 375 } 376 377 pos = strchr (ptr, '\''); 378 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\')) 379 { 380 state = in_char_comment; 381 pattern = pos; 382 length = 1; 383 } 384 */ 385 385 pos = strstr (ptr, "*/"); 386 386 if ((pos != 0) && (pos < pattern)) … … 402 402 if (pos == 0) 403 403 { 404 405 404 // This string is not finished till the end of the line.. 405 // we expect it continues to the nex line... 406 406 ptr += strlen (ptr); 407 407 } … … 428 428 if (pos == 0) 429 429 { 430 431 430 // This string is not finished till the end of the line.. 431 // we expect it continues to the nex line... 432 432 ptr += strlen (ptr); 433 433 } … … 453 453 { 454 454 char * pos = strchr (ptr, '\\'); 455 /* Extend this part to deal with continuation character */455 /* Extend this part to deal with continuation character */ 456 456 if ( (pos == NULL) || ( (ptr + strlen(ptr)-1)!=pos )) 457 {457 { 458 458 state = in_line; 459 }459 } 460 460 461 461 ptr += strlen (ptr); … … 489 489 char* last = text + max_pos; 490 490 while (current < last) 491 {491 { 492 492 493 char* crnl = strstr (current, " /r\n");494 char* nl = strstr (current, "\ \\n");493 char* crnl = strstr (current, "\r\n"); 494 char* nl = strstr (current, "\n"); 495 495 496 496 if ( (crnl==0) && (nl ==0)) break; … … 500 500 char * ptr = 0; 501 501 if (nl==0) //crnl > 0 502 503 504 505 502 { 503 length = 3; 504 ptr = crnl; 505 } 506 506 else if (crnl==0) //nl > 0 507 508 509 510 507 { 508 length = 2; 509 ptr = nl; 510 } 511 511 else if (crnl < nl) 512 513 514 515 512 { 513 length = 3; 514 ptr = crnl; 515 } 516 516 else // (crnl > nl) 517 518 519 520 517 { 518 length = 2; 519 ptr = nl; 520 } 521 521 strcpy (ptr, ptr+length); 522 522 current = ptr; 523 523 last -= length; 524 }524 } 525 525 526 526 pos = 0; … … 575 575 { 576 576 // neither nl nor cr+nl found => this is the last line 577 577 marker_pos = 0; 578 578 } 579 579 else 580 580 { 581 581 marker_pos = first; 582 583 582 marker = *marker_pos; 583 *marker_pos = 0; 584 584 } 585 585 … … 658 658 << dir_name << log_endl; 659 659 660 661 662 660 // 661 // Return 0 when the file is found in the current directory 662 // 663 663 if (CmtSystem::test_file (name)) 664 664 { … … 682 682 full_name += name; 683 683 684 685 686 687 684 // 685 // Return 1 when the file is found in the directory of the 686 // upper level source file 687 // 688 688 if (CmtSystem::test_file (full_name)) 689 689 { … … 703 703 int path_index = -1; 704 704 705 706 707 708 705 // 706 // Return [path_index + 2] when the include file is found at one of 707 // the include_paths 708 // 709 709 for (path_index = 0; path_index < include_paths.size (); path_index++) 710 710 { … … 862 862 if (preprocessor == "") 863 863 { 864 865 866 867 864 // 865 // Since no preprocessor command is defined, 866 // we use the internal mechanism provided here. 867 // 868 868 cmt_string new_dir; 869 869 … … 880 880 else 881 881 { 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 882 // 883 // An external preprocessor command is defined. We expect it 884 // to follow a "standard" syntax for its output, ie: 885 // o It starts with: 886 // <module>.o: ... 887 // o There may be many lines with trailing back-slashes 888 // o All entries are space-separated 889 // o One of the entries is the source file name itself 890 // 891 // The preprocessor command expects the list of -I options 892 // (resolved from the "includes" macro) and the list of 893 // -D/-U options (resolved from the "*_pp_*flags" macros) 894 // 895 896 // 897 // Building the complete command (still the pp_*flags are 898 // missing) 899 // 900 900 preprocessor += " "; 901 901 macro = Symbol::find ("includes"); … … 908 908 CmtSystem::execute (preprocessor, output); 909 909 910 911 912 910 // 911 // Make the output as one single big line. 912 // 913 913 914 914 output.replace_all ("\n", " "); … … 919 919 CmtSystem::split (output, " \t", files); 920 920 921 922 923 921 // 922 // Analyze each entry 923 // 924 924 925 925 for (int i = 1; i < files.size (); i++) … … 934 934 CmtSystem::dirname (file, dir); 935 935 936 937 938 939 936 // 937 // Only declared include_paths will be taken into account 938 // Others are considered as system include paths. 939 // 940 940 941 941 for (int j = 0; j < m_include_paths.size (); j++) … … 948 948 full_name += name; 949 949 950 951 952 953 950 // 951 // We add in the "m_deps" list the symbolic form 952 // of the path rather that the expanded one. 953 // 954 954 955 955 m_deps.push_back (full_name); -
CMT/HEAD/source/cmt_fragment.cxx
r11 r400 137 137 if (fragment == 0) 138 138 { 139 c out<< "Fragment " << name << " not found" << endl;139 cerr << "Fragment " << name << " not found" << endl; 140 140 } 141 141 else … … 719 719 // Macro found 720 720 cmt_string value = macro->resolve_macro_value (); 721 //cout << "resolve_macro_value2> value=" << value << endl; 721 722 722 out.replace_all (pattern, value); 723 723 … … 730 730 // Macro not found. Look for env. variable 731 731 cmt_string value = CmtSystem::getenv (macro_name); 732 //cout << "resolve_macro_value3> " << macro_name << "=" << value << endl; 732 733 733 out.replace_all (pattern, value); 734 734 … … 983 983 // Macro found 984 984 cmt_string value = macro->resolve_macro_value (); 985 //cout << "resolve_macro_value2> value=" << value << endl;986 985 out.replace_all (pattern, value); 987 986 … … 994 993 // Macro not found. Look for env. variable 995 994 cmt_string value = CmtSystem::getenv (macro_name); 996 //cout << "resolve_macro_value3> " << macro_name << "=" << value << endl;997 995 out.replace_all (pattern, value); 998 996 -
CMT/HEAD/source/cmt_generator.cxx
r185 r400 306 306 fclose (m_output_file); 307 307 308 308 //--- Complete the operation -------------- 309 309 310 310 commit (m_output_file_name); … … 502 502 } 503 503 504 505 506 507 508 509 510 511 512 513 514 515 516 504 /** 505 506 We have to treat patterns of the form *.xxx (ie with a 507 suffix) thus we filter out everything that could have been 508 collected with a different suffix because the 509 CmtSystem::scan_dir function only handles patterns of the 510 form xxx* (ie with trailing *) 511 512 [If the original suffix was empty (ie files specified using 513 xx*) this means getting files without any dot-suffix. This 514 may be incorrect??] 515 516 */ 517 517 518 518 for (int j = 0; j < files.size (); j++) … … 746 746 { 747 747 public : 748 749 750 751 748 WinDefAwk (const cmt_string& library_name) 749 { 750 m_name = library_name; 751 } 752 752 753 753 void begin () 754 755 756 757 754 { 755 cout << "LIBRARY " << m_name << endl; 756 cout << "EXPORTS" << endl; 757 } 758 758 759 759 void filter (const cmt_string& line) 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 760 { 761 if (line.find ("External") == cmt_string::npos) return; 762 if (line.find ("??_") != cmt_string::npos) 763 { 764 if (line.find ("operator/=") == cmt_string::npos) return; 765 // Keep operator /= . 766 } 767 768 CmtSystem::cmt_string_vector words; 769 CmtSystem::split (line, " \t", words); 770 if (words.size () >= 7) 771 { 772 int pos = 7; 773 774 cmt_string& fifth_word = words[4]; 775 if (fifth_word == "()") pos = 7; 776 else if (fifth_word == "External") pos = 6; 777 else return; 778 779 cmt_string& symbol = words[pos]; 780 if (symbol[0] == '_') symbol.erase (0, 1); 781 symbol.replace_all ("\r", ""); 782 symbol.replace_all ("\n", ""); 783 784 if ((pos == 6) && 785 ((line.find(": static") != cmt_string::npos) || 786 (line.find("(class") != cmt_string::npos)) ) 787 { 788 // static data members are not DATA : 789 // extern objects are not DATA : 790 cout << " " << symbol << " " << endl; 791 } 792 else if (pos == 6) 793 { 794 // DATA : 795 cout << " " << symbol << "\tDATA" << endl; 796 } 797 else 798 { 799 // code : 800 cout << " " << symbol << " " << endl; 801 } 802 } 803 } 804 804 805 805 void end () 806 807 806 { 807 } 808 808 809 809 private: -
CMT/HEAD/source/cmt_generators.cxx
r197 r400 99 99 { 100 100 cout << "CmtGenerator::analyze_file> constituent=" << 101 102 101 constituent.name << 102 " file=" << file << endl; 103 103 } 104 104 … … 144 144 145 145 if (CmtSystem::getenv("STRUCTURED_OUTPUT")!="" || Cmt::build_nmake ()) 146 146 { 147 147 obj += m_CONSTITUENT; 148 148 obj += CmtSystem::file_separator (); 149 149 } 150 150 151 151 obj += name; … … 170 170 else 171 171 { 172 //cout << "#CMT> analyze_file file=" << file << " no language" << endl;173 174 172 if (m_LINKMACRO == "java") 175 173 { … … 197 195 { 198 196 cout << "CmtGenerator::analyze_file> constituent=" << 199 200 197 constituent.name << 198 " obj=" << obj << endl; 201 199 } 202 200 … … 517 515 518 516 make_header_fragment.copy (m_output_file, constituent.variables, 8, 519 517 &m_TITLE, 520 518 &m_CONSTITUENT, 521 519 &m_CONSTITUENTSUFFIX, 522 520 &m_USER, 523 521 &m_DATE, 524 522 &m_PACKAGE, 525 526 523 &m_HASTARGETTAG, 524 &m_STRUCTURED_OUTPUT 527 525 ); 528 526 … … 2542 2540 public: 2543 2541 DependencyFilter () 2542 { 2543 } 2544 2545 void begin () 2546 { 2547 m_sources = ""; 2548 } 2549 2550 void filter (const cmt_string& line) 2551 { 2552 int pos = line.find ("_dependencies = "); 2553 if (pos == cmt_string::npos) return; 2554 2555 cmt_string s = line; 2556 s.erase (pos); 2557 2558 m_sources += " "; 2559 m_sources += s; 2560 m_sources += " "; 2561 2562 //pos = s.find_last_of ("_"); 2563 //if (pos != cmt_string::npos) s[pos] = "." 2564 } 2565 2566 void add_source (const cmt_string& file_name) 2567 { 2568 static cmt_string suffix; 2569 static cmt_string name; 2570 2571 CmtSystem::get_dot_suffix (file_name, suffix); 2572 CmtSystem::basename (file_name, suffix, name); 2573 CmtSystem::get_suffix (file_name, suffix); 2574 2575 cmt_string s = " "; 2576 s += name; 2577 s += "_"; 2578 s += suffix; 2579 s += " "; 2580 2581 if (m_sources.find (s) == cmt_string::npos) 2544 2582 { 2583 m_sources += s; 2584 } 2585 } 2586 2587 bool has_source (const cmt_string& file_name) const 2588 { 2589 static cmt_string suffix; 2590 static cmt_string name; 2591 2592 CmtSystem::get_dot_suffix (file_name, suffix); 2593 CmtSystem::basename (file_name, suffix, name); 2594 CmtSystem::get_suffix (file_name, suffix); 2595 2596 cmt_string s = " "; 2597 s += name; 2598 s += "_"; 2599 s += suffix; 2600 s += " "; 2601 2602 if (m_sources.find (s) == cmt_string::npos) 2603 { 2604 return (false); 2545 2605 } 2546 2547 void begin () 2606 else 2548 2607 { 2549 m_sources = "";2608 return (true); 2550 2609 } 2551 2552 void filter (const cmt_string& line) 2553 { 2554 int pos = line.find ("_dependencies = "); 2555 if (pos == cmt_string::npos) return; 2556 2557 cmt_string s = line; 2558 s.erase (pos); 2559 2560 m_sources += " "; 2561 m_sources += s; 2562 m_sources += " "; 2563 2564 //pos = s.find_last_of ("_"); 2565 //if (pos != cmt_string::npos) s[pos] = "." 2566 } 2567 2568 void add_source (const cmt_string& file_name) 2569 { 2570 static cmt_string suffix; 2571 static cmt_string name; 2572 2573 CmtSystem::get_dot_suffix (file_name, suffix); 2574 CmtSystem::basename (file_name, suffix, name); 2575 CmtSystem::get_suffix (file_name, suffix); 2576 2577 cmt_string s = " "; 2578 s += name; 2579 s += "_"; 2580 s += suffix; 2581 s += " "; 2582 2583 if (m_sources.find (s) == cmt_string::npos) 2584 { 2585 m_sources += s; 2586 } 2587 } 2588 2589 bool has_source (const cmt_string& file_name) const 2590 { 2591 static cmt_string suffix; 2592 static cmt_string name; 2593 2594 CmtSystem::get_dot_suffix (file_name, suffix); 2595 CmtSystem::basename (file_name, suffix, name); 2596 CmtSystem::get_suffix (file_name, suffix); 2597 2598 cmt_string s = " "; 2599 s += name; 2600 s += "_"; 2601 s += suffix; 2602 s += " "; 2603 2604 if (m_sources.find (s) == cmt_string::npos) 2605 { 2606 return (false); 2607 } 2608 else 2609 { 2610 return (true); 2611 } 2612 } 2610 } 2613 2611 2614 2612 cmt_string& get_sources () 2615 2616 2617 2613 { 2614 return (m_sources); 2615 } 2618 2616 2619 2617 private: … … 2735 2733 //cerr << "file_name=" << file_name << endl; 2736 2734 2737 2735 // Get rid of files that may come from the makefile fragment 2738 2736 if (file_name.find ("requirements") != cmt_string::npos) source_number--; 2739 2737 else if (file_name.find (".make") != cmt_string::npos) source_number--; … … 2775 2773 const cmt_string& line = build (name); 2776 2774 2777 //cout << ">>> line=[" << line << "]" << endl;2778 2779 2775 add_line_to_text (line, dependencies); 2780 2776 } … … 2796 2792 const cmt_string& line = build (full_name); 2797 2793 2798 //cout << ">>> name2=" << full_name << endl;2799 2800 2794 add_line_to_text (line, dependencies); 2801 2795 2802 //cout << ">>from deps : " << filter.get_sources () << endl;2803 2796 filter.add_source (full_name); 2804 2797 2805 2798 } 2806 2799 2807 //cout << ">>from deps : " << filter.get_sources () << endl; 2808 2809 // Now : are there still any missing source file in dependencies?? 2800 // Now : are there still any missing source file in dependencies?? 2810 2801 2811 2802 for (i = 0; i < sources.size (); i++) … … 2831 2822 { 2832 2823 const cmt_string& line = build (name); 2833 2834 //cout << ">>> name3=" << name << endl;2835 2824 2836 2825 add_line_to_text (line, dependencies); -
CMT/HEAD/source/cmt_group.cxx
r11 r400 21 21 //---------------------------------------------------------- 22 22 Group* Group::find (const cmt_string& name) 23 //----------------------------------------------------------23 //---------------------------------------------------------- 24 24 { 25 25 static GroupVector& Groups = groups (); … … 37 37 //---------------------------------------------------------- 38 38 Group* Group::add (const cmt_string& name) 39 //----------------------------------------------------------39 //---------------------------------------------------------- 40 40 { 41 41 static GroupVector& Groups = groups (); … … 56 56 //---------------------------------------------------------- 57 57 Group::GroupVector& Group::groups () 58 //----------------------------------------------------------58 //---------------------------------------------------------- 59 59 { 60 60 static Database& db = Database::instance (); … … 66 66 /*----------------------------------------------------------*/ 67 67 void Group::clear_all () 68 /*----------------------------------------------------------*/68 /*----------------------------------------------------------*/ 69 69 { 70 70 static GroupVector& Groups = groups (); … … 81 81 /*----------------------------------------------------------*/ 82 82 void Group::show_all () 83 /*----------------------------------------------------------*/83 /*----------------------------------------------------------*/ 84 84 { 85 85 static GroupVector& Groups = groups (); … … 94 94 //---------------------------------------------------------- 95 95 Group::Group () 96 //----------------------------------------------------------96 //---------------------------------------------------------- 97 97 { 98 98 } … … 100 100 //---------------------------------------------------------- 101 101 Group::Group (const cmt_string& name) : m_name (name) 102 //----------------------------------------------------------102 //---------------------------------------------------------- 103 103 { 104 104 } … … 106 106 //---------------------------------------------------------- 107 107 const cmt_string& Group::name () const 108 //----------------------------------------------------------108 //---------------------------------------------------------- 109 109 { 110 110 return (m_name); … … 113 113 //---------------------------------------------------------- 114 114 void Group::set (const cmt_string& name) 115 //----------------------------------------------------------115 //---------------------------------------------------------- 116 116 { 117 117 m_name = name; … … 120 120 //---------------------------------------------------------- 121 121 void Group::clear () 122 //----------------------------------------------------------122 //---------------------------------------------------------- 123 123 { 124 124 m_name = ""; … … 127 127 //---------------------------------------------------------- 128 128 Group& Group::operator = (const Group& other) 129 //----------------------------------------------------------129 //---------------------------------------------------------- 130 130 { 131 131 m_name = other.m_name; … … 136 136 //---------------------------------------------------------- 137 137 bool Group::operator == (const cmt_string& name) const 138 //----------------------------------------------------------138 //---------------------------------------------------------- 139 139 { 140 140 return ((m_name == name)); … … 143 143 //---------------------------------------------------------- 144 144 bool Group::operator != (const cmt_string& name) const 145 //----------------------------------------------------------145 //---------------------------------------------------------- 146 146 { 147 147 return ((m_name != name)); -
CMT/HEAD/source/cmt_install_area.cxx
r11 r400 86 86 if (installarea == "") return; 87 87 88 // cout << "InstallArea installed in " << installarea << endl;89 90 88 if (!Cmt::get_quiet ()) 91 89 { … … 100 98 CmtSystem::split (installarea_paths, " \t", areapaths); 101 99 102 100 // Try a cleanup only in this selected install area 103 101 104 102 for (int i = 0; i < areapaths.size (); i++) … … 118 116 cmt_regexp expression (".*[.]cmtref$"); 119 117 120 118 // Look for all cmtref files in this PATH pattern 121 119 122 120 CmtSystem::scan_dir (path, expression, refs); … … 126 124 const cmt_string& ref_file = refs[j]; 127 125 128 126 // We get the absolute location of the installed file 129 127 130 128 cmt_string ref; … … 148 146 if (pos != cmt_string::npos) ref.erase (pos); 149 147 150 151 152 153 148 // If the referenced file cannot be reached we remove the 149 // corresponding installation 150 // (this happens if the referenced file has be removed, or 151 // moved away) 154 152 155 153 if (!CmtSystem::test_file (ref)) … … 157 155 cmt_string ref_name; 158 156 159 157 // Get the name of the referenced file 160 158 CmtSystem::basename (ref, ref_name); 161 159 162 160 // Get the installation directory 163 161 CmtSystem::dirname (ref_file, ref); 164 162 … … 166 164 ref += ref_name; 167 165 168 169 166 // Remove both the installed file 167 // and the reference file 170 168 171 169 if (!Cmt::get_quiet ()) 172 170 { 173 c out<< "# Removing obsolete installed file [" << ref << "]";174 c out<< " (and " << ref_file << ")" << endl;171 cerr << "# Removing obsolete installed file [" << ref << "]"; 172 cerr << " (and " << ref_file << ")" << endl; 175 173 } 176 174 -
CMT/HEAD/source/cmt_language.cxx
r11 r400 22 22 /*----------------------------------------------------------*/ 23 23 void Language::show (const cmt_string& name) 24 /*----------------------------------------------------------*/24 /*----------------------------------------------------------*/ 25 25 { 26 26 Language& language = find (name); … … 33 33 /*----------------------------------------------------------*/ 34 34 void Language::show_all () 35 /*----------------------------------------------------------*/35 /*----------------------------------------------------------*/ 36 36 { 37 37 static LanguageVector& Languages = languages (); … … 49 49 /*----------------------------------------------------------*/ 50 50 void Language::show_names () 51 /*----------------------------------------------------------*/51 /*----------------------------------------------------------*/ 52 52 { 53 53 static LanguageVector& Languages = languages (); … … 64 64 /*----------------------------------------------------------*/ 65 65 void Language::setup_all_fragments () 66 /*----------------------------------------------------------*/66 /*----------------------------------------------------------*/ 67 67 { 68 68 static LanguageVector& Languages = languages (); … … 84 84 /*----------------------------------------------------------*/ 85 85 Language& Language::find (const cmt_string& name) 86 /*----------------------------------------------------------*/86 /*----------------------------------------------------------*/ 87 87 { 88 88 static LanguageVector& Languages = languages (); … … 109 109 /*----------------------------------------------------------*/ 110 110 Language& Language::find_with_suffix (const cmt_string& suffix) 111 /*----------------------------------------------------------*/111 /*----------------------------------------------------------*/ 112 112 { 113 113 static LanguageVector& Languages = languages (); … … 138 138 /*----------------------------------------------------------*/ 139 139 void Language::action (const CmtSystem::cmt_string_vector& words) 140 /*----------------------------------------------------------*/140 /*----------------------------------------------------------*/ 141 141 { 142 142 cmt_string name; … … 194 194 /*----------------------------------------------------------*/ 195 195 Language& Language::add (const cmt_string& name) 196 /*----------------------------------------------------------*/196 /*----------------------------------------------------------*/ 197 197 { 198 198 static LanguageVector& Languages = languages (); … … 217 217 /*----------------------------------------------------------*/ 218 218 void Language::clear_all () 219 /*----------------------------------------------------------*/219 /*----------------------------------------------------------*/ 220 220 { 221 221 static LanguageVector& Languages = languages (); … … 231 231 /*----------------------------------------------------------*/ 232 232 Language::LanguageVector& Language::languages () 233 /*----------------------------------------------------------*/233 /*----------------------------------------------------------*/ 234 234 { 235 235 static Database& db = Database::instance (); … … 241 241 /*----------------------------------------------------------*/ 242 242 Language& Language::null () 243 /*----------------------------------------------------------*/243 /*----------------------------------------------------------*/ 244 244 { 245 245 static Language null_instance; … … 250 250 /*----------------------------------------------------------*/ 251 251 Language::Language () 252 /*----------------------------------------------------------*/252 /*----------------------------------------------------------*/ 253 253 { 254 254 clear (); … … 257 257 /*----------------------------------------------------------*/ 258 258 Language::~Language () 259 /*----------------------------------------------------------*/259 /*----------------------------------------------------------*/ 260 260 { 261 261 } … … 263 263 /*----------------------------------------------------------*/ 264 264 void Language::clear () 265 /*----------------------------------------------------------*/265 /*----------------------------------------------------------*/ 266 266 { 267 267 m_name = ""; … … 277 277 /*----------------------------------------------------------*/ 278 278 void Language::show () 279 /*----------------------------------------------------------*/279 /*----------------------------------------------------------*/ 280 280 { 281 281 cout << "language " << m_name; … … 327 327 /*----------------------------------------------------------*/ 328 328 void Language::setup_fragments () 329 /*----------------------------------------------------------*/329 /*----------------------------------------------------------*/ 330 330 { 331 331 cmt_string n = fragment_name; … … 340 340 /*----------------------------------------------------------*/ 341 341 bool Language::operator == (const cmt_string& name) const 342 /*----------------------------------------------------------*/342 /*----------------------------------------------------------*/ 343 343 { 344 344 if (m_name == name) return (true); … … 348 348 /*----------------------------------------------------------*/ 349 349 bool Language::operator == (const Language& other) const 350 /*----------------------------------------------------------*/350 /*----------------------------------------------------------*/ 351 351 { 352 352 if (this == &other) return (true); … … 356 356 /*----------------------------------------------------------*/ 357 357 bool Language::operator != (const Language& other) const 358 /*----------------------------------------------------------*/358 /*----------------------------------------------------------*/ 359 359 { 360 360 if (this != &other) return (true); -
CMT/HEAD/source/cmt_lock.cxx
r11 r400 19 19 { 20 20 case locked_by_user: 21 c out<< "Package already locked by you" << endl;21 cerr << "Package already locked by you" << endl; 22 22 return (s); 23 23 case locked_by_another_user: … … 54 54 } 55 55 56 c out<< "Package now locked" << endl;56 cerr << "Package now locked" << endl; 57 57 58 58 return (locked_by_user); … … 72 72 return (s); 73 73 case not_locked: 74 c out<< "The package was not locked" << endl;74 cerr << "The package was not locked" << endl; 75 75 return (s); 76 76 } … … 97 97 } 98 98 99 c out<< "Package now unlocked" << endl;99 cerr << "Package now unlocked" << endl; 100 100 101 101 return (not_locked); -
CMT/HEAD/source/cmt_log.cxx
r11 r400 36 36 if (!check ()) return (*this); 37 37 38 c out<< c;38 cerr << c; 39 39 return (*this); 40 40 } … … 44 44 if (!check ()) return (*this); 45 45 46 c out<< s;46 cerr << s; 47 47 return (*this); 48 48 } … … 52 52 if (!check ()) return (*this); 53 53 54 c out<< i;54 cerr << i; 55 55 return (*this); 56 56 } … … 60 60 if (!check ()) return (*this); 61 61 62 c out<< d;62 cerr << d; 63 63 return (*this); 64 64 } … … 68 68 if (!check ()) return (*this); 69 69 70 c out<< p;70 cerr << p; 71 71 return (*this); 72 72 } … … 76 76 if (!check ()) return (*this); 77 77 78 c out<< endl;78 cerr << endl; 79 79 return (*this); 80 80 } -
CMT/HEAD/source/cmt_model.cxx
r11 r400 133 133 cmt_string attribute = "[^=/>]+=((\"([^\"]|\\\\\")*\")|(\'([^\']|\\\\\')*\'))"; 134 134 135 //cout << "attribute=[" << attribute << "]" << endl;136 137 135 cmt_regexp exp_open_element (open_element); 138 136 cmt_regexp exp_open_elements (open_elements); … … 149 147 static int expand_level = 0; 150 148 151 //cout << "Text=[" << text << "]" << endl;152 153 149 filter (text); 154 155 //cout << "Text=[" << text << "]" << endl;156 150 157 151 int pos = 0; … … 200 194 display (remaining); 201 195 202 //cout << "pos=" << pos << " open_element -> p=" << it._pos << " l=" << it._length << endl;203 196 pos = it._pos + it._length; 204 197 … … 210 203 } 211 204 212 //cout << "pos=" << pos << " word -> p=" << it._pos << " l=" << it._length << endl;213 205 pos += it._length; 214 206 215 207 cmt_string element = it (text); 216 //cout << "pos=" << pos << " element=" << element << endl;217 208 218 209 subargs.clear (); … … 228 219 if (it._pos == pos) 229 220 { 230 //cout << "pos=" << pos << " skip_spaces -> p=" << it._pos << " l=" << it._length << endl;231 221 pos += it._length; 232 222 } 233 234 //cout << "pos=" << pos << endl;235 223 236 224 it = exp_close_element.begin (text, pos); 237 225 if (it._pos == pos) 238 226 { 239 //cout << "Recursing to [" << element << "]" << endl;240 241 227 int i; 242 228 … … 272 258 } 273 259 274 //cout << "+ name = [" << value << "]" << endl;275 276 260 if (multiple) 277 261 { … … 298 282 if (multiple) 299 283 { 300 //cout << "+ count = " << multiple_count << endl;301 284 for (int n = 0; n < multiple_count; n++) 302 285 { … … 319 302 } 320 303 321 //cout << "+ values = [" << value << "]" << endl;322 323 304 values.clear (); 324 305 CmtSystem::split (value, " \t", values); … … 334 315 Variable& v = variables[i-1]; 335 316 336 //cout << "+ value = [" << value << "]" << endl;337 338 317 v = value; 339 318 } … … 359 338 } 360 339 361 //cout << "Try attribute at pos=" << pos << " [" << text.substr (pos) << "]" << endl;362 363 340 it = exp_attribute.begin (text, pos); 364 341 if (it._pos != pos) … … 368 345 } 369 346 370 //cout << "pos=" << pos << " attribute -> p=" << it._pos << " l=" << it._length << endl;371 //cout << "pos=" << pos << " attr=[" << it (text) << "]" << endl;372 373 347 { 374 348 cmt_string& s = subargs.add (); … … 385 359 void CmtModel::test_regexp (const cmt_string& pattern, const cmt_string& input_text) 386 360 { 387 c out<< "Testing pattern [" << pattern << "] against [" << input_text << "]" << endl;361 cerr << "Testing pattern [" << pattern << "] against [" << input_text << "]" << endl; 388 362 389 363 cmt_regexp exp (pattern); … … 397 371 if (it == exp.end ()) 398 372 { 399 c out<< "No match" << endl;373 cerr << "No match" << endl; 400 374 } 401 375 else 402 376 { 403 c out<< "p=" << it._pos << " l=" << it._length << " -> [" << it (input_text) << "]" << endl;377 cerr << "p=" << it._pos << " l=" << it._length << " -> [" << it (input_text) << "]" << endl; 404 378 } 405 379 } -
CMT/HEAD/source/cmt_parser.cxx
r371 r400 439 439 { 440 440 /* 441 441 Do genvsnet for one specific target. 442 442 */ 443 443 constituent = Constituent::find (target); … … 450 450 { 451 451 /* 452 452 Do genvsnet for all possible targets. 453 453 */ 454 454 Constituent::build_all_vsnet_files (Me.m_simulation); … … 537 537 log << "configure_current_package" << log_endl; 538 538 configure_current_package (); 539 539 540 log << "configure_current_structuring_style" << log_endl; 540 541 configure_current_structuring_style (); … … 640 641 { 641 642 m_current_dir = CmtSystem::pwd (); 643 642 644 m_done = false; 643 645 m_prefix = ""; … … 661 663 void filter (const cmt_string& line) 662 664 { 663 //cout << "line=" << line << endl;664 665 665 if (m_done) 666 666 { … … 895 895 Me.m_current_style = none_style; 896 896 } 897 898 //cout << "configure_current_package> current style=" << Me.m_current_style << endl;899 897 } 900 898 … … 1026 1024 void Cmt::restore_all_tags (Use* use) 1027 1025 { 1028 1026 //cerr << "restore_all_tags" << endl; 1029 1027 1030 1028 Cmt::configure_tags (use); 1031 1029 1032 1033 1034 1030 /* 1031 Then get existing extra tags 1032 */ 1035 1033 1036 1034 if (CmtSystem::testenv ("CMTEXTRATAGS")) … … 1073 1071 Log; 1074 1072 1075 //if (Me.m_debug) cout << "configure_tags0> current_tag=" << Me.m_current_tag << endl;1076 1077 1073 log << "current_tag=" << Me.m_current_tag << log_endl; 1078 1074 … … 1111 1107 } 1112 1108 1113 //if (Me.m_debug) cout << "configure_tags> current_tag=" << Me.m_current_tag << endl;1114 1109 log << "current_tag=" << Me.m_current_tag << log_endl; 1115 1110 … … 1126 1121 tag->mark (); 1127 1122 1128 1123 //Me.m_current_tag = config_tag; 1129 1124 } 1130 1125 … … 1186 1181 1187 1182 void filter (const cmt_string& line) 1188 1189 1190 1183 { 1184 cout << line << endl; 1185 } 1191 1186 }; 1192 1187 … … 1371 1366 { 1372 1367 cerr << "#CMT> package " << use->get_package_name () << 1373 1374 1375 1368 " " << use->version << " " << use->path << 1369 " not found" << 1370 endl; 1376 1371 } 1377 1372 } … … 1393 1388 cmt_string& p = packages.add (); 1394 1389 p = use->get_package_name (); 1395 1396 //cout << ">>> adding " << s << " to selection" << endl;1397 1390 } 1398 1391 } … … 1423 1416 cmt_string& p = packages.add (); 1424 1417 p = use->get_package_name (); 1425 1426 //cout << ">>> adding current " << s << " to selection" << endl;1427 1418 } 1428 1419 } … … 1617 1608 1618 1609 if ((status != 0) && !ignore_errors) 1619 1610 //if ((status != 0) && !ignore_errors) 1620 1611 { 1621 1612 if (status != 2) CmtError::set (CmtError::execution_error, cmd); … … 1711 1702 { 1712 1703 const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance (); 1713 1714 //cout << "#IA2>" << endl;1715 1704 1716 1705 cmt_string s1 = ia_mgr.get_installarea (); … … 2037 2026 } 2038 2027 2039 2028 //Use::UsePtrVector& Uses = Use::get_ordered_uses (); 2040 2029 2041 2030 Use& current_use = Use::current (); … … 2048 2037 cout << "default_path " << Me.m_default_path << endl; 2049 2038 cout << "cmt config " << 2050 2051 2052 2039 Me.m_current_package << " " << 2040 Me.m_current_version << " " << 2041 Me.m_current_path << endl; 2053 2042 } 2054 2043 … … 2063 2052 { 2064 2053 2065 2066 2067 2054 // 2055 // Here we are in a standalone package (ie completely unstructured) 2056 // 2068 2057 2069 2058 if (CmtSystem::test_file ("requirements")) … … 2115 2104 CmtSystem::split (s, '.', words); 2116 2105 if (words.size()>=2) 2117 2118 2119 2120 2106 if (CmtSystem::get_makefile_suffix () == "nmake" && words[1] == "nmake") 2107 CmtSystem::remove_file (s); 2108 else if (CmtSystem::get_makefile_suffix () == "make" && words[1] == "make") 2109 CmtSystem::remove_file (s); 2121 2110 } 2122 2111 } … … 2138 2127 CmtSystem::split (s, '.', words); 2139 2128 if (words.size()>=2) 2140 2141 2142 2143 2129 if (CmtSystem::get_makefile_suffix () == "nmake" && words[1] == "nmake") 2130 CmtSystem::remove_file (s); 2131 else if (CmtSystem::get_makefile_suffix () == "make" && words[1] == "make") 2132 CmtSystem::remove_file (s); 2144 2133 } 2145 2134 } 2146 //exit(-1);2147 2148 /*2149 // cout << "Try a cleanup of the installation area " << endl;2150 2151 //2152 // Try a cleanup of the installation area2153 //2154 if (current_use.get_strategy ("InstallArea"))2155 {2156 CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();2157 2158 //cout << "#IA3>" << endl;2159 2160 if (current_use.get_strategy ("SetupCleanup"))2161 {2162 ia_mgr.config ();2163 }2164 }2165 */2166 2135 2167 2136 CmtSystem::cd (branch); … … 2177 2146 use.change_path (Me.m_current_path); 2178 2147 use.style = Me.m_current_style; 2179 2180 //cout << "do_config> current style=" << Me.m_current_style << endl;2181 2148 2182 2149 Me.m_quiet = true; … … 2240 2207 cout << "default_path " << Me.m_default_path << endl; 2241 2208 cout << "cmt config " << 2242 2243 2244 2209 Me.m_current_package << " " << 2210 Me.m_current_version << " " << 2211 Me.m_current_path << endl; 2245 2212 } 2246 2213 … … 2255 2222 { 2256 2223 2257 2258 2259 2224 // 2225 // Here we are in a standalone package (ie completely unstructured) 2226 // 2260 2227 2261 2228 if (CmtSystem::test_file ("requirements")) … … 2362 2329 } 2363 2330 2364 2365 2331 //if (Me.m_current_package == "CMT") return; 2332 //if (Me.m_current_package == "methods") return; 2366 2333 2367 2334 cmt_string the_path; … … 2698 2665 Me.m_action = action_show_action_names; 2699 2666 /* 2700 if (!Me.m_quiet)2667 if (!Me.m_quiet) 2701 2668 { 2702 2703 2669 cerr << "Existing actions:" << endl; 2670 print_symbol_names (ap.mode); 2704 2671 } 2705 2672 */ … … 2732 2699 Symbol::expand (cmd); 2733 2700 2734 c out<< "Execute action " << ap.arguments[0] << " => " << cmd << endl;2701 cerr << "Execute action " << ap.arguments[0] << " => " << cmd << endl; 2735 2702 2736 2703 int status = CmtSystem::execute (cmd); 2737 2704 if (status != 0) 2738 CmtError::set (CmtError::execution_failed, ap.arguments[0], status); 2739 2705 { 2706 CmtError::set (CmtError::execution_failed, ap.arguments[0], status); 2707 } 2740 2708 } 2741 2709 } … … 2826 2794 //(unsused) Use& use = Use::current(); 2827 2795 2828 c out<< "try to lock package " << package << " in " << CmtSystem::pwd () << endl;2796 cerr << "try to lock package " << package << " in " << CmtSystem::pwd () << endl; 2829 2797 2830 2798 set_standard_macros (); … … 2840 2808 const cmt_string& path = Me.m_current_path; 2841 2809 2842 2810 //Use::UsePtrVector& Uses = Use::get_ordered_uses (); 2843 2811 2844 2812 if (Me.m_current_package == "CMT") return; … … 2879 2847 if (!CmtSystem::cd (the_path)) 2880 2848 { 2881 c out<< "Path " << the_path << " not reachable" << endl;2849 cerr << "Path " << the_path << " not reachable" << endl; 2882 2850 return; 2883 2851 } … … 2887 2855 if (CmtSystem::remove_directory (version)) 2888 2856 { 2889 c out<< "Version " << version << " has been removed from " << the_path << endl;2857 cerr << "Version " << version << " has been removed from " << the_path << endl; 2890 2858 CmtSystem::cmt_string_vector contents; 2891 2859 CmtSystem::scan_dir (".", contents); … … 2895 2863 if (CmtSystem::remove_directory (package)) 2896 2864 { 2897 c out<< "Package " << package << " has no more versions. Thus it has been removed."<< endl;2865 cerr << "Package " << package << " has no more versions. Thus it has been removed."<< endl; 2898 2866 } 2899 2867 } … … 2901 2869 else 2902 2870 { 2903 c out<< "Impossible to remove version " << version << " from " << the_path << endl;2871 cerr << "Impossible to remove version " << version << " from " << the_path << endl; 2904 2872 } 2905 2873 } … … 2916 2884 if (!CmtSystem::remove_directory ("cmt")) 2917 2885 { 2918 c out<< "Unstructured version " << version2886 cerr << "Unstructured version " << version 2919 2887 << " has been removed from " << the_path << endl; 2920 2888 } 2921 2889 else 2922 2890 { 2923 c out<< "Impossible to remove unstructured version " << version2891 cerr << "Impossible to remove unstructured version " << version 2924 2892 << " from " << the_path << endl; 2925 2893 } … … 2927 2895 else 2928 2896 { 2929 c out<< "Version " << version << " not found" << endl;2897 cerr << "Version " << version << " not found" << endl; 2930 2898 } 2931 2899 } 2932 2900 else 2933 2901 { 2934 c out<< "Version " << version << " not found" << endl;2902 cerr << "Version " << version << " not found" << endl; 2935 2903 } 2936 2904 } … … 2979 2947 { 2980 2948 cerr << "#CMT> package " << use->get_package_name () << 2981 2982 2983 2949 " " << use->version << " " << use->path << 2950 " not found" << 2951 endl; 2984 2952 } 2985 2953 } … … 3048 3016 const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance (); 3049 3017 3050 //cout << "#IA4>" << endl;3051 3052 3018 cmt_string s1 = ia_mgr.get_installarea (); 3053 3019 … … 3072 3038 } 3073 3039 3074 3040 // Now deleting the reference file 3075 3041 3076 3042 s = symunlink; … … 3104 3070 Symbol::expand (s); 3105 3071 3106 if (!Me.m_quiet) cout << s << endl; 3072 if (!Me.m_quiet) cerr << s << endl; 3073 3107 3074 int status = CmtSystem::execute (s); 3108 3075 … … 3148 3115 SequenceRunner runner; 3149 3116 3150 c out<< "# cmt run_sequence: sequence " << ap.arguments[0] << endl;3117 cerr << "# cmt run_sequence: sequence " << ap.arguments[0] << endl; 3151 3118 3152 3119 runner.run (ap.arguments[0]); … … 3199 3166 } 3200 3167 3201 c out<< "Writing version file : " << version << endl;3168 cerr << "Writing version file : " << version << endl; 3202 3169 3203 3170 version.write ("version.cmt"); … … 3241 3208 print (ap.mode); 3242 3209 3243 3244 3245 3210 // 3211 // Try a cleanup of the installation area 3212 // 3246 3213 if (current_use.get_strategy ("InstallArea")) 3247 3214 { 3248 3215 CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance (); 3249 3216 3250 //cout << "#IA5>" << endl;3251 3252 3217 ia_mgr.setup (); 3253 3254 /*3255 if (current_use.get_strategy ("SetupCleanup"))3256 {3257 const cmt_string& installarea = ia_mgr.get_installarea ();3258 3259 if (installarea != "")3260 {3261 cmt_string q;3262 3263 switch (mode)3264 {3265 case Sh :3266 case Csh :3267 q = "\'";3268 break;3269 default :3270 break;3271 }3272 3273 if (!Me.m_quiet)3274 {3275 cout << "echo " << q3276 << "# Doing cleanup in the installation area " << installarea3277 << q << endl;3278 }3279 }3280 3281 ia_mgr.config ();3282 }3283 */3284 3218 } 3285 3219 } … … 3416 3350 cmt_string cmtpath; 3417 3351 cmt_string offset; 3418 cmt_string pauthor = "";3419 3352 3420 3353 Use& use = Use::current(); 3421 3354 use.get_cmtpath_and_offset (cmtpath, offset); 3355 3422 3356 Project* p = Project::find_by_cmtpath (cmtpath); 3423 3357 3424 cout <<p->get_author ()<<endl; 3425 3358 cout << p->get_author () << endl; 3426 3359 } 3427 3360 … … 3462 3395 scanner.scan_path (path_name, collector); 3463 3396 } 3397 3464 3398 cout << "# ----------- " << collector.count () << " clients found." << endl; 3465 3399 } … … 3970 3904 // (unused??) Use& use = Use::current(); 3971 3905 3972 c out<< "try to unlock package " << package << " in " << CmtSystem::pwd () << endl;3906 cerr << "try to unlock package " << package << " in " << CmtSystem::pwd () << endl; 3973 3907 3974 3908 set_standard_macros (); … … 3992 3926 3993 3927 /* 3994 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path ()3995 {3928 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path () 3929 { 3996 3930 return (Me.m_cmt_path); 3997 }3998 3999 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path_pwds ()4000 {3931 } 3932 3933 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path_pwds () 3934 { 4001 3935 return (Me.m_cmt_path_pwds); 4002 }4003 4004 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path_sources ()4005 {3936 } 3937 3938 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path_sources () 3939 { 4006 3940 return (Me.m_cmt_path_sources); 4007 }3941 } 4008 3942 */ 4009 3943 … … 4112 4046 4113 4047 /**--------------------------------------------------------- 4114 guess_current_project4048 guess_current_project 4115 4049 4116 4050 if current directory is in one of the CMTPATHs, do nothing. 4117 4051 4118 Otherwise, we want to guess the current project4119 4120 move up in directories until cmt/project.cmt is found4121 4122 for (;;)4123 {4124 4125 4126 4127 4128 4129 4130 4131 4132 }4133 4052 Otherwise, we want to guess the current project 4053 4054 move up in directories until cmt/project.cmt is found 4055 4056 for (;;) 4057 { 4058 if test -f ./cmt/project.cmt 4059 ok: 4060 this directory should become the first entry of the CMTPATH 4061 break 4062 4063 if (at top) break; 4064 4065 move up 4066 } 4067 */ 4134 4068 void Cmt::guess_current_project () 4135 4069 { … … 4137 4071 4138 4072 log << "guess_current_project" << log_endl; 4073 4074 cmt_string here = CmtSystem::pwd (); 4139 4075 4140 4076 if (Project::find_in_cmt_paths (Me.m_current_dir) == "") … … 4165 4101 break; 4166 4102 } 4103 4167 4104 if (CmtSystem::pwd () == pwd) 4168 4105 { … … 4170 4107 } 4171 4108 } 4109 4172 4110 CmtSystem::cd (Me.m_current_dir); 4173 4111 } … … 4184 4122 4185 4123 Me.m_autoconfigure_cmtpath = true; 4124 4125 CmtSystem::cd (here); 4186 4126 } 4187 4127 … … 4260 4200 #endif 4261 4201 4262 c out<< "Creating cleanup scripts." << endl;4202 cerr << "Creating cleanup scripts." << endl; 4263 4203 4264 4204 cmt_string temp; … … 4346 4286 #endif 4347 4287 4348 c out<< "Creating setup scripts." << endl;4288 cerr << "Creating setup scripts." << endl; 4349 4289 4350 4290 Use& current_use = Use::current (); … … 4460 4400 #endif 4461 4401 4462 c out<< "Creating cleanup scripts." << endl;4402 cerr << "Creating cleanup scripts." << endl; 4463 4403 4464 4404 cmt_string temp; … … 4535 4475 Symbol* macro = Symbol::find (macro_name); 4536 4476 if (macro != 0) 4537 {4477 { 4538 4478 cmt_string value = macro->resolve_macro_value (); 4539 4479 if (value != "") 4540 { 4541 cout << "Creating native_version file." << endl; 4542 FILE* f = fopen ("new.native_version.cmt", "wb"); 4543 if (f != NULL) 4544 { 4545 fprintf (f, "%s\n", value.c_str ()); 4546 } 4547 //cout<<value <<endl; 4548 fclose (f); 4549 4550 CmtSystem::compare_and_update_files ("new.native_version.cmt", "native_version.cmt"); 4551 } 4552 } 4480 { 4481 cerr << "Creating native_version file." << endl; 4482 4483 FILE* f = fopen ("new.native_version.cmt", "wb"); 4484 4485 if (f != NULL) 4486 { 4487 fprintf (f, "%s\n", value.c_str ()); 4488 } 4489 4490 fclose (f); 4491 4492 CmtSystem::compare_and_update_files ("new.native_version.cmt", "native_version.cmt"); 4493 } 4494 } 4553 4495 } 4554 4496 //---------------------------------------------------------- … … 4565 4507 #endif 4566 4508 4567 c out<< "Creating setup scripts." << endl;4509 cerr << "Creating setup scripts." << endl; 4568 4510 4569 4511 Use& current_use = Use::current (); … … 4892 4834 if (CmtError::has_pending_error ()) return (false); 4893 4835 4894 4895 4896 4836 /** 4837 * See reach_current_package for an explanation of this call 4838 */ 4897 4839 Pattern::apply_all_globals (); 4898 4840 … … 5140 5082 case action_version : 5141 5083 use_cmt (); 5142 5143 5144 5084 // 5085 // Now parse the requirements file stored in ${CMTHOME} 5086 // 5145 5087 5146 5088 use_home_requirements (); … … 5490 5432 case action_awk : 5491 5433 do_awk (ap); 5492 5434 break; 5493 5435 case action_broadcast : 5494 5436 do_broadcast (ap); … … 5768 5710 int code = CmtError::get_last_error_code (); 5769 5711 if (code == CmtError::execution_failed) 5770 5712 { 5771 5713 code = CmtError::get_last_execution_error(); 5772 5714 } 5773 5715 5774 5716 if (!Me.m_quiet) CmtError::print (); … … 5797 5739 set_standard_macros (); 5798 5740 5799 5800 5741 //cerr << "# current_tag=" << Me.m_current_tag << endl; 5742 //cerr << "# current_config=" << Me.m_current_config << endl; 5801 5743 5802 5744 if (Me.m_current_tag == "") … … 5810 5752 } 5811 5753 5812 5813 5814 5815 5816 5754 // 5755 // Now check if all extra tags are still valid. Some of them 5756 // may be discarded du to some conflict with highest priority 5757 // tags, or with exclude statements 5758 // 5817 5759 5818 5760 { … … 5930 5872 if (use->m_hidden) continue; 5931 5873 5932 5933 5874 Package* p = use->get_package (); 5875 if (p->is_cmt ()) continue; 5934 5876 5935 5877 … … 6073 6015 6074 6016 if (has_pattern) 6075 6076 6077 6017 { 6018 if (!expression.match (symbol.name)) continue; 6019 } 6078 6020 6079 6021 if (Me.m_action == action_show_macro_names) … … 6202 6144 if (!CmtSystem::test_file ("requirements")) 6203 6145 { 6204 /*6205 if (!Me.m_quiet)6206 {6207 cout << "#CMT> Cannot reach the requirements file" << endl;6208 }6209 6210 CmtError::set (CmtError::package_not_found,6211 "ReachCurrentPackage> Cannot reach the requirements file");6212 */6213 6146 return (0); 6214 6147 } … … 6310 6243 tag = Tag::add (env, PriorityConfig, "reach current package", 0); 6311 6244 tag->mark (); 6312 6245 //Me.m_current_tag = env; 6313 6246 6314 6247 //if (!Me.m_quiet) cerr << "reach_current_package1> current_tag=" << Me.m_current_tag << endl; … … 6332 6265 if (Me.m_debug) cout << "reach_current_package2> current_tag=" << Me.m_current_tag << endl; 6333 6266 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6267 /** 6268 * It would be useful to change this mechanism. Instead of 6269 * applying all global patterns at once to all use contexts, it 6270 * would be much better to apply it at the end of each 6271 * requirements file parsing, and only in the context the 6272 * appropriate Use. 6273 * 6274 * This would avoid the current flaw which is that when a global 6275 * pattern specifies a "private" definition, it is actually 6276 * applied in the scope context of the Current Use and not in 6277 * each individual Use. Therefore the private is lost. 6278 * 6279 * However, this induces problems since some pattern definitions 6280 * are done AFTER the use statements, which will NOT receive the 6281 * pattern aplications. 6282 * 6283 * Therefore it is decided to leave this "bad" mechanism until 6284 * everybody is aware of this constraint. 6285 * 6286 * 6287 */ 6355 6288 Pattern::apply_all_globals (); 6356 6289 … … 6370 6303 cmt_string result; 6371 6304 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6305 /* 6306 //if (CmtSystem::getenv ("CMTTESTPREFIX") != "") 6307 { 6308 */ 6309 6310 // 6311 // If there is a common prefix between 6312 // use->real_path and pwd 6313 // we have 6314 // use->real_path = /<prefix>/aaa 6315 // pwd = /<prefix>/bbb 6316 // 6317 // Then use->real_path may be expressed as: 6318 // ../..../../aaa 6319 // where ../..../../ moves up to /<prefix> 6320 // 6321 // Then we try to find the shortest between 6322 // 6323 // /<prefix> and ../..../.. 6324 // 6392 6325 cmt_string a = path; 6393 6326 … … 6403 6336 int i; 6404 6337 6405 //cout << "Package " << use->get_package_name () << endl;6406 6407 6338 for (i = 0; i < m; i++) 6408 6339 { 6409 6340 const cmt_string& fa = va[i]; 6410 6341 const cmt_string& fb = pwd[i]; 6411 6412 //cout << " fa=" << fa << " fb=" << fb << endl;6413 6342 6414 6343 if (fa != fb) break; … … 6419 6348 if (i > 0) 6420 6349 { 6421 6422 6423 6424 6350 // We have the prefix. 6351 // if we count what remains from pwd, then 6352 // we have the number of ../ required to 6353 // move to /<prefix> 6425 6354 int j; 6426 6355 … … 6438 6367 } 6439 6368 6440 6441 6442 6443 6444 6369 // 6370 // Here ups contains the ../..../../aaa form 6371 // for the use->real_path or is empty when there 6372 // were no common prefix. 6373 // 6445 6374 6446 6375 //if (ups != "") 6447 6376 if ((ups != "") && 6448 6377 (ups.size () < path.size ())) … … 7097 7026 cout << "fill_for_all_constituents>" << endl; 7098 7027 } 7028 7099 7029 Constituent::parse_all (); 7100 7030 7101 7031 Use::UsePtrVector& Uses = Use::get_ordered_uses (); 7102 7032 7103 7033 const Constituent::ConstituentVector& constituents = 7104 Constituent::constituents ();7034 Constituent::constituents (); 7105 7035 7106 7036 7107 // /Prepare the auto_imports states in a vector7037 // Prepare the auto_imports states in a vector 7108 7038 cmt_vector<bool> base_auto_imports_states; 7109 7039 … … 7111 7041 7112 7042 int number; 7113 7043 7114 7044 for (number = 0; number < Uses.size (); number++) 7115 7045 { 7116 7117 7046 Use* use = Uses[number]; 7047 base_auto_imports_states[number] = (use->auto_imports != Off); 7118 7048 } 7119 7120 // /Now scan all constituents7121 7049 7050 // Now scan all constituents 7051 7122 7052 for (number = 0; number < constituents.size (); number++) 7123 7053 { 7124 7125 7054 const Constituent& constituent = constituents[number]; 7055 7126 7056 if (Cmt::get_debug ()) 7127 7057 { 7128 7058 cout << "Checking " << constituent.name << " against imports requests" << endl; 7129 7059 } 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7060 Use::UsePtrVector imports; 7061 int i; 7062 7063 /** 7064 * Problem for imports in constituents. 7065 * 7066 * 1) use_xxx has holes due to the corresponding 7067 * -no_auto_imports options attached to some 7068 * use statements (including the transitive ones) 7069 * 7070 * 2) the -import=yyy options provided to a given constituent 7071 * should restore the appropriate holes as well as 7072 * all transitive ones. 7073 * 7074 * 3) for use_linkopts, missing pieces must be filled at 7075 * the right position. (for others, order is not relevant 7146 7076 * while transitive access is required for all) 7147 7148 7149 7150 7077 * 7078 */ 7079 7080 if (constituent.type == Document) 7151 7081 { 7152 7082 continue; 7153 7083 } 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7084 7085 if (constituent.imports.size () == 0) 7086 { 7087 buffer = "macro_append "; 7088 buffer += constituent.name; 7089 buffer += "_use_linkopts "; 7090 buffer += " \" "; 7091 7092 current_use->fill_macro (buffer, "linkopts"); 7093 7094 for (i = 0; i < Uses.size (); i++) 7095 { 7096 if (base_auto_imports_states[i]) 7097 { 7098 Use* u = Uses[i]; 7099 7100 if (u->discarded) continue; 7101 if (u->m_hidden) continue; 7102 7103 Package* p = u->get_package (); 7104 if (p->is_cmt ()) continue; 7175 7105 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7106 u->fill_macro (buffer, "linkopts"); 7107 } 7108 } 7109 buffer += "\""; 7110 apply (); 7111 7112 /* 7113 buffer = "macro_append "; 7114 buffer += constituent.name; 7115 buffer += "_use_linkopts "; 7116 7117 buffer += " \" $(use_linkopts)\""; 7118 apply (); 7119 */ 7120 7121 continue; 7122 } 7123 7194 7124 // From here on, the constituent HAS import options. 7195 7196 7125 7126 /** 7197 7127 * Create a private copy of the state vector. This private copy 7198 7128 * will be updated according to -import=xxx modifiers for the 7199 7129 * current constituent. 7200 7130 */ 7201 7202 7203 7204 7205 7131 cmt_vector<bool> auto_imports_states (base_auto_imports_states); 7132 7133 for (i = 0; i < constituent.imports.size (); i++) 7134 { 7135 const cmt_string& import = constituent.imports[i]; 7206 7136 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7137 // 7138 // Resolve the imported uses 7139 // 7140 7141 int use_index = Use::find_index (import, "", ""); 7142 7143 if (use_index >= 0) 7144 { 7145 Use* u = Uses[use_index]; 7146 7147 if (u->discarded) continue; 7148 if (u->m_hidden) continue; 7219 7149 7220 7150 if (Cmt::get_debug ()) … … 7228 7158 << endl; 7229 7159 } 7230 7160 7231 7161 Package* p = u->get_package (); 7232 7162 if (p->is_cmt ()) continue; 7233 7163 7234 7164 if (u->auto_imports != Off) continue; 7235 7165 7236 7166 Use::set_auto_imports_state (use_index, auto_imports_states); 7237 7238 7239 7240 7241 7242 7243 7244 7245 7167 } 7168 } 7169 7170 if (Cmt::get_debug ()) 7171 { 7172 cout << constituent.name << " has imports " << endl; 7173 } 7174 7175 7246 7176 /** 7247 7177 * Find all newly exposed packages and precompute this list inside … … 7251 7181 { 7252 7182 if (base_auto_imports_states[i]== On && auto_imports_states[i] == Off) continue; 7253 7183 7254 7184 Use* u = Uses[i]; 7255 7185 7256 7186 if (u->discarded) continue; 7257 7187 if (u->m_hidden) continue; … … 7268 7198 } 7269 7199 7270 7271 7200 if (imports.size () == 0) continue; 7201 7272 7202 cmt_string prefix; 7273 7203 7274 7204 // 7275 7205 // Documents are not considered … … 7284 7214 break; 7285 7215 } 7286 7216 7287 7217 buffer = "macro_append "; 7288 7218 buffer += prefix; … … 7373 7303 7374 7304 /** 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7305 * Setting ${CONSTITUENT}linkopts is a temporary solution 7306 * until the backward compatibility solution for a proper 7307 * replacement of use_linkopts by ${CONSTITUENT}_use_linkopts 7308 * is acheived. 7309 * 7310 */ 7311 buffer = "macro_append "; 7312 buffer += constituent.name; 7313 buffer += "linkopts "; 7314 buffer += " \" "; 7315 for (i = 0; i < imports.size (); i++) 7316 { 7317 Use* u = imports[i]; 7318 7319 u->fill_macro (buffer, "linkopts"); 7320 } 7321 buffer += "\""; 7322 apply (); 7323 7324 /** 7325 * Only for linkopts we take care of the order. This means 7326 * that ${CONSTITUENT}_use_linkopts should be used in place of use_linkopts. 7327 * 7328 * (see the application fragments) 7399 7329 * that ${CONSTITUENT}_use_linkopts will be used in place of use_linkopts. 7400 7330 */ … … 7417 7347 Package* p = u->get_package (); 7418 7348 if (p->is_cmt ()) continue; 7419 7349 7420 7350 u->fill_macro (buffer, "linkopts"); 7421 7351 } … … 7423 7353 buffer += "\""; 7424 7354 apply (); 7425 7355 7426 7356 //==== GLAST addition for vs.net ========== 7427 7357 buffer = "macro "; … … 7431 7361 } 7432 7362 } 7433 7363 7434 7364 /** 7435 7365 * Macros implied or required to manage constituents. … … 7535 7465 7536 7466 SyntaxParser::parse_requirements_line (temp, current_use); 7537 }7467 } 7538 7468 } 7539 7469 … … 7550 7480 { 7551 7481 CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance (); 7552 7553 //cout << "#IA7>" << endl;7554 7482 7555 7483 ia_mgr.setup (); … … 7626 7554 7627 7555 7628 7629 7630 7556 /** 7557 * TAG management 7558 */ 7631 7559 7632 7560 bool tag_debug = CmtSystem::testenv ("TAGDEBUG"); … … 7636 7564 if (Me.m_current_tag != "") 7637 7565 { 7638 7566 // this is when some -tag= argument was used. 7639 7567 if (tag_debug) cerr << "set_standard_macro0.1> current_tag=" << Me.m_current_tag << endl; 7640 7568 } 7641 7569 else if (Symbol::is_selected ("CMTCONFIG")) 7642 7570 { 7643 7571 // This is when CMTCONFIG has been set from some requirements file 7644 7572 Symbol* macro = Symbol::find ("CMTCONFIG"); 7645 7573 if (macro != 0) … … 7651 7579 else 7652 7580 { 7653 7581 // this is when no -tag= argument was used. 7654 7582 if (tag_debug) cerr << "set_standard_macro(before2)> current_tag=" << Me.m_current_tag << endl; 7655 7583 if (current_use.get_package_name () == "CMT") … … 7676 7604 Me.m_current_style); 7677 7605 7678 7679 //7680 // Definitions for installation area mechanisms7681 //7682 /*7683 if (current_use.get_strategy ("InstallArea"))7684 {7685 CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();7686 7687 //cout << "#IA6>" << endl;7688 7689 ia_mgr.setup_current_installarea ();7690 }7691 */7692 7606 7693 7607 builder.fill_for_current_package (Me.m_current_dir); -
CMT/HEAD/source/cmt_pattern.cxx
r189 r400 160 160 if (words.size () < 2) return; 161 161 162 163 164 165 166 167 168 169 170 171 172 173 162 // 163 // expected syntax is: 164 // 165 // pattern [-global] pattern-name any-cmt-statement 166 // 167 // where any-cmt-statement may contain "templates" 168 // 169 // <package> 170 // <PACKAGE> 171 // <version> 172 // <path> 173 // 174 174 175 175 cmt_string& option = words[1]; … … 193 193 if (CmtSystem::testenv ("CMTTESTPATTERN")) 194 194 { 195 c out<< "Pattern::action> add " << name << endl;195 cerr << "Pattern::action> add " << name << endl; 196 196 } 197 197 } … … 234 234 if (pattern == 0) 235 235 { 236 237 236 // No pattern for the pair <name, use> exist yet. 237 // create one. 238 238 Pattern& p = Patterns.add (); 239 239 … … 262 262 int first_word = start_index; 263 263 264 265 266 264 // 265 // Install the cmt-statement both as a vector of words and as a single line 266 // 267 267 for (int i = start_index; i < words.size (); i++) 268 268 { … … 493 493 cout << "# " << use->get_package_name () 494 494 << " applies pattern " << apply_pattern.name << " => " << endl; 495 495 496 apply_pattern.show (); 497 496 498 cout << endl; 497 499 } … … 518 520 bool found = false; 519 521 520 522 // First show the definitions. 521 523 522 524 Pattern* p = Pattern::find (name); … … 530 532 p->show (); 531 533 532 533 534 534 // 535 // Then show the packages which explicitly apply the pattern. 536 // 535 537 Use* use; 536 538 ApplyPattern* apply_pattern = 0; … … 645 647 if (CmtSystem::getenv ("TESTCACHE") != "") 646 648 { 647 c out<< "update cache " << c->get_package_name () << "(" << c << ") " << t->get_package_name () << "(" << t << ")" << endl;649 cerr << "update cache " << c->get_package_name () << "(" << c << ") " << t->get_package_name () << "(" << t << ")" << endl; 648 650 } 649 651 … … 669 671 if (CmtSystem::getenv ("TESTCACHE") != "") 670 672 { 671 c out<< "keep cache" << endl;673 cerr << "keep cache" << endl; 672 674 } 673 675 } … … 735 737 if (CmtSystem::testenv ("CMTTESTPATTERN")) 736 738 { 737 c out<< "Pattern::apply> replacement=[" << replacement << "]" << endl;739 cerr << "Pattern::apply> replacement=[" << replacement << "]" << endl; 738 740 } 739 741 … … 753 755 if (CmtSystem::testenv ("CMTTESTPATTERN")) 754 756 { 755 c out<< "Pattern::expand1> line=[" << line << "]" << endl;757 cerr << "Pattern::expand1> line=[" << line << "]" << endl; 756 758 } 757 759 … … 760 762 if (replacement != "") 761 763 { 762 764 // Substitute templates from the cmt statement 763 765 replacement.replace_all ("<package>", context_use->get_package_name ().c_str ()); 764 766 replacement.replace_all ("<PACKAGE>", context_use->prefix.c_str ()); … … 801 803 if (CmtSystem::testenv ("CMTTESTPATTERN")) 802 804 { 803 c out<< "Pattern::expand2> repl=[" << replacement << "]" << endl;805 cerr << "Pattern::expand2> repl=[" << replacement << "]" << endl; 804 806 } 805 807 … … 816 818 void ApplyPattern::action (const CmtSystem::cmt_string_vector& words, Use* use) 817 819 { 818 819 820 821 822 823 824 820 // 821 // Expected syntax is 822 // 823 // apply_pattern <pattern-name> [ <template>=<value> ... ] 824 // or just 825 // <pattern-name> [ <template>=<value> ... ] 826 // 825 827 826 828 int first_word = 0; … … 849 851 /* 850 852 We then look for all <name>=<value> pairs 851 853 */ 852 854 enum 853 855 { … … 868 870 if (CmtSystem::testenv ("CMTTESTPATTERN")) 869 871 { 870 c out<< "ApplyPattern::action> " << name << " s=[" << s << "] state=" << state << endl;872 cerr << "ApplyPattern::action> " << name << " s=[" << s << "] state=" << state << endl; 871 873 } 872 874 … … 892 894 if (CmtSystem::testenv ("CMTTESTPATTERN")) 893 895 { 894 c out<< "ApplyPattern::action-1> n=[" << tname << "] v=[" << tvalue << "]" << endl;896 cerr << "ApplyPattern::action-1> n=[" << tname << "] v=[" << tvalue << "]" << endl; 895 897 } 896 898 … … 957 959 if (CmtSystem::testenv ("CMTTESTPATTERN")) 958 960 { 959 c out<< "ApplyPattern::action-2> n=[" << tname << "] v=[" << tvalue << "]" << endl;961 cerr << "ApplyPattern::action-2> n=[" << tname << "] v=[" << tvalue << "]" << endl; 960 962 } 961 963 … … 977 979 state = need_template; 978 980 979 980 981 cout<< "ApplyPattern::action-3> n=[" << tname << "] v=[" << tvalue << "]" << endl;982 981 if (CmtSystem::testenv ("CMTTESTPATTERN")) 982 { 983 cerr << "ApplyPattern::action-3> n=[" << tname << "] v=[" << tvalue << "]" << endl; 984 } 983 985 984 986 cmt_string tsearch = "<"; … … 1064 1066 if (CmtSystem::testenv ("CMTTESTPATTERN")) 1065 1067 { 1066 c out<< "ApplyPattern::apply> " << name << endl;1068 cerr << "ApplyPattern::apply> " << name << endl; 1067 1069 } 1068 1070 … … 1072 1074 if (CmtSystem::testenv ("CMTTESTPATTERN")) 1073 1075 { 1074 c out<< "ApplyPattern::apply> " << name << " not found" << endl;1076 cerr << "ApplyPattern::apply> " << name << " not found" << endl; 1075 1077 } 1076 1078 … … 1097 1099 void IgnorePattern::action (const CmtSystem::cmt_string_vector& words, Use* use) 1098 1100 { 1099 1100 1101 1102 1103 1101 // 1102 // Expected syntax is 1103 // 1104 // ignore_pattern <pattern-name> 1105 // 1104 1106 1105 1107 if (words.size () < 2) return; -
CMT/HEAD/source/cmt_project.cxx
r334 r400 185 185 - it can correspond to an existing project (ie already declared) 186 186 - it's a new project 187 188 187 - then it tries to read and parse its project file 188 */ 189 189 Project* ProjectFactory::create_project (const cmt_string& specified_name, 190 190 const cmt_string& path, … … 271 271 /* 272 272 Now Figure out the project name from the project file 273 274 273 or does not specify the project name 274 */ 275 275 bool has_project_file = false; 276 276 … … 343 343 // The specified name is not in the path. 344 344 /* 345 345 if (!Cmt::get_quiet ()) 346 346 { 347 348 349 347 cerr << "#CMT> Warning: specified project name " 348 << specified_name 349 << " from the caller does not match path." << endl; 350 350 } 351 351 */ … … 369 369 // The specified name is not in the path. 370 370 /* 371 371 if (!Cmt::get_quiet ()) 372 372 { 373 374 375 373 cerr << "#CMT> Warning: specified project name " 374 << specified_name 375 << " from project file and from caller does not match path." << endl; 376 376 } 377 377 */ … … 387 387 388 388 /* 389 if (!Cmt::get_quiet ())390 { 391 392 393 394 395 389 if (!Cmt::get_quiet ()) 390 { 391 cerr << "#CMT> Warning: specified project name " 392 << specified_name 393 << " inconsistent with name " 394 << project_name 395 << " from project file." << endl; 396 396 } 397 397 */ … … 438 438 439 439 /* 440 440 if (!Cmt::get_quiet ()) 441 441 { 442 443 444 442 cerr << "#CMT> Warning: specified project name " 443 << project_name 444 << " from project file does not match path." << endl; 445 445 } 446 446 */ … … 491 491 // The specified name is not in the path. 492 492 /* 493 493 if (!Cmt::get_quiet ()) 494 494 { 495 496 497 495 cerr << "#CMT> Warning: specified project name " 496 << specified_name 497 << " from project graph does not match path." << endl; 498 498 } 499 499 */ … … 577 577 578 578 // First create the Project.m_use for the policy 579 // cout << "About to add project policy package file [" << project->get_name()+"_project_policy" << "]" << endl; 579 580 580 Use* project_use = Use::create (project->get_cmtpath(), 581 "package_policy_for_project_" +project->get_name(),581 "package_policy_for_project_" + project->get_name(), 582 582 project->get_release (), "", ""); 583 project_use->done = true; //false; 584 project_use->discarded = false;//true; //false; 583 584 project_use->done = true; 585 project_use->discarded = false; 585 586 project_use->m_hidden = true; 586 587 project_use->selected = true; … … 591 592 592 593 593 // add at the uses level ?????594 /*static Use::UsePtrVector& uses = Use::get_ordered_uses ();595 596 597 598 599 600 601 602 603 604 605 594 // add at the uses level ????? 595 /*static Use::UsePtrVector& uses = Use::get_ordered_uses (); 596 bool found = false; 597 int size = uses.size (); 598 cerr << "\n size:"<<size<< ":" << endl; 599 for (int n = 0; n < size; n++) 600 { 601 Use* tuse = uses[n]; 602 cerr << "\tpackage file [" << tuse->get_package_name() << "]" <<project_use->get_package_name()<< endl; 603 if (tuse->get_package_name()==project_use->get_package_name()) 604 found=true; 605 606 } 606 607 607 608 608 if (not found) 609 { 609 610 uses.push_back (project_use); 610 611 project_use->m_index = uses.size () - 1; 611 612 } 612 613 */ 613 614 … … 635 636 const cmt_string& path) 636 637 { 637 cout << "------------------------------------------" << endl; 638 cout << "Configuring environment for project " << name << " " << release; 638 cmt_string pwd = CmtSystem::pwd (); 639 640 cerr << "------------------------------------------" << endl; 641 cerr << "Configuring environment for project " << name << " " << release << " (from " << pwd << ") "; 639 642 640 643 if (path != "") … … 643 646 } 644 647 645 c out<< endl;646 c out<< "CMT version " << Cmt::get_cmt_version () << "." << endl;647 c out<< "------------------------------------------" << endl;648 cerr << endl; 649 cerr << "CMT version " << Cmt::get_cmt_version () << "." << endl; 650 cerr << "------------------------------------------" << endl; 648 651 649 652 if (path != "") … … 651 654 if (!CmtSystem::mkdir (path)) 652 655 { 653 c out<< "Cannot create the " << path << " directory" << endl;656 cerr << "Cannot create the " << path << " directory" << endl; 654 657 return (false); 655 658 } … … 657 660 if (!CmtSystem::cd (path)) 658 661 { 659 c out<< "Cannot access the " << path << " directory" << endl;662 cerr << "Cannot access the " << path << " directory" << endl; 660 663 return (false); 661 664 } … … 664 667 if (!CmtSystem::mkdir (name)) 665 668 { 666 c out<< "Cannot create the " << name << " directory" << endl;669 cerr << "Cannot create the " << name << " directory" << endl; 667 670 return (false); 668 671 } … … 670 673 if (!CmtSystem::cd (name)) 671 674 { 672 c out<< "Cannot access the " << name << " directory" << endl;675 cerr << "Cannot access the " << name << " directory" << endl; 673 676 return (false); 674 677 } … … 678 681 if (!CmtSystem::mkdir (release)) 679 682 { 680 c out<< "Cannot create the " << release << " directory" << endl;683 cerr << "Cannot create the " << release << " directory" << endl; 681 684 return (false); 682 685 } … … 684 687 if (!CmtSystem::cd (release)) 685 688 { 686 c out<< "Cannot access the " << release << " directory" << endl;689 cerr << "Cannot access the " << release << " directory" << endl; 687 690 return (false); 688 691 } … … 693 696 if (!CmtSystem::mkdir ("cmt")) 694 697 { 695 c out<< "Cannot create the cmt directory" << endl;698 cerr << "Cannot create the cmt directory" << endl; 696 699 return (false); 697 700 } 698 701 else 699 702 { 700 c out<< "Installing the cmt directory" << endl;703 cerr << "Installing the cmt directory" << endl; 701 704 } 702 705 } … … 706 709 if (!CmtSystem::test_file (get_project_file_name ())) 707 710 { 708 c out<< "Creating a new project file" << endl;711 cerr << "Creating a new project file" << endl; 709 712 710 713 ofstream f (get_project_file_name ()); … … 717 720 else 718 721 { 719 c out<< "Cannot create the project file" << endl;722 cerr << "Cannot create the project file" << endl; 720 723 return (false); 721 724 } … … 731 734 p.commit (); 732 735 733 c out<< "project file already there" << endl;736 cerr << "project file already there" << endl; 734 737 } 735 738 … … 803 806 { 804 807 static ProjectVector& Projects = projects (); 805 806 //cout << "Project::add> name=" << name << endl;807 808 808 809 { … … 1198 1199 The goal is to generate CMTPATH even if this EV was not pre-set 1199 1200 which is the case when CMTPROJECTPATH is only used 1200 1201 */ 1201 1202 1202 1203 VisitorForFillCMTPATH visitor (buffer); … … 1442 1443 1443 1444 /**--------------------------------------------------------- 1444 A container statement is met in the project file1445 A container statement is met in the project file 1445 1446 */ 1446 1447 void Project::container_action (const cmt_string& name, const cmt_string& version) … … 1453 1454 1454 1455 /**--------------------------------------------------------- 1455 A use statement is met in the project file1456 A use statement is met in the project file 1456 1457 */ 1457 1458 void Project::use_action (const cmt_string& name, const cmt_string& release) … … 1479 1480 bool use_has_wild_card = (v == -1) || (r == -1) || (p == -1); 1480 1481 if (use_has_wild_card) 1481 {1482 { 1482 1483 cmt_string selected_release = ""; 1484 1483 1485 if (select_release(name, new_release,selected_release)) 1484 { // yes 1485 // c out<<"selected_release: "<<selected_release<<endl;1486 { 1487 // cerr <<"selected_release: "<<selected_release<<endl; 1486 1488 new_release = selected_release; 1487 1488 }1489 } 1490 } 1489 1491 1490 1492 cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH"); … … 1492 1494 sep = CmtSystem::path_separator (); 1493 1495 1494 //cerr << "cmtprojectpath = " << cmtprojectpath << endl;1495 1496 CmtSystem::cmt_string_vector items; 1496 1497 CmtSystem::split (cmtprojectpath, sep, items); … … 1510 1511 } 1511 1512 1512 if (CmtSystem::test_directory (p))1513 if (CmtSystem::test_directory (p)) 1513 1514 { 1514 1515 //cerr << "Project directory " << p << " exists " << endl; … … 1529 1530 1530 1531 if (p != 0) 1531 1532 1533 1534 1535 1536 1537 1532 { 1533 found = true; 1534 p->add_parent (this); 1535 add_child (p); 1536 1537 update_strategies_from_children (); 1538 } 1538 1539 } 1539 1540 … … 1547 1548 bool Project::select_release(const cmt_string& name, const cmt_string& release, cmt_string& result) 1548 1549 { 1549 cmt_string selected_release = ""; 1550 1551 int v = -1; 1552 int r = -1; 1553 int p = -1; 1554 CmtSystem::is_version_directory (release, v, r, p); 1555 1556 int selected_v = -1; 1557 int selected_r = -1; 1558 int selected_p = -1; 1559 CmtSystem::cmt_string_vector releases = get_project_releases(name); 1560 for (int j = 0; j < releases.size (); j++) 1561 { 1562 //cout <<releases[j]<<endl; 1563 int new_v = -1; 1564 int new_r = -1; 1565 int new_p = -1; 1566 CmtSystem::is_version_directory (releases[j], new_v, new_r, new_p); 1567 if (v == -1) 1568 { 1569 if (selected_v<new_v) 1570 { 1571 selected_v = new_v; 1572 selected_r = -1; 1573 selected_p = -1; 1574 selected_release = releases[j]; 1575 } 1576 else if (selected_v==new_v) 1577 { // We compare the r 1578 if (selected_r<new_r) 1579 { 1580 selected_r = new_r; 1581 selected_p = -1; 1582 selected_release = releases[j]; 1583 } 1584 else if (selected_r==new_r) 1585 { // We compare the p 1586 if (selected_p<new_p) 1587 { 1588 selected_p = new_p; 1589 selected_release = releases[j]; 1590 } 1591 // else if ? not possible 1592 } 1593 } 1594 } 1595 else if (r == -1) 1596 { 1597 if (v==new_v) 1598 { // We compare the r 1599 if (selected_r<new_r) 1600 { 1601 selected_r = new_r; 1602 selected_p = -1; 1603 selected_release = releases[j]; 1604 } 1605 else if (selected_r==new_r) 1606 { // We compare the p 1607 if (selected_p<new_p) 1608 { 1609 selected_p = new_p; 1610 selected_release = releases[j]; 1611 } 1612 // else if ? not possible 1613 } 1614 } 1615 } 1616 else if (p == -1) 1617 { 1618 if (v==new_v && r==new_r) 1619 { // We compare the p 1620 if (selected_p<new_p) 1621 { 1622 selected_p = new_p; 1623 selected_release = releases[j]; 1624 } 1625 // else if ? not possible 1626 } 1627 } 1628 //cerr<<"v:"<<new_v<<", r:"<<new_r<<", p:"<<new_p<<endl; 1629 //cerr<<"req v:"<<v<<", req r:"<<r<<", req p:"<<p<<endl; 1630 } 1631 //cerr <<"selected release: "<<selected_release<<endl; 1632 if (selected_release == "") 1633 return false; 1634 result = selected_release; 1635 return true; 1550 cmt_string selected_release = ""; 1551 1552 int v = -1; 1553 int r = -1; 1554 int p = -1; 1555 CmtSystem::is_version_directory (release, v, r, p); 1556 1557 int selected_v = -1; 1558 int selected_r = -1; 1559 int selected_p = -1; 1560 CmtSystem::cmt_string_vector releases = get_project_releases(name); 1561 for (int j = 0; j < releases.size (); j++) 1562 { 1563 int new_v = -1; 1564 int new_r = -1; 1565 int new_p = -1; 1566 CmtSystem::is_version_directory (releases[j], new_v, new_r, new_p); 1567 if (v == -1) 1568 { 1569 if (selected_v < new_v) 1570 { 1571 selected_v = new_v; 1572 selected_r = -1; 1573 selected_p = -1; 1574 selected_release = releases[j]; 1575 } 1576 else if (selected_v == new_v) 1577 { 1578 // We compare the r 1579 if (selected_r < new_r) 1580 { 1581 selected_r = new_r; 1582 selected_p = -1; 1583 selected_release = releases[j]; 1584 } 1585 else if (selected_r == new_r) 1586 { 1587 // We compare the p 1588 if (selected_p < new_p) 1589 { 1590 selected_p = new_p; 1591 selected_release = releases[j]; 1592 } 1593 // else if ? not possible 1594 } 1595 } 1596 } 1597 else if (r == -1) 1598 { 1599 if (v == new_v) 1600 { 1601 // We compare the r 1602 if (selected_r < new_r) 1603 { 1604 selected_r = new_r; 1605 selected_p = -1; 1606 selected_release = releases[j]; 1607 } 1608 else if (selected_r == new_r) 1609 { 1610 // We compare the p 1611 if (selected_p < new_p) 1612 { 1613 selected_p = new_p; 1614 selected_release = releases[j]; 1615 } 1616 // else if ? not possible 1617 } 1618 } 1619 } 1620 else if (p == -1) 1621 { 1622 if ((v == new_v) && (r == new_r)) 1623 { 1624 // We compare the p 1625 if (selected_p < new_p) 1626 { 1627 selected_p = new_p; 1628 selected_release = releases[j]; 1629 } 1630 // else if ? not possible 1631 } 1632 } 1633 1634 //cerr << "v:" << new_v << ", r:" << new_r << ", p:" << new_p << endl; 1635 //cerr << "req v:" << v << ", req r:" << r << ", req p:" << p << endl; 1636 1637 } 1638 1639 // cerr << "selected release: " << selected_release << endl; 1640 1641 if (selected_release == "") return false; 1642 1643 result = selected_release; 1644 1645 return (true); 1636 1646 } 1637 1647 1638 1648 //--------------------------------------------------------- 1639 const CmtSystem::cmt_string_vector Project::get_project_releases(const cmt_string& name) const 1640 { 1641 CmtSystem::cmt_string_vector releases; 1642 cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH"); 1643 cmt_string sep; 1644 sep = CmtSystem::path_separator (); 1645 1646 CmtSystem::cmt_string_vector items; 1647 CmtSystem::split (cmtprojectpath, sep, items); 1648 for (int i = 0; i < items.size (); i++) 1649 { 1650 const cmt_string& item = items[i]; 1651 cmt_string p = item; 1652 p += CmtSystem::file_separator (); 1653 p += name; 1654 if (CmtSystem::test_directory (p)) 1655 { 1656 CmtSystem::cmt_string_vector directories; 1657 CmtSystem::scan_dir (p, directories); 1658 for (int j = 0; j < directories.size (); j++) 1659 { 1660 if (CmtSystem::test_directory(directories[j])) 1661 { 1662 cmt_string release; 1663 CmtSystem:: basename(directories[j], release); 1664 if (CmtSystem::is_version_directory(release)) 1665 { 1666 cmt_string& name_entry = releases.add (); 1667 name_entry = release; 1668 //cout << release <<endl; 1669 } 1670 } 1671 } 1672 } 1673 } 1674 return (releases); 1649 const CmtSystem::cmt_string_vector Project::get_project_releases (const cmt_string& name) const 1650 { 1651 CmtSystem::cmt_string_vector releases; 1652 cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH"); 1653 1654 static cmt_string sep = CmtSystem::path_separator (); 1655 1656 CmtSystem::cmt_string_vector items; 1657 CmtSystem::split (cmtprojectpath, sep, items); 1658 1659 for (int i = 0; i < items.size (); i++) 1660 { 1661 const cmt_string& item = items[i]; 1662 cmt_string p = item; 1663 p += CmtSystem::file_separator (); 1664 p += name; 1665 1666 if (CmtSystem::test_directory (p)) 1667 { 1668 CmtSystem::cmt_string_vector directories; 1669 CmtSystem::scan_dir (p, directories); 1670 1671 for (int j = 0; j < directories.size (); j++) 1672 { 1673 if (CmtSystem::test_directory(directories[j])) 1674 { 1675 cmt_string release; 1676 CmtSystem:: basename(directories[j], release); 1677 1678 if (CmtSystem::is_version_directory(release)) 1679 { 1680 cmt_string& name_entry = releases.add (); 1681 name_entry = release; 1682 } 1683 } 1684 } 1685 } 1686 } 1687 return (releases); 1675 1688 } 1676 1689 … … 1949 1962 1950 1963 (This is not a specification : see the set_strategy method) 1951 1964 */ 1952 1965 void Project::update_strategy (StrategyDef* definition, bool b_value) 1953 1966 { … … 2002 2015 We need to update the strategy value accordingly 2003 2016 This will not change the specified value for this strategy 2004 2017 */ 2005 2018 void Project::update_strategy_from_children (StrategyDef* definition) 2006 2019 { … … 2093 2106 We need to update the strategy values accordingly 2094 2107 This will not change the specified values 2095 2108 */ 2096 2109 void Project::update_strategies_from_children () 2097 2110 { … … 2118 2131 /**---------------------------------------------------------- 2119 2132 The StrategyMgr singleton 2120 2133 */ 2121 2134 StrategyMgr& StrategyMgr::instance () 2122 2135 { … … 2128 2141 The StrategyMgr constructor 2129 2142 Here are primarily constructed all strategy definitions 2130 2143 */ 2131 2144 StrategyMgr::StrategyMgr () 2132 2145 { … … 2206 2219 /**---------------------------------------------------------- 2207 2220 Find a strategy definition by its name 2208 2221 */ 2209 2222 StrategyDef* StrategyMgr::find_strategy (const cmt_string& name) 2210 2223 { … … 2227 2240 /**---------------------------------------------------------- 2228 2241 Retreive the default value defined for a given strategy 2229 2242 */ 2230 2243 bool StrategyMgr::get_default_strategy (const cmt_string& name) 2231 2244 { … … 2238 2251 Retreive the priority value defined for a given strategy 2239 2252 This value is used when two children of a project request two conflicting strategy values 2240 2253 */ 2241 2254 bool StrategyMgr::get_priority_strategy (const cmt_string& name) 2242 2255 { … … 2248 2261 /**---------------------------------------------------------- 2249 2262 Return the vector of all existing strategy definitions 2250 2263 */ 2251 2264 StrategyDef::StrategyDefs& StrategyMgr::get_definitions () 2252 2265 { … … 2276 2289 Specify a new value for this strategy. 2277 2290 This only happens when a strategy statement is met in a project file or in a requirements file. 2278 2291 */ 2279 2292 void Strategy::set (StrategyDef* definition, bool value, const cmt_string& project_name) 2280 2293 { … … 2292 2305 This has no impact on to the specified value. 2293 2306 This will adapt the tag settings 2294 2307 */ 2295 2308 void Strategy::update (StrategyDef* definition, bool value, const cmt_string& project_name) 2296 2309 { … … 2332 2345 m_on_tag->mark (); 2333 2346 } 2347 2334 2348 //----------------------------------------------------------- 2335 2349 const cmt_string& StrategyDef::get_default_value () const … … 2344 2358 } 2345 2359 } 2360 2346 2361 //----------------------------------------------------------- 2347 2362 void Project::set_author (const cmt_string& name) 2348 2363 { 2349 cout<<"set_author"<<name<<endl;2364 // cerr << "set_author" << name << endl; 2350 2365 this->m_author = name; 2351 2366 } 2367 2352 2368 //----------------------------------------------------------- 2353 2369 const cmt_string& Project::get_author () const … … 2355 2371 return (m_author); 2356 2372 } 2373 2357 2374 //----------------------------------------------------------- 2358 2375 void Project::project_author_action (const CmtSystem::cmt_string_vector& words) 2359 2376 { 2360 2377 if (m_author != "") m_author += "\n"; 2378 2361 2379 for (int i = 1; i < words.size (); i++) 2362 2380 { … … 2367 2385 } 2368 2386 } 2387 2369 2388 //----------------------------------------------------------- 2370 2389 Use* Project::get_use () const 2371 2390 { 2372 2391 return m_use; 2373 2392 } 2393 2374 2394 //----------------------------------------------------------- 2375 2395 void Project::set_use (Use* use) 2376 2396 { 2377 this->m_use = use; 2378 } 2397 this->m_use = use; 2398 } 2399 2379 2400 //----------------------------------------------------------- -
CMT/HEAD/source/cmt_regexp.cxx
r11 r400 17 17 18 18 static int tab_level = 0; 19 19 20 static void tab () 20 21 { 21 22 for (int i = 0; i < tab_level; i++) 22 23 { 23 c out<< " ";24 cerr << " "; 24 25 } 25 26 } … … 287 288 288 289 const cmt_regexp::iterator cmt_regexp_node::match (const cmt_string& /*text*/, 289 290 int /*pos*/) const 290 291 { 291 292 return (cmt_regexp::iterator::null()); … … 345 346 void cmt_char_node::dump () const 346 347 { 347 tab (); c out<< "char>(" << this << ") c=" << _c << endl;348 tab (); cerr << "char>(" << this << ") c=" << _c << endl; 348 349 } 349 350 … … 357 358 358 359 const cmt_regexp::iterator cmt_string_node::match (const cmt_string& text, 359 360 int pos) const 360 361 { 361 362 if ((pos < 0) || (pos > text.size ())) … … 378 379 void cmt_string_node::dump () const 379 380 { 380 tab (); c out<< "string (" << this << ") s=[" << _s << "]" << endl;381 tab (); cerr << "string (" << this << ") s=[" << _s << "]" << endl; 381 382 } 382 383 … … 399 400 switch (c) 400 401 { 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 402 case '-': 403 i++; 404 { 405 char c1 = _choices[_choices.size () - 1]; 406 char c2 = list[i]; 407 int j; 408 int j0 = (c1 < c2) ? c1 : c2; 409 int j1 = (c1 > c2) ? c1 : c2; 410 for (j = j0; j <= j1; j++) 411 { 412 _choices += j; 413 } 414 } 415 break; 416 case '\\': 417 i++; 418 c = list[i]; 419 switch (c) 420 { 421 case '[': 422 case ']': 423 case '(': 424 case ')': 425 case '.': 426 case '*': 427 case '?': 428 case '^': 429 case '$': 430 case '\\': 431 c = '\\'; 432 break; 433 case 'r': 434 c = '\r'; 435 break; 436 case 't': 437 c = '\t'; 438 break; 439 case 'n': 440 c = '\n'; 441 break; 442 default: 443 break; 444 } 445 default: 446 _choices += c; 447 break; 447 448 } 448 449 } … … 450 451 451 452 const cmt_regexp::iterator cmt_char_list_node::match (const cmt_string& text, 452 453 int pos) const 453 454 { 454 455 if ((pos < 0) || (pos > text.size ())) … … 471 472 void cmt_char_list_node::dump () const 472 473 { 473 tab (); c out<< "char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl;474 tab (); cerr << "char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl; 474 475 } 475 476 … … 478 479 //---------------------------------------------------------- 479 480 cmt_not_char_list_node::cmt_not_char_list_node (cmt_string list) : 480 481 cmt_char_list_node (list) 481 482 { 482 483 } 483 484 484 485 const cmt_regexp::iterator cmt_not_char_list_node::match (const cmt_string& text, 485 486 int pos) const 486 487 { 487 488 if ((pos < 0) || (pos > text.size ())) … … 504 505 void cmt_not_char_list_node::dump () const 505 506 { 506 tab (); c out<< "not_char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl;507 tab (); cerr << "not_char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl; 507 508 } 508 509 … … 512 513 //---------------------------------------------------------- 513 514 const cmt_regexp::iterator cmt_any_node::match (const cmt_string& text, 514 515 int pos) const 515 516 { 516 517 if ((pos < 0) | (pos >= text.size ())) … … 524 525 void cmt_any_node::dump () const 525 526 { 526 tab (); c out<< "any (" << this << ") " << endl;527 tab (); cerr << "any (" << this << ") " << endl; 527 528 } 528 529 … … 540 541 541 542 const cmt_regexp::iterator cmt_zero_one::match (const cmt_string& text, 542 543 int pos) const 543 544 { 544 545 if ((pos < 0) || (pos > text.size ())) … … 564 565 void cmt_zero_one::dump () const 565 566 { 566 tab (); cout << "zero_one (" << this << ") " << endl; 567 tab (); cerr << "zero_one (" << this << ") " << endl; 568 567 569 if (_node != 0) 568 570 { … … 602 604 void cmt_many_node::dump () const 603 605 { 604 tab (); cout << "many (" << this << ") " << endl; 606 tab (); cerr << "many (" << this << ") " << endl; 607 605 608 if (_node != 0) 606 609 { … … 609 612 tab_level--; 610 613 } 614 611 615 tab_level++; 612 616 _follower.dump (); … … 624 628 625 629 const cmt_regexp::iterator cmt_zero_more::match (const cmt_string& text, 626 630 int pos) const 627 631 { 628 632 if ((pos < 0) || (pos > text.size ())) … … 699 703 void cmt_zero_more::dump () const 700 704 { 701 tab (); cout << "zero_more (" << this << ") " << endl; 705 tab (); cerr << "zero_more (" << this << ") " << endl; 706 702 707 if (_node != 0) 703 708 { … … 706 711 tab_level--; 707 712 } 713 708 714 _follower.dump (); 709 715 } … … 717 723 718 724 const cmt_regexp::iterator cmt_one_more::match (const cmt_string& text, 719 725 int pos) const 720 726 { 721 727 if ((pos < 0) || (pos > text.size ())) … … 798 804 void cmt_one_more::dump () const 799 805 { 800 tab (); cout << "one_more (" << this << ") " << endl; 806 tab (); cerr << "one_more (" << this << ") " << endl; 807 801 808 if (_node != 0) 802 809 { … … 805 812 tab_level--; 806 813 } 814 807 815 tab_level++; 808 816 _follower.dump (); … … 816 824 //---------------------------------------------------------- 817 825 const cmt_regexp::iterator cmt_begin_node::match (const cmt_string& /*text*/, 818 826 int pos) const 819 827 { 820 828 if (pos == 0) return (cmt_regexp::iterator (pos, 0)); … … 824 832 void cmt_begin_node::dump () const 825 833 { 826 tab (); c out<< "begin (" << this << ") " << endl;834 tab (); cerr << "begin (" << this << ") " << endl; 827 835 } 828 836 //---------------------------------------------------------- … … 838 846 void cmt_end_node::dump () const 839 847 { 840 tab (); c out<< "end (" << this << ") " << endl;848 tab (); cerr << "end (" << this << ") " << endl; 841 849 } 842 850 //---------------------------------------------------------- … … 930 938 void cmt_regexp_node_set::dump () const 931 939 { 932 tab (); c out<< "regexp_node_set (" << this << ") " << endl;940 tab (); cerr << "regexp_node_set (" << this << ") " << endl; 933 941 } 934 942 935 943 void cmt_regexp_node_set::dump (const cmt_string& title) const 936 944 { 937 tab (); cout << "Set (" << this << ") father=" << _father << " pars=" << _parentheses << endl; 945 tab (); cerr << "Set (" << this << ") father=" << _father << " pars=" << _parentheses << endl; 946 938 947 for (int i = 0; i < _nodes.size (); i++) 939 948 { … … 943 952 if (i > 0) 944 953 { 945 tab (); c out<< title << endl;954 tab (); cerr << title << endl; 946 955 } 947 956 tab_level++; … … 950 959 } 951 960 } 952 tab (); cout << "EndSet (" << this << ")" << endl; 961 962 tab (); cerr << "EndSet (" << this << ")" << endl; 953 963 } 954 964 //---------------------------------------------------------- … … 978 988 979 989 bool dbg = CmtSystem::testenv ("CMTTESTREGEXP"); 980 if (dbg) {tab (); cout << "match and (" << this << ") pos=" << pos << endl;} 990 991 if (dbg) {tab (); cerr << "match and (" << this << ") pos=" << pos << endl;} 981 992 982 993 for (i = 0; i < _nodes.size (); i++) … … 988 999 if (dbg) tab_level--; 989 1000 990 if (dbg) {tab (); c out<< " -> it(" << n << ") p=" << it._pos << " l=" << it._length << endl;}1001 if (dbg) {tab (); cerr << " -> it(" << n << ") p=" << it._pos << " l=" << it._length << endl;} 991 1002 992 1003 if (it == cmt_regexp::iterator::null ()) return (it); … … 996 1007 } 997 1008 998 1009 // All nodes match 999 1010 1000 1011 return (cmt_regexp::iterator (pos, total)); … … 1105 1116 1106 1117 bool dbg = CmtSystem::testenv ("CMTTESTREGEXP"); 1107 if (dbg) {tab (); cout << "match or (" << this << ") pos=" << pos << endl;} 1118 1119 if (dbg) {tab (); cerr << "match or (" << this << ") pos=" << pos << endl;} 1108 1120 1109 1121 int i; … … 1127 1139 } 1128 1140 1129 1141 // at least one or-ed expression matches 1130 1142 // if (it != cmt_regexp::iterator::null ()) return (it); 1131 1143 } … … 1175 1187 } 1176 1188 1177 1178 1179 1180 1181 1182 1189 // 1190 // The root is the cmt_or_node which will be returned. It is 1191 // the top of the hierarchy. 1192 // 1193 // top is the running cmt_and_node. 1194 // 1183 1195 cmt_regexp_node_set* or_root = 0; 1184 1196 cmt_regexp_node_set* top_and = 0; 1185 1197 1186 // abcd 1187 // ab|cd 1188 // a|b|cd 1189 // a|b*|cd 1190 // a|b*|cd?e 1198 // abcd 1199 // ab|cd 1200 // a|b|cd 1201 // a|b*|cd 1202 // a|b*|cd?e 1203 // 1204 // exp : and 1205 // | exp '|' and 1206 // 1207 // and : unary 1208 // | unary and 1209 // 1210 // unary : primary '*' 1211 // | primary '?' 1212 // 1213 // primary : '[' opt_begin opt_chars opt_end ']' 1214 // | '^' 1215 // | '$' 1216 // | char 1217 // | '(' exp ')' 1218 // 1219 1220 { 1191 1221 // 1192 // exp : and1193 // | exp '|' and1222 // First we build an cmt_or_node (corresponding to the 1223 // first grammatical rule) 1194 1224 // 1195 // and : unary1196 // | unary and1225 // Then cmt_and_nodes are pushed into it. 1226 // and standard nodes are pushed into the running (top_and) cmt_and_node 1197 1227 // 1198 // unary : primary '*'1199 // | primary '?'1200 //1201 // primary : '[' opt_begin opt_chars opt_end ']'1202 // | '^'1203 // | '$'1204 // | char1205 // | '(' exp ')'1206 //1207 1208 {1209 //1210 // First we build an cmt_or_node (corresponding to the1211 // first grammatical rule)1212 //1213 // Then cmt_and_nodes are pushed into it.1214 // and standard nodes are pushed into the running (top_and) cmt_and_node1215 //1216 1228 or_root = new cmt_or_node (0); 1217 1229 top_and = new cmt_and_node (or_root); … … 1225 1237 switch (c) 1226 1238 { 1227 1239 case '[': 1228 1240 { 1229 1230 1231 1232 1233 1234 1241 // 1242 // The case is 1243 // 1244 // exp : '[' char ... ']' 1245 // exp : '[' '^' char ... ']' 1246 // 1235 1247 1236 1248 if (i >= expression.size ()) 1237 1249 { 1238 1250 // syntax error : unbalanced '[' 1239 1251 delete or_root; 1240 1252 return; … … 1254 1266 switch (c) 1255 1267 { 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1268 case ']': 1269 done = true; 1270 break; 1271 case '^': 1272 if (i == i0) has_not = true; 1273 else choices += c; 1274 break; 1275 case '\\': 1276 choices += c; 1277 if (i >= expression.size ()) 1278 { 1279 // syntax error : unbalanced '[' and unfinished 1280 // escape sequence 1281 delete or_root; 1282 return; 1283 } 1284 i++; 1285 c = expression[i]; 1286 choices += c; 1287 break; 1288 default: 1289 choices += c; 1290 break; 1279 1291 } 1280 1292 if (done) break; … … 1283 1295 if (!done) 1284 1296 { 1285 1297 // syntax error : unbalanced '[' 1286 1298 delete or_root; 1287 1299 return; … … 1293 1305 } 1294 1306 break; 1295 1307 case '*': 1296 1308 { 1297 1298 1299 1309 // 1310 // exp : exp '*' 1311 // 1300 1312 if (top_and->nodes () == 0) 1301 1313 { 1302 1314 // Syntax error : '*' is not preceded by an expression 1303 1315 delete or_root; 1304 1316 return; … … 1309 1321 } 1310 1322 break; 1311 1323 case '+': 1312 1324 { 1313 1314 1315 1325 // 1326 // exp : exp '+' 1327 // 1316 1328 if (top_and->nodes () == 0) 1317 1329 { 1318 1330 // Syntax error : '+' is not preceded by an expression 1319 1331 delete or_root; 1320 1332 return; … … 1325 1337 } 1326 1338 break; 1327 1339 case '?': 1328 1340 { 1329 1330 1331 1341 // 1342 // exp : exp '?' 1343 // 1332 1344 if (top_and->nodes () == 0) 1333 1345 { 1334 1346 // Syntax error : '?' is not preceded by an expression 1335 1347 delete or_root; 1336 1348 return; … … 1341 1353 } 1342 1354 break; 1343 1344 1345 1346 1347 1348 1349 1355 case '.': 1356 // 1357 // exp : '.' 1358 // 1359 top_and->push (new cmt_any_node ()); 1360 break; 1361 case '(': 1350 1362 { 1351 1352 1353 1363 // 1364 // exp : '(' exp ')' 1365 // 1354 1366 if (top_and->parentheses ()) 1355 1367 { 1356 1368 // This should never happen. 1357 1369 delete or_root; 1358 1370 return; … … 1361 1373 top_and->set_parentheses (true); 1362 1374 1363 1364 1365 1366 1375 // 1376 // A new complete expression is started. 1377 // -> do as for top_and parsing. 1378 // 1367 1379 1368 1380 top_and = new cmt_and_node (new cmt_or_node (top_and)); 1369 1381 } 1370 1382 break; 1371 1383 case ')': 1372 1384 { 1373 1374 1375 1376 1377 1385 // 1386 // exp : '(' exp ')' 1387 // 1388 1389 // top_and is the cmt_and_node into which new nodes are pushed. 1378 1390 cmt_regexp_node_set* or_node = top_and->father (); 1379 1391 if (or_node == 0) 1380 1392 { 1381 1382 1393 // This should never happen : top_and should always be 1394 // at least an cmt_and_node hanging at an cmt_or_node 1383 1395 delete or_root; 1384 1396 return; 1385 1397 } 1386 1398 1387 1388 1389 1399 // 1400 // The last cmt_and_node was empty, thus we had either '()' or '(...|)' 1401 // 1390 1402 1391 1403 if (top_and->nodes () == 0) … … 1402 1414 if (top_and == 0) 1403 1415 { 1404 1416 // Syntax error : too many ')' 1405 1417 delete or_root; 1406 1418 return; 1407 1419 } 1408 1420 1409 1410 1411 1412 1413 1414 1421 // 1422 // top_and is now the previous running cmt_and_node where the '(' 1423 // was originally met its top_and node contains the parenthesized 1424 // sub expression If this one is empty, (due to an empty '()' 1425 // expression) then it may simply be discarded. 1426 // 1415 1427 1416 1428 if (!top_and->parentheses ()) 1417 1429 { 1418 1430 // Syntax error : too many ')' 1419 1431 delete or_root; 1420 1432 return; … … 1443 1455 1444 1456 break; 1445 1457 case '|': 1446 1458 { 1447 1448 1449 1459 // 1460 // exp : exp '|' exp 1461 // 1450 1462 1451 1463 cmt_regexp_node_set* or_node = top_and->father (); … … 1453 1465 top_and->reduce (); 1454 1466 1455 1456 1457 1467 // 1468 // or is the father cmt_or_node, which only contains cmt_and_nodes 1469 // 1458 1470 1459 1471 const cmt_regexp_node_set* and_node = (cmt_regexp_node_set*) or_node->top (); 1460 1472 if (and_node->nodes () == 0) 1461 1473 { 1462 1463 1474 // the previous node was empty. 1475 // we may discard it 1464 1476 or_node->pop (); 1465 1477 } … … 1468 1480 } 1469 1481 break; 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1482 case '^': 1483 // 1484 // exp : '^' 1485 // 1486 top_and->push (new cmt_begin_node ()); 1487 break; 1488 case '$': 1489 // 1490 // exp : '$' 1491 // 1492 top_and->push (new cmt_end_node ()); 1493 break; 1494 case '\\': 1495 if (i >= expression.size ()) 1496 { 1497 delete or_root; 1498 return; 1499 } 1500 i++; 1501 c = expression[i]; 1502 switch (c) 1503 { 1504 case '[': 1505 case ']': 1506 case '(': 1507 case ')': 1508 case '.': 1509 case '*': 1510 case '?': 1511 case '^': 1512 case '$': 1513 case '\\': 1514 break; 1515 case 'r': 1516 c = '\r'; 1517 break; 1518 case 't': 1519 c = '\t'; 1520 break; 1521 case 'n': 1522 c = '\n'; 1523 break; 1524 default: 1525 break; 1526 } 1527 default: 1528 top_and->push (new cmt_char_node (c)); 1529 break; 1518 1530 } 1519 1531 } … … 1525 1537 if (or_root->nodes () == 1) 1526 1538 { 1527 1528 1529 1530 1539 // 1540 // Check whether there is at least one non-empty 1541 // cmt_and_node 1542 // 1531 1543 if (and_node->nodes () == 0) 1532 1544 { -
CMT/HEAD/source/cmt_script.cxx
r11 r400 203 203 switch (mode) 204 204 { 205 206 207 208 209 210 211 212 205 case Csh : 206 suffix = ".csh"; 207 cout << "source "; 208 break; 209 case Sh : 210 suffix = ".sh"; 211 cout << ". "; 212 break; 213 213 } 214 214 -
CMT/HEAD/source/cmt_sequence.cxx
r11 r400 33 33 void SequenceRunner::filter (const cmt_string& line) 34 34 { 35 //cout<< "line=[" << line << "]" << endl;35 //cerr << "line=[" << line << "]" << endl; 36 36 37 37 CmtSystem::cmt_string_vector words; … … 51 51 buffer.write (filename); 52 52 cout << "%%Writing file " << filename << endl; 53 //cout<< buffer << endl;53 //cerr << buffer << endl; 54 54 buffer = ""; 55 55 … … 164 164 buffer.write (filename); 165 165 cout << "%%Writing file " << filename << endl; 166 //cout<< buffer << endl;166 //cerr << buffer << endl; 167 167 buffer = ""; 168 168 } -
CMT/HEAD/source/cmt_symbol.cxx
r257 r400 878 878 if (Cmt::get_warnings ()) 879 879 { 880 c out<< "#CMT> Warning: Wrong path item " << t << " in " << name << endl;880 cerr << "#CMT> Warning: Wrong path item " << t << " in " << name << endl; 881 881 } 882 882 … … 1286 1286 else 1287 1287 { 1288 //c out<< "...discarding old values for symbol " << name << " text=[" << text << "]" << endl;1288 //cerr << "...discarding old values for symbol " << name << " text=[" << text << "]" << endl; 1289 1289 1290 1290 for (int i = 0; i < (value_lists.size () - 1); i++) … … 1477 1477 else 1478 1478 { 1479 //cout << "; ";1480 1479 cout << endl; 1481 1480 } … … 2238 2237 if (CmtSystem::getenv ("TESTPRR") != "") 2239 2238 { 2240 c out<< "PRR> s=[" << s << "]";2239 cerr << "PRR> s=[" << s << "]"; 2241 2240 } 2242 2241 … … 2247 2246 if (CmtSystem::getenv ("TESTPRR") != "") 2248 2247 { 2249 c out<< " match ";2248 cerr << " match "; 2250 2249 } 2251 2250 } … … 2254 2253 if (CmtSystem::getenv ("TESTPRR") != "") 2255 2254 { 2256 c out<< " no match ";2255 cerr << " no match "; 2257 2256 } 2258 2257 } … … 2260 2259 if (CmtSystem::getenv ("TESTPRR") != "") 2261 2260 { 2262 c out<< endl;2261 cerr << endl; 2263 2262 } 2264 2263 } -
CMT/HEAD/source/cmt_syntax.cxx
r399 r400 31 31 } 32 32 void action (const CmtSystem::cmt_string_vector& words, 33 34 35 33 Project* project, 34 const cmt_string& file_name, 35 int line_number) 36 36 {} 37 37 }; … … 48 48 } 49 49 void action (const CmtSystem::cmt_string_vector& words, 50 51 52 50 Project* project, 51 const cmt_string& file_name, 52 int line_number) 53 53 {} 54 54 … … 64 64 { 65 65 if (use == &(Use::current ())) 66 {67 68 }66 { 67 Constituent::action (Application, words); 68 } 69 69 } 70 70 71 71 void action (const CmtSystem::cmt_string_vector& words, 72 73 74 72 Project* project, 73 const cmt_string& file_name, 74 int line_number) 75 75 {} 76 76 … … 88 88 } 89 89 void action (const CmtSystem::cmt_string_vector& words, 90 91 92 90 Project* project, 91 const cmt_string& file_name, 92 int line_number) 93 93 {} 94 94 … … 106 106 } 107 107 void action (const CmtSystem::cmt_string_vector& words, 108 109 110 111 { 112 113 108 Project* project, 109 const cmt_string& file_name, 110 int line_number) 111 { 112 action (words, project->get_use(), file_name, line_number); 113 } 114 114 115 115 }; … … 128 128 } 129 129 void action (const CmtSystem::cmt_string_vector& words, 130 131 132 133 { 134 135 130 Project* project, 131 const cmt_string& file_name, 132 int line_number) 133 { 134 cmt_string author; 135 project->project_author_action (words); 136 136 } 137 137 }; … … 153 153 } 154 154 void action (const CmtSystem::cmt_string_vector& words, 155 156 157 155 Project* project, 156 const cmt_string& file_name, 157 int line_number) 158 158 {} 159 159 … … 170 170 171 171 /*Symbol* symbol = Symbol::find ("use_strategy"); 172 if (symbol != 0)173 {172 if (symbol != 0) 173 { 174 174 cmt_string s = symbol->build_macro_value (); 175 175 Symbol::expand (s); 176 176 cerr <<"# value s: "<<s<<endl; 177 } */177 } */ 178 178 179 179 Symbol::expand(value); … … 221 221 for (int i = 1; i < words.size (); i++) 222 222 { 223 224 225 226 227 228 229 230 231 223 const cmt_string& w = words[i]; 224 225 cmt_string strategy; 226 cmt_string value; 227 228 bool in_error = false; 229 230 if (decode (w, strategy, value)) 231 { 232 232 233 233 if (p != 0) p->set_strategy (strategy, value, use->get_package_name ()); 234 234 } 235 235 else … … 247 247 int line_number) 248 248 { 249 250 // action (words, project->get_use(), file_name, line_number); 251 // cout<<project->get_use()->get_strategy("InstallArea")<<endl; 249 // action (words, project->get_use(), file_name, line_number); 250 // cerr << project->get_use()->get_strategy ("InstallArea") << endl; 252 251 253 252 254 255 { 256 257 258 259 253 for (int i = 1; i < words.size (); i++) 254 { 255 const cmt_string& w = words[i]; 256 257 cmt_string strategy; 258 cmt_string value; 260 259 261 260 bool in_error = false; … … 264 263 { 265 264 if (project != 0) 266 {267 268 269 270 s+= words[i];271 s+= "\n";272 273 274 275 276 277 278 279 280 281 282 283 284 }265 { 266 // project->set_strategy (strategy, value, project->get_use()->get_package_name ()); 267 project->set_strategy (strategy, value, ""); 268 cmt_string s = "build_strategy "; 269 s += words[i]; 270 s += "\n"; 271 bool no_found = true; 272 int size = project->m_extra_lines.size (); 273 for (int n = 0; n < size; n++) 274 { 275 if (s==project->m_extra_lines[n]) 276 no_found = false; 277 } 278 if (no_found) 279 { 280 cmt_string & buffer = project->m_extra_lines.add(); 281 buffer = s; 282 } 283 } 285 284 } 286 285 else … … 306 305 } 307 306 void action (const CmtSystem::cmt_string_vector& words, 308 309 310 307 Project* project, 308 const cmt_string& file_name, 309 int line_number) 311 310 {} 312 311 }; … … 323 322 } 324 323 void action (const CmtSystem::cmt_string_vector& words, 325 326 327 324 Project* project, 325 const cmt_string& file_name, 326 int line_number) 328 327 {} 329 328 … … 342 341 343 342 void action (const CmtSystem::cmt_string_vector& words, 344 345 346 343 Project* project, 344 const cmt_string& file_name, 345 int line_number) 347 346 {} 348 347 }; … … 381 380 } 382 381 void action (const CmtSystem::cmt_string_vector& words, 383 384 385 382 Project* project, 383 const cmt_string& file_name, 384 int line_number) 386 385 {} 387 386 … … 402 401 } 403 402 void action (const CmtSystem::cmt_string_vector& words, 404 405 406 403 Project* project, 404 const cmt_string& file_name, 405 int line_number) 407 406 {} 408 407 }; … … 422 421 } 423 422 void action (const CmtSystem::cmt_string_vector& words, 424 425 426 423 Project* project, 424 const cmt_string& file_name, 425 int line_number) 427 426 {} 428 427 }; … … 439 438 } 440 439 void action (const CmtSystem::cmt_string_vector& words, 441 442 443 440 Project* project, 441 const cmt_string& file_name, 442 int line_number) 444 443 {} 445 444 … … 457 456 } 458 457 void action (const CmtSystem::cmt_string_vector& words, 459 460 461 458 Project* project, 459 const cmt_string& file_name, 460 int line_number) 462 461 {} 463 462 … … 478 477 } 479 478 void action (const CmtSystem::cmt_string_vector& words, 480 481 482 479 Project* project, 480 const cmt_string& file_name, 481 int line_number) 483 482 {} 484 483 … … 496 495 } 497 496 void action (const CmtSystem::cmt_string_vector& words, 498 499 500 497 Project* project, 498 const cmt_string& file_name, 499 int line_number) 501 500 {} 502 501 … … 517 516 } 518 517 void action (const CmtSystem::cmt_string_vector& words, 519 520 521 518 Project* project, 519 const cmt_string& file_name, 520 int line_number) 522 521 {} 523 522 }; … … 534 533 } 535 534 void action (const CmtSystem::cmt_string_vector& words, 536 537 538 539 { 540 535 Project* project, 536 const cmt_string& file_name, 537 int line_number) 538 { 539 action (words, project->get_use(), file_name, line_number); 541 540 } 542 541 }; … … 553 552 } 554 553 void action (const CmtSystem::cmt_string_vector& words, 555 556 557 558 { 559 560 554 Project* project, 555 const cmt_string& file_name, 556 int line_number) 557 { 558 action (words, project->get_use(), file_name, line_number); 559 } 561 560 }; 562 561 … … 572 571 } 573 572 void action (const CmtSystem::cmt_string_vector& words, 574 575 576 577 { 578 579 573 Project* project, 574 const cmt_string& file_name, 575 int line_number) 576 { 577 action (words, project->get_use(), file_name, line_number); 578 } 580 579 }; 581 580 … … 591 590 } 592 591 void action (const CmtSystem::cmt_string_vector& words, 593 594 595 596 { 597 598 592 Project* project, 593 const cmt_string& file_name, 594 int line_number) 595 { 596 action (words, project->get_use(), file_name, line_number); 597 } 599 598 }; 600 599 … … 610 609 } 611 610 void action (const CmtSystem::cmt_string_vector& words, 612 613 614 611 Project* project, 612 const cmt_string& file_name, 613 int line_number) 615 614 616 615 { 617 618 616 action (words, project->get_use(), file_name, line_number); 617 } 619 618 }; 620 619 … … 630 629 } 631 630 void action (const CmtSystem::cmt_string_vector& words, 632 633 634 635 { 636 637 631 Project* project, 632 const cmt_string& file_name, 633 int line_number) 634 { 635 action (words, project->get_use(), file_name, line_number); 636 } 638 637 }; 639 638 … … 649 648 } 650 649 void action (const CmtSystem::cmt_string_vector& words, 651 652 653 654 { 655 656 650 Project* project, 651 const cmt_string& file_name, 652 int line_number) 653 { 654 action (words, project->get_use(), file_name, line_number); 655 } 657 656 }; 658 657 … … 668 667 } 669 668 void action (const CmtSystem::cmt_string_vector& words, 670 671 672 669 Project* project, 670 const cmt_string& file_name, 671 int line_number) 673 672 {} 674 673 }; … … 685 684 } 686 685 void action (const CmtSystem::cmt_string_vector& words, 687 688 689 686 Project* project, 687 const cmt_string& file_name, 688 int line_number) 690 689 {} 691 690 }; … … 700 699 { 701 700 /* 702 if (words.size () > 1)703 { 704 705 706 707 701 if (words.size () > 1) 702 { 703 if (use == &(Use::current())) 704 { 705 m_current_package = words[1]; 706 build_prefix (m_current_package, m_current_prefix); 708 707 709 710 711 712 713 714 715 716 717 718 719 720 708 if ((use->get_package_name () != "") && 709 (use->get_package_name () != m_current_package)) 710 { 711 if (!m_quiet) 712 { 713 // cerr << "#CMT> package name mismatch in requirements of " << 714 // use->get_package_name () << " " << 715 // use->version << " line #" << line_number; 716 // cerr << " : " << m_current_package << " versus " << 717 // use->get_package_name () << endl; 718 } 719 } 721 720 722 723 724 725 726 721 use->set (m_current_package, 722 m_current_version, 723 m_current_path, 724 "", 725 ""); 727 726 728 729 730 727 use->change_path (m_current_path); 728 use->style = m_current_style; 729 } 731 730 } 732 731 */ 733 732 } 734 733 void action (const CmtSystem::cmt_string_vector& words, 735 736 737 734 Project* project, 735 const cmt_string& file_name, 736 int line_number) 738 737 {} 739 738 }; … … 750 749 } 751 750 void action (const CmtSystem::cmt_string_vector& words, 752 753 754 751 Project* project, 752 const cmt_string& file_name, 753 int line_number) 755 754 {} 756 755 … … 768 767 } 769 768 void action (const CmtSystem::cmt_string_vector& words, 770 771 772 769 Project* project, 770 const cmt_string& file_name, 771 int line_number) 773 772 {} 774 773 }; … … 785 784 } 786 785 void action (const CmtSystem::cmt_string_vector& words, 787 788 789 786 Project* project, 787 const cmt_string& file_name, 788 int line_number) 790 789 {} 791 790 }; … … 802 801 } 803 802 void action (const CmtSystem::cmt_string_vector& words, 804 805 806 803 Project* project, 804 const cmt_string& file_name, 805 int line_number) 807 806 {} 808 807 }; … … 819 818 } 820 819 void action (const CmtSystem::cmt_string_vector& words, 821 822 823 820 Project* project, 821 const cmt_string& file_name, 822 int line_number) 824 823 {} 825 824 }; … … 835 834 Pattern::action (words, use); 836 835 } 837 838 839 840 836 void action (const CmtSystem::cmt_string_vector& words, 837 Project* project, 838 const cmt_string& file_name, 839 int line_number) 841 840 {} 842 841 }; … … 856 855 } 857 856 void action (const CmtSystem::cmt_string_vector& words, 858 859 860 857 Project* project, 858 const cmt_string& file_name, 859 int line_number) 861 860 {} 862 861 }; … … 893 892 } 894 893 } 895 896 897 898 894 void action (const CmtSystem::cmt_string_vector& words, 895 Project* project, 896 const cmt_string& file_name, 897 int line_number) 899 898 {} 900 899 }; … … 911 910 } 912 911 void action (const CmtSystem::cmt_string_vector& words, 913 914 915 912 Project* project, 913 const cmt_string& file_name, 914 int line_number) 916 915 {} 917 916 }; … … 928 927 } 929 928 void action (const CmtSystem::cmt_string_vector& words, 930 931 932 929 Project* project, 930 const cmt_string& file_name, 931 int line_number) 933 932 {} 934 933 }; … … 945 944 } 946 945 void action (const CmtSystem::cmt_string_vector& words, 947 948 949 946 Project* project, 947 const cmt_string& file_name, 948 int line_number) 950 949 {} 951 950 }; … … 962 961 } 963 962 void action (const CmtSystem::cmt_string_vector& words, 964 965 966 963 Project* project, 964 const cmt_string& file_name, 965 int line_number) 967 966 {} 968 967 }; … … 979 978 } 980 979 void action (const CmtSystem::cmt_string_vector& words, 981 982 983 980 Project* project, 981 const cmt_string& file_name, 982 int line_number) 984 983 {} 985 984 }; … … 997 996 } 998 997 void action (const CmtSystem::cmt_string_vector& words, 999 1000 1001 998 Project* project, 999 const cmt_string& file_name, 1000 int line_number) 1002 1001 {} 1003 1002 }; … … 1097 1096 { 1098 1097 if (project != 0) project->set_strategy (strategy, value, ""); 1099 cmt_string s = "setup_strategy "; 1100 s += words[i]; 1101 s += "\n"; 1102 bool no_found = true; 1103 int size = project->m_extra_lines.size (); 1104 for (int n = 0; n < size; n++) 1105 { 1106 if (s==project->m_extra_lines[n]) 1107 no_found = false; 1108 } 1109 if (no_found) 1110 { 1111 cmt_string & buffer = project->m_extra_lines.add(); 1112 buffer = s; 1113 } 1098 cmt_string s = "setup_strategy "; 1099 s += words[i]; 1100 s += "\n"; 1101 1102 bool no_found = true; 1103 int size = project->m_extra_lines.size (); 1104 for (int n = 0; n < size; n++) 1105 { 1106 if (s==project->m_extra_lines[n]) 1107 no_found = false; 1108 } 1109 if (no_found) 1110 { 1111 cmt_string & buffer = project->m_extra_lines.add(); 1112 buffer = s; 1113 } 1114 1114 } 1115 1115 else … … 1201 1201 if (project != 0) project->set_strategy (strategy, value, ""); 1202 1202 cmt_string s = "structure_strategy "; 1203 s += words[i]; 1204 s += "\n"; 1205 bool no_found = true; 1206 int size = project->m_extra_lines.size (); 1207 for (int n = 0; n < size; n++) 1208 { 1209 if (s==project->m_extra_lines[n]) 1210 no_found = false; 1211 } 1212 if (no_found) 1213 { 1214 cmt_string & buffer = project->m_extra_lines.add(); 1215 buffer = s; 1216 } 1217 1203 s += words[i]; 1204 s += "\n"; 1205 1206 bool no_found = true; 1207 int size = project->m_extra_lines.size (); 1208 for (int n = 0; n < size; n++) 1209 { 1210 if (s == project->m_extra_lines[n]) 1211 no_found = false; 1212 } 1213 1214 if (no_found) 1215 { 1216 cmt_string & buffer = project->m_extra_lines.add(); 1217 buffer = s; 1218 } 1218 1219 } 1219 1220 else … … 1238 1239 } 1239 1240 void action (const CmtSystem::cmt_string_vector& words, 1240 1241 1242 1241 Project* project, 1242 const cmt_string& file_name, 1243 int line_number) 1243 1244 { 1244 1245 action (words, project->get_use(), file_name, line_number); … … 1257 1258 } 1258 1259 void action (const CmtSystem::cmt_string_vector& words, 1259 1260 1261 1262 { 1263 1264 1260 Project* project, 1261 const cmt_string& file_name, 1262 int line_number) 1263 { 1264 action (words, project->get_use(), file_name, line_number); 1265 } 1265 1266 }; 1266 1267 … … 1297 1298 } 1298 1299 void action (const CmtSystem::cmt_string_vector& words, 1299 1300 1301 1300 Project* project, 1301 const cmt_string& file_name, 1302 int line_number) 1302 1303 {} 1303 1304 }; … … 1313 1314 } 1314 1315 void action (const CmtSystem::cmt_string_vector& words, 1315 1316 1317 1316 Project* project, 1317 const cmt_string& file_name, 1318 int line_number) 1318 1319 {} 1319 1320 }; … … 1341 1342 1342 1343 void action (const CmtSystem::cmt_string_vector& words, 1343 1344 1345 1344 Project* project, 1345 const cmt_string& file_name, 1346 int line_number) 1346 1347 {action (words, project->get_use(), file_name, line_number);} 1347 1348 }; … … 1357 1358 * Parse the input file, rejecting comments and 1358 1359 * rebuilding complete lines (from sections separated by 1359 * \ characters.1360 * \\ characters. 1360 1361 * 1361 1362 * Each reformatted line is parsed by filter_line … … 1378 1379 1379 1380 me.do_parse_requirements (file_name, use); 1380 1381 1381 1382 1382 1383 if (use != 0) 1383 {1384 1385 1386 1387 1384 { 1385 // 1386 1387 Project* p = use->get_project (); 1388 if (p != 0) 1388 1389 { 1389 1390 1391 1390 Use* p_use = p->get_use(); 1391 if (p_use != 0 && p_use != use) 1392 { 1392 1393 1393 1394 //{ … … 1407 1408 int size = p->m_extra_lines.size (); 1408 1409 for (int n = 0; n < size; n++) 1409 1410 { 1410 1411 cmt_string& s = p->m_extra_lines[n]; 1411 1412 SyntaxParser::parse_requirements_line (s, use); 1412 1413 } 1413 1414 } 1414 1415 … … 1422 1423 // request += " "; 1423 1424 // request += path; 1424 1425 // add at the uses level ????? 1426 static Use::UsePtrVector& uses = Use::get_ordered_uses (); 1427 //const Use& cu = Use::current (); 1428 1429 bool found = false; 1430 int size = uses.size (); 1431 // cerr << "\n size:"<<size<< ":" << endl; 1432 for (int n = 0; n < size; n++) 1433 { 1434 Use* tuse = uses[n]; 1435 // cerr << "\tpackage file [" << tuse->get_package_name() << "]" <<p_use->get_package_name()<< endl; 1436 if (tuse->get_package_name()==p_use->get_package_name()) 1437 found=true; 1438 } 1439 if (! found) 1440 { 1425 1426 // add at the uses level ????? 1427 static Use::UsePtrVector& uses = Use::get_ordered_uses (); 1428 //const Use& cu = Use::current (); 1429 1430 bool found = false; 1431 int size = uses.size (); 1432 1433 // cerr << "\n size:"<<size<< ":" << endl; 1434 for (int n = 0; n < size; n++) 1435 { 1436 Use* tuse = uses[n]; 1437 // cerr << "\tpackage file [" << tuse->get_package_name() << "]" <<p_use->get_package_name()<< endl; 1438 if (tuse->get_package_name()==p_use->get_package_name()) 1439 found=true; 1440 } 1441 if (! found) 1442 { 1441 1443 uses.push_back (p_use); 1442 1443 1444 1445 1444 p_use->m_index = uses.size () - 1; 1445 } 1446 1447 } 1446 1448 } 1447 1448 }1449 use->close_scope_sections (); 1450 } 1449 1451 } 1450 1452 … … 1462 1464 * Parse a text, rejecting comments and 1463 1465 * rebuilding complete lines (from sections separated by 1464 * \ characters.1466 * \\ characters. 1465 1467 * 1466 1468 * Each reformatted line is parsed by filter_line … … 1472 1474 SyntaxParser& me = instance (); 1473 1475 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1476 /** 1477 * 1478 * We have to preserve m_current_access since it reflects whether 1479 * the current cmt action is run in the context of the current package. 1480 * (the opposite is when the cmt command specifies the current package 1481 * in its arguments -use=... therefore the pwd is NOT the directory 1482 * of the current package) 1483 * 1484 * m_current_access is Developer when pwd = current 1485 * User when pwd != current 1486 * 1487 * Therefore, as soon as we reach a used package, this must be switched to User 1488 * 1489 * On the other hand, Cmt::scope reflects the status of the public/private 1490 * statements. By default, we are in public context when entering a new requirements 1491 * file. 1492 * 1493 */ 1492 1494 1493 1495 AccessMode saved_current_access; … … 1654 1656 * Parse a text, rejecting comments and 1655 1657 * rebuilding complete lines (from sections separated by 1656 * \ characters.1658 * \\ characters. 1657 1659 * 1658 1660 * Each reformatted line is parsed by filter_line … … 1679 1681 max_pos = text.size (); 1680 1682 1681 for (pos = 0; pos < max_pos; )1683 for (pos = 0; pos < max_pos; ) 1682 1684 { 1683 1685 int cr = text.find (pos, "\r\n"); … … 1870 1872 /* 1871 1873 1872 1873 1874 1875 1874 When the first word of the line is not a keyword, it may be an 1875 implicit pattern application. 1876 1877 */ 1876 1878 1877 1879 Pattern* p = Pattern::find (command); -
CMT/HEAD/source/cmt_system.cxx
r205 r400 66 66 char* pwd_env = 0; 67 67 68 #ifdef USE_PWD69 68 pwd_env = ::getenv ("PWD"); 70 #endif71 69 72 70 if (pwd_env != 0) … … 78 76 ptr = getcwd (buffer, sizeof (buffer)); 79 77 } 78 79 //cerr << "pwd> " << buffer << endl; 80 80 81 81 const char* t = &buffer[0]; … … 86 86 bool CmtSystem::cd (const cmt_string& dir) 87 87 { 88 static cmt_string new_dir; 89 90 if ((dir.size () == 2) && (dir[1] == ':')) 91 { 92 new_dir = dir; 93 new_dir += file_separator (); 94 if (chdir (new_dir.c_str ()) == 0) 95 { 96 #ifdef USE_PWD 97 new_dir = dir; 98 new_dir += file_separator (); 99 putenv ("PWD", new_dir); 100 #endif 101 102 return (true); 103 } 104 return (false); 105 } 106 else 107 { 108 if (chdir (dir.c_str ()) == 0) 109 { 110 #ifdef USE_PWD 111 putenv ("PWD", dir); 112 #endif 113 114 return (true); 115 } 116 return (false); 117 } 88 if (!CmtSystem::absolute_path (dir)) 89 { 90 cmt_string d = CmtSystem::pwd (); 91 d += file_separator (); 92 d += dir; 93 return (CmtSystem::cd (d)); 94 } 95 96 static cmt_string s_dir; 97 98 s_dir = dir; 99 100 if ((s_dir.size () == 2) && (s_dir[1] == ':')) 101 { 102 s_dir += file_separator (); 103 } 104 105 compress_path (s_dir); 106 107 if (chdir (s_dir.c_str ()) == 0) 108 { 109 putenv ("PWD", s_dir); 110 return (true); 111 } 112 113 return (false); 118 114 } 119 115 … … 253 249 cmt_string here = CmtSystem::pwd (); 254 250 if (test_directory(path)) 255 {251 { 256 252 CmtSystem::cd (path); 257 253 result = CmtSystem::pwd (); 258 254 CmtSystem::cd (here); 259 255 return true; 260 }261 256 } 257 return false; 262 258 } 263 259 … … 421 417 bool CmtSystem::touch_file (const cmt_string& name) 422 418 { 423 424 425 426 427 428 429 430 431 432 433 434 435 436 /* FILE* f = fopen (name, "a+");437 438 439 440 441 419 if (CmtSystem::test_file(name)) 420 { 421 static cmt_string s; 422 s.read (name); 423 //unlink (name); 424 FILE* f = fopen (name, "wb"); 425 if (f != NULL) 426 { 427 s.write (f); 428 fclose (f); 429 return (true); 430 } 431 chmod (name.c_str(), 0777); 432 /* FILE* f = fopen (name, "a+"); 433 434 if (f != NULL) 435 { 436 cmt_string empty = " "; 437 empty.write(f); 442 438 443 444 445 446 */447 448 439 fclose (f); 440 return true; 441 } 442 */ 443 } 444 return false; 449 445 } 450 446 … … 734 730 if (::_mkdir (full_path.c_str ()) != 0) 735 731 { 736 732 // cerr << "CMT> cannot create directory " << full_path << endl; 737 733 return (false); 738 734 } … … 740 736 if (::mkdir (full_path.c_str (), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH ) != 0) 741 737 { 742 738 // cerr << "CMT> cannot create directory " << full_path << endl; 743 739 return (false); 744 740 } … … 831 827 #else 832 828 833 //c out<< "scan_dir> dir=" << dir_name << endl;829 //cerr << "scan_dir> dir=" << dir_name << endl; 834 830 835 831 DIR* dir = opendir (dir_prefix.c_str ()); … … 851 847 (strncmp (name, name_prefix.c_str (), name_prefix.size ()) != 0)) continue; 852 848 853 //c out<< "scan_dir> name=" << name << endl;849 //cerr << "scan_dir> name=" << name << endl; 854 850 855 851 cmt_string& name_entry = list.add (); … … 926 922 #else 927 923 928 //c out<< "scan_dir> dir=" << dir_name << endl;924 //cerr << "scan_dir> dir=" << dir_name << endl; 929 925 930 926 DIR* dir = opendir (dir_prefix.c_str ()); … … 1251 1247 1252 1248 if (name == "CMTCONFIG") 1253 {1254 return (get_cmt_config ());1255 }1249 { 1250 return (get_cmt_config ()); 1251 } 1256 1252 1257 1253 /* 1258 if (name == "CMTROOT")1259 {1260 1261 }1262 1263 if (name == "CMTSITE")1264 {1265 1266 }1254 if (name == "CMTROOT") 1255 { 1256 return (get_cmt_root ()); 1257 } 1258 1259 if (name == "CMTSITE") 1260 { 1261 return (get_cmt_site ()); 1262 } 1267 1263 */ 1268 1264 … … 1272 1268 /** 1273 1269 Implementation based on a local static map of used environment 1274 variables to ensure a stable character string. The OS requires1275 that the character string sent via a putenv is kept untouched forever1276 1270 variables to ensure a stable character string. The OS requires 1271 that the character string sent via a putenv is kept untouched forever 1272 */ 1277 1273 bool CmtSystem::putenv (const cmt_string& name, const cmt_string& value) 1278 1274 { … … 1588 1584 int CmtSystem::execute (const cmt_string& command) 1589 1585 { 1590 //c out<< "CmtSystem::execute1> [" << command << "]" << endl;1586 //cerr << "CmtSystem::execute1> [" << command << "]" << endl; 1591 1587 1592 1588 return (system (command.c_str ())); … … 1598 1594 output = ""; 1599 1595 1600 //c out<< "CmtSystem::execute2> [" << command << "]" << endl;1596 //cerr << "CmtSystem::execute2> [" << command << "]" << endl; 1601 1597 1602 1598 FILE* f = popen (command.c_str (), "r"); … … 1644 1640 1645 1641 for (int i = 0; i < dirs.size (); i++) 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1642 { 1643 const cmt_string& d = dirs[i]; 1644 1645 req = d; 1646 req += file_separator (); 1647 req += "mgr"; 1648 req += file_separator (); 1649 req += "requirements"; 1650 1651 if (test_file (req)) return (true); 1656 1652 1657 1653 req = d; … … 1701 1697 1702 1698 enum 1703 {1704 starting,1705 at_key,1706 at_number1707 } state;1699 { 1700 starting, 1701 at_key, 1702 at_number 1703 } state; 1708 1704 1709 1705 int id; … … 2147 2143 if (pos1 == cmt_string::npos) break; 2148 2144 2149 2150 2151 2145 // 2146 // extract "aaaa/xxxx" from "aaaa/xxxx/../bbbb" 2147 // 2152 2148 cmt_string p = dir.substr (0, pos1); 2153 2149 … … 2158 2154 if (dn == "") break; 2159 2155 2160 2161 2162 2156 // 2157 // Is "aaaa/xxxx" only made of "xxxx" ? 2158 // 2163 2159 pos2 = p.find_last_of (file_separator ()); 2164 2160 … … 2203 2199 } 2204 2200 2205 2201 //if (dir[dir.size () - 1] == file_separator ()) dir.erase (dir.size () - 1); 2206 2202 } 2207 2203 … … 2305 2301 } 2306 2302 2303 2304 2305 2306 2307 //---------------------------------------------------------- 2308 FilePath::FilePath () 2309 { 2310 p_name = ""; 2311 l_name = ""; 2312 alternates.resize (0); 2313 } 2314 2315 //---------------------------------------------------------- 2316 FilePath::FilePath (const FilePath& other) 2317 { 2318 set (other); 2319 } 2320 2321 //---------------------------------------------------------- 2322 FilePath::FilePath (const cmt_string& other) 2323 { 2324 set (other); 2325 } 2326 2327 //---------------------------------------------------------- 2328 FilePath::FilePath (const char* other) 2329 { 2330 set (other); 2331 } 2332 2333 //---------------------------------------------------------- 2334 FilePath& FilePath::operator = (const FilePath& other) 2335 { 2336 FilePath& me = *this; 2337 2338 me.set (other); 2339 2340 return (me); 2341 } 2342 2343 //---------------------------------------------------------- 2344 FilePath& FilePath::operator = (const cmt_string& other) 2345 { 2346 FilePath& me = *this; 2347 2348 me.set (other); 2349 2350 return (me); 2351 } 2352 2353 //---------------------------------------------------------- 2354 FilePath& FilePath::operator = (const char* other) 2355 { 2356 FilePath& me = *this; 2357 2358 me.set (other); 2359 2360 return (me); 2361 } 2362 2363 //---------------------------------------------------------- 2364 bool FilePath::operator == (const FilePath& other) const 2365 { 2366 if (other.p_name == p_name) return (true); 2367 return (false); 2368 } 2369 2370 //---------------------------------------------------------- 2371 bool FilePath::operator == (const cmt_string& other) const 2372 { 2373 if (p_name == other) return (true); 2374 if (l_name == other) return (true); 2375 2376 for (int i = 0; i < alternates.size (); i++) 2377 { 2378 if (alternates[i] == other) return (true); 2379 } 2380 2381 cmt_string here = CmtSystem::pwd (); 2382 CmtSystem::cd (other); 2383 cmt_string p = CmtSystem::pwd (); 2384 CmtSystem::cd (here); 2385 2386 if (p_name == p) return (true); 2387 2388 return (false); 2389 } 2390 2391 //---------------------------------------------------------- 2392 bool FilePath::operator == (const char* other) const 2393 { 2394 const FilePath& me = *this; 2395 2396 const cmt_string o = other; 2397 2398 return ((me == o)); 2399 2400 return (false); 2401 } 2402 2403 //---------------------------------------------------------- 2404 bool FilePath::operator != (const FilePath& other) const 2405 { 2406 const FilePath& me = *this; 2407 2408 return (!(me == other)); 2409 } 2410 2411 //---------------------------------------------------------- 2412 bool FilePath::operator != (const cmt_string& other) const 2413 { 2414 const FilePath& me = *this; 2415 2416 return (!(me == other)); 2417 } 2418 2419 //---------------------------------------------------------- 2420 bool FilePath::operator != (const char* other) const 2421 { 2422 const FilePath& me = *this; 2423 2424 return (!(me == other)); 2425 } 2426 2427 //---------------------------------------------------------- 2428 bool FilePath::cd () const 2429 { 2430 CmtSystem::cd (l_name); 2431 2432 return (false); 2433 } 2434 2435 //---------------------------------------------------------- 2436 void FilePath::set (const FilePath& other) 2437 { 2438 p_name = other.p_name; 2439 l_name = other.l_name; 2440 alternates = other.alternates; 2441 } 2442 2443 //---------------------------------------------------------- 2444 void FilePath::set (const cmt_string& other) 2445 { 2446 // Skip if no change. 2447 2448 if (p_name == other) return; 2449 if (l_name == other) return; 2450 2451 for (int i = 0; i < alternates.size (); i++) 2452 { 2453 if (alternates[i] == other) return; 2454 } 2455 2456 // Something changes 2457 2458 cmt_string here = CmtSystem::pwd (); 2459 CmtSystem::cd (other); 2460 cmt_string p = CmtSystem::pwd (); 2461 CmtSystem::cd (here); 2462 2463 if (p == p_name) 2464 { 2465 // The physical name does not change => we are just adding a new logical 2466 2467 if (l_name == "") 2468 { 2469 l_name = other; 2470 } 2471 else 2472 { 2473 cmt_string& n = alternates.add (); 2474 n = other; 2475 } 2476 } 2477 else 2478 { 2479 // The physical names differ => we completely reset the object 2480 2481 p_name = p; 2482 l_name = other; 2483 alternates.resize (0); 2484 } 2485 } 2486 2487 //---------------------------------------------------------- 2488 void FilePath::set (const char* other) 2489 { 2490 const cmt_string o = other; 2491 set (o); 2492 } 2493 -
CMT/HEAD/source/cmt_system.h
r201 r400 145 145 }; 146 146 147 class FilePath 148 { 149 public: 150 151 FilePath (); 152 153 FilePath (const FilePath& other); 154 FilePath (const cmt_string& other); 155 FilePath (const char* other); 156 157 FilePath& operator = (const FilePath& other); 158 FilePath& operator = (const cmt_string& other); 159 FilePath& operator = (const char* other); 160 161 bool operator == (const FilePath& other) const; 162 bool operator == (const cmt_string& other) const; 163 bool operator == (const char* other) const; 164 165 bool operator != (const FilePath& other) const; 166 bool operator != (const cmt_string& other) const; 167 bool operator != (const char* other) const; 168 169 bool cd () const; 170 171 private: 172 173 void set (const FilePath& other); 174 void set (const cmt_string& other); 175 void set (const char* other); 176 177 cmt_string p_name; // physical name 178 cmt_string l_name; // first logical name 179 180 CmtSystem::cmt_string_vector alternates; // other logical names 181 }; 182 183 147 184 #endif -
CMT/HEAD/source/cmt_tag.cxx
r318 r400 104 104 if (m_priority > ref->m_priority) 105 105 { 106 107 108 109 110 106 // 107 // Although this other contradictory tag is already selected, 108 // its priority is lower. Therefore it will lose !! It has to be 109 // unselected ... 110 // 111 111 112 112 ref->unmark (); … … 114 114 else 115 115 { 116 117 116 /* 117 if (!Cmt::quiet) 118 118 { 119 120 121 119 cerr << "Cannot mark excluded tag " << m_name << " p=" << m_priority 120 << " because " << ref->m_name << "(" << ref->m_priority << ")" << endl; 121 show (0); 122 122 } 123 123 */ 124 124 125 125 return; … … 191 191 Tag* tag; 192 192 193 193 if (words.size () < 1) return; 194 194 name = words[1]; 195 195 if (name == "") return; … … 246 246 ref = add (n, PriorityUserTag, "use", use); 247 247 248 249 250 { 251 252 253 } 254 248 /* 249 if (!Cmt::quiet) 250 { 251 cerr << "Excluding tag " << n << "(" << ref->m_priority << ") from tag " 252 << name << "(" << tag->m_priority << ")" << endl; 253 } 254 */ 255 255 256 256 tag->add_tag_exclude (ref); … … 258 258 } 259 259 260 261 262 263 264 265 266 260 // 261 // We have to check that some of the excluded tags may be already selected. 262 // Then we have to figure out which one has to win: 263 // 264 // the one with the highest priority 265 // or the first that had been declared. 266 // 267 267 268 268 int count = 0; … … 305 305 if (winner_count > 1) 306 306 { 307 308 309 310 } 311 312 313 314 315 307 // 308 // Several contradictory tags are selected and have the same priority!! 309 // 310 } 311 312 // 313 // We have at least one selected, and one winner. 314 // All others will be unselected. 315 // 316 316 317 317 if (tag != winner) … … 343 343 344 344 /* 345 TagPtrVector& vector = tags ();346 347 int tag_index;348 Tag* tag;349 350 if (vector.size () == 0) return (0);351 352 for (tag_index = 0; tag_index < vector.size (); tag_index++)353 { 354 355 356 357 358 359 360 } 361 362 return (0);363 345 TagPtrVector& vector = tags (); 346 347 int tag_index; 348 Tag* tag; 349 350 if (vector.size () == 0) return (0); 351 352 for (tag_index = 0; tag_index < vector.size (); tag_index++) 353 { 354 tag = vector[tag_index]; 355 356 if ((tag != 0) && (tag->m_name == name)) 357 { 358 return (tag); 359 } 360 } 361 362 return (0); 363 */ 364 364 } 365 365 … … 372 372 373 373 /* 374 int tag_index;375 376 if (instances.size () == 0) return (0);377 378 for (tag_index = 0; tag_index < instances.size (); tag_index++)379 { 380 381 382 383 384 385 386 } 387 388 return (0);374 int tag_index; 375 376 if (instances.size () == 0) return (0); 377 378 for (tag_index = 0; tag_index < instances.size (); tag_index++) 379 { 380 Tag& tag = instances[tag_index]; 381 382 if (tag.m_name == name) 383 { 384 return (&tag); 385 } 386 } 387 388 return (0); 389 389 */ 390 390 } … … 413 413 tag->m_priority = priority; 414 414 415 416 417 { 418 419 } 420 415 /* 416 if (!Cmt::quiet) 417 { 418 cerr << "increasing priority of " << name << " p=" << priority << endl; 419 } 420 */ 421 421 } 422 422 else 423 423 { 424 425 426 { 427 428 } 429 424 /* 425 if (!Cmt::quiet) 426 { 427 cerr << "keeping priority of " << name << " p=" << tag->m_priority << endl; 428 } 429 */ 430 430 } 431 431 … … 869 869 /* 870 870 Check if a tag is part of the operands of a tag 871 871 */ 872 872 bool Tag::use_operand (const Tag* other) const 873 873 { … … 890 890 /* 891 891 Check if a tag is part of the refs of a tag 892 892 */ 893 893 bool Tag::use_ref (const Tag* other) const 894 894 { -
CMT/HEAD/source/cmt_triggers.cxx
r11 r400 300 300 { 301 301 cerr << "Syntax error in trigger file : bad keyword (" << 302 302 name << ")" << endl; 303 303 } 304 304 exit (0); … … 387 387 DependencyAnalyzer::DependencyAnalyzer (const cmt_string& package_name, 388 388 Constituent& constituent_ref) : 389 390 389 package (package_name), 390 constituent (constituent_ref) 391 391 { 392 392 cmt_string dirs; … … 414 414 void DependencyAnalyzer::filter (const cmt_string& line) 415 415 { 416 416 /* Clip target out of dependency file... */ 417 417 int pos = line.find ("="); 418 418 if ((pos == 0) || (pos == cmt_string::npos)) … … 448 448 { 449 449 cerr << "#CMT> Warning: It seems there is nothing after \'=\' " 450 450 "in dependency file " << m_file_name << endl; 451 451 return; 452 452 } … … 460 460 const cmt_string& dep = deps[i]; 461 461 462 463 464 465 466 467 462 // 463 // dep may either be: 464 // o the module itself 465 // o a file in one of include_dirs 466 // o something else 467 // 468 468 469 469 if (dep.find (module) != cmt_string::npos) … … 571 571 LibraryAnalyzer::LibraryAnalyzer (const cmt_string& package_name, 572 572 Constituent& constituent_ref) : 573 573 DependencyAnalyzer (package_name, constituent_ref) 574 574 { 575 575 } … … 655 655 ApplicationAnalyzer::ApplicationAnalyzer (const cmt_string& package_name, 656 656 Constituent& constituent_ref) : 657 657 DependencyAnalyzer (package_name, constituent_ref) 658 658 { 659 659 } … … 797 797 cmt_string package = use->get_package_name (); 798 798 799 800 799 // UseAnalyzer use_analyzer (package); 800 // use_analyzer.run ("cmt show uses -quiet"); 801 801 802 802 UseAnalyzer use_analyzer; -
CMT/HEAD/source/cmt_use.cxx
r344 r400 114 114 115 115 typedef enum 116 {117 IdenticalIds,118 119 IncompatibleMajorIds,120 NewMajorIdGreaterThanOld,121 OldMajorIdGreaterThanNew,122 ExplicitOldMajorIdWinsAgainstWildarded,123 ExplicitNewMajorIdWinsAgainstWildarded,124 125 ExplicitOldMinorIdWinsAgainstWildarded,126 ExplicitNewMinorIdWinsAgainstWildarded,127 NewMinorIdGreaterThanOld,128 129 ExplicitOldPatchIdWinsAgainstWildarded,130 ExplicitNewPatchIdWinsAgainstWildarded,131 NewPatchIdGreaterThanOld132 } CompareStatus;116 { 117 IdenticalIds, 118 119 IncompatibleMajorIds, 120 NewMajorIdGreaterThanOld, 121 OldMajorIdGreaterThanNew, 122 ExplicitOldMajorIdWinsAgainstWildarded, 123 ExplicitNewMajorIdWinsAgainstWildarded, 124 125 ExplicitOldMinorIdWinsAgainstWildarded, 126 ExplicitNewMinorIdWinsAgainstWildarded, 127 NewMinorIdGreaterThanOld, 128 129 ExplicitOldPatchIdWinsAgainstWildarded, 130 ExplicitNewPatchIdWinsAgainstWildarded, 131 NewPatchIdGreaterThanOld 132 } CompareStatus; 133 133 134 134 static CompareStatus compare_versions (const cmt_string& ref_version, const cmt_string& new_version) … … 151 151 { 152 152 /* 153 154 { 155 cout<< "#1 Required version " << new_version <<156 157 153 if (!Cmt::get_quiet ()) 154 { 155 cerr << "#1 Required version " << new_version << 156 " incompatible with selected version " << ref_version << 157 endl; 158 158 } 159 159 */ … … 184 184 { 185 185 /* 186 if (!Cmt::get_quiet ())187 { 188 cout<< "#2 Select version " << new_version <<189 190 186 if (!Cmt::get_quiet ()) 187 { 188 cerr << "#2 Select version " << new_version << 189 " instead of existing " << ref_version << 190 endl; 191 191 } 192 192 */ … … 197 197 { 198 198 /* 199 if (!Cmt::get_quiet ())200 c out<< "#3 keep version " << ref_version <<201 202 199 if (!Cmt::get_quiet ()) 200 cerr << "#3 keep version " << ref_version << 201 " (ignore version " << new_version << ")" << 202 endl; 203 203 */ 204 204 … … 223 223 224 224 /* 225 if (!Cmt::get_quiet ())226 { 227 cout<< "#4 Select release " << new_version228 229 225 if (!Cmt::get_quiet ()) 226 { 227 cerr << "#4 Select release " << new_version 228 << " instead of existing " << ref_version 229 << endl; 230 230 } 231 231 */ … … 236 236 { 237 237 /* 238 if (!Cmt::get_quiet ())239 c out<< "#5 keep release " << ref_version <<240 241 238 if (!Cmt::get_quiet ()) 239 cerr << "#5 keep release " << ref_version << 240 " (ignore release " << new_version << ")" << 241 endl; 242 242 */ 243 243 … … 248 248 { 249 249 /* 250 251 { 252 cout<< "#6 Select release " << new_version <<253 254 250 if (!Cmt::get_quiet ()) 251 { 252 cerr << "#6 Select release " << new_version << 253 " instead of existing " << ref_version << 254 endl; 255 255 } 256 256 */ 257 257 258 258 result = NewMinorIdGreaterThanOld; 259 }259 } 260 260 else if ((new_p == -1) || (old_p == -1) || (new_p < old_p)) 261 261 { … … 269 269 { 270 270 /* 271 if (!Cmt::get_quiet ())272 { 273 cout<< "#7 Select patch " << new_version <<274 275 271 if (!Cmt::get_quiet ()) 272 { 273 cerr << "#7 Select patch " << new_version << 274 " instead of existing " << ref_version << 275 endl; 276 276 } 277 277 */ … … 282 282 { 283 283 /* 284 if (!Cmt::get_quiet ())285 c out<< "#8 keep patch " << ref_version <<286 287 284 if (!Cmt::get_quiet ()) 285 cerr << "#8 keep patch " << ref_version << 286 " (ignore version " << new_version << ")" << 287 endl; 288 288 */ 289 289 … … 294 294 { 295 295 /* 296 297 { 298 cout<< "#9 Select patch " << new_version <<299 300 296 if (!Cmt::get_quiet ()) 297 { 298 cerr << "#9 Select patch " << new_version << 299 " instead of existing " << ref_version << 300 endl; 301 301 } 302 302 */ … … 500 500 { 501 501 cout << "# package " << use->get_package_name () << 502 503 504 502 " " << use->version << " " << use->path << 503 " not found" << 504 endl; 505 505 } 506 506 CmtError::set (CmtError::package_not_found, use->get_package_name ()); … … 577 577 578 578 use_action_iterator () 579 { 580 state = need_package; 581 auto_imports = Unspecified; 582 } 583 584 void set (const cmt_string& w) 585 { 586 if (w.find (0, "-native_version=") != -1) 579 587 { 580 state = need_package; 581 auto_imports = Unspecified; 588 native_version = w.substr (16); 582 589 } 583 584 void set (const cmt_string& w) 590 else if (w == "-auto_imports") 585 591 { 586 if (w.find (0, "-native_version=") != -1) 587 { 588 native_version = w.substr (16); 589 } 590 else if (w == "-auto_imports") 591 { 592 auto_imports = On; 593 } 594 else if (w == "-no_auto_imports") 595 { 596 auto_imports = Off; 597 } 598 else if (w == "|") 599 { 600 state = need_version_alias; 601 } 602 else 603 { 604 switch (state) 605 { 606 case need_package: 607 package = w; 608 state = need_version; 609 break; 610 case need_version: 611 version = w; 612 state = need_path; 613 break; 614 case need_path: 615 path = w; 616 while (path[path.size() - 1] == '/') path.erase (path.size() - 1); 617 while (path[path.size() - 1] == '\\') path.erase (path.size() - 1); 618 state = finished; 619 break; 620 case need_version_alias: 621 version_alias = w; 622 state = need_path_alias; 623 break; 624 case need_path_alias: 625 path_alias = w; 626 while (path_alias[path_alias.size() - 1] == '/') path_alias.erase (path_alias.size() - 1); 627 while (path_alias[path_alias.size() - 1] == '\\') path_alias.erase (path_alias.size() - 1); 628 state = finished; 629 break; 630 } 631 } 592 auto_imports = On; 632 593 } 594 else if (w == "-no_auto_imports") 595 { 596 auto_imports = Off; 597 } 598 else if (w == "|") 599 { 600 state = need_version_alias; 601 } 602 else 603 { 604 switch (state) 605 { 606 case need_package: 607 package = w; 608 state = need_version; 609 break; 610 case need_version: 611 version = w; 612 state = need_path; 613 break; 614 case need_path: 615 path = w; 616 while (path[path.size() - 1] == '/') path.erase (path.size() - 1); 617 while (path[path.size() - 1] == '\\') path.erase (path.size() - 1); 618 state = finished; 619 break; 620 case need_version_alias: 621 version_alias = w; 622 state = need_path_alias; 623 break; 624 case need_path_alias: 625 path_alias = w; 626 while (path_alias[path_alias.size() - 1] == '/') path_alias.erase (path_alias.size() - 1); 627 while (path_alias[path_alias.size() - 1] == '\\') path_alias.erase (path_alias.size() - 1); 628 state = finished; 629 break; 630 } 631 } 632 } 633 633 634 634 bool ok () 635 636 637 638 639 640 641 642 635 { 636 if (package == "") return (false); 637 if (CmtSystem::is_home_package (package, version)) return (false); 638 if (CmtSystem::is_user_context_package (package, version)) return (false); 639 if (CmtSystem::is_project_package (package, version)) return (false); 640 641 return (true); 642 } 643 643 644 644 /** … … 648 648 */ 649 649 Use* get_use (Use* parent) 650 { 651 static Use::UsePtrVector& uses = Use::get_ordered_uses (); 652 653 if (version == "") version = "*"; 654 655 if (Cmt::get_debug ()) 650 656 { 651 static Use::UsePtrVector& uses = Use::get_ordered_uses (); 652 653 if (version == "") version = "*"; 654 655 if (Cmt::get_debug ()) 656 { 657 int i; 658 659 cout << "use::action1> current=" << parent->get_package_name () << 660 " package=" << package << " "; 661 662 for (i = 0; i < uses.size (); i++) 663 { 664 Use* u = uses[i]; 665 cout << u->get_package_name () << " "; 666 } 667 cout << endl; 668 } 669 670 const Use& cu = Use::current (); 671 672 /** 673 * Do not continue the operations for private uses 674 * accessed from an external context. 675 * 676 * Exceptions should be considered for 677 * - cmt broadcast 678 * - cmt show uses 679 */ 680 681 ActionType action = Cmt::get_action (); 682 683 if (Cmt::get_debug ()) 684 { 685 cout << "before adding " << package <<"> auto_imports=" << auto_imports 686 << " (current AI was " << UseContext::get_current_auto_imports () << ")" 687 << " (Use::scope=" << parent->get_current_scope () << ")" 688 << " (parent=" << parent->get_package_name () << ")" 689 << endl; 690 } 691 692 bool hidden_by_scope = false; 693 694 if (parent->get_current_scope () == ScopePrivate) 657 int i; 658 659 cout << "use::action1> current=" << parent->get_package_name () << 660 " package=" << package << " "; 661 662 for (i = 0; i < uses.size (); i++) 695 663 { 696 hidden_by_scope = true; 697 698 // Do not hide immediate children of the current package. 699 if ((parent == 0) || 700 (parent->get_package () == cu.get_package ())) hidden_by_scope = false; 701 702 // Override default rule according to the scope filtering mode. 703 704 if (Cmt::get_scope_filtering_mode () == reach_private_uses) hidden_by_scope = false; 664 Use* u = uses[i]; 665 cout << u->get_package_name () << " "; 705 666 } 706 707 if (hidden_by_scope) 708 { 709 return (0); 710 } 711 712 // Here the version may contain wild cards 713 714 UseContext save = UseContext::current (); 715 716 /** 717 * "auto_imports" is the state which is specified on the use statement 718 * currently being parsed. 719 */ 720 switch (auto_imports) 721 { 722 case Unspecified: 723 724 // unspecified => we forward the state saved in the current use context 725 726 UseContext::set_current (UseContext::get_current_auto_imports ()); 727 break; 728 case Off: 729 730 // off => the context becomes constrained to be off 731 732 UseContext::set_current (Off); 733 break; 734 case On: 735 736 // on => if current context is off it is kept off 737 // otherwise it is forced to on 738 739 if (UseContext::get_current_auto_imports () != Off) 740 { 741 UseContext::set_current (On); 742 } 743 break; 744 } 745 746 if (Cmt::get_debug ()) 747 { 748 cout << "about to add " << package << endl; 749 show_packages (); 667 cout << endl; 668 } 669 670 const Use& cu = Use::current (); 671 672 /** 673 * Do not continue the operations for private uses 674 * accessed from an external context. 675 * 676 * Exceptions should be considered for 677 * - cmt broadcast 678 * - cmt show uses 679 */ 680 681 ActionType action = Cmt::get_action (); 682 683 if (Cmt::get_debug ()) 684 { 685 cout << "before adding " << package <<"> auto_imports=" << auto_imports 686 << " (current AI was " << UseContext::get_current_auto_imports () << ")" 687 << " (Use::scope=" << parent->get_current_scope () << ")" 688 << " (parent=" << parent->get_package_name () << ")" 689 << endl; 690 } 691 692 bool hidden_by_scope = false; 693 694 if (parent->get_current_scope () == ScopePrivate) 695 { 696 hidden_by_scope = true; 697 698 // Do not hide immediate children of the current package. 699 if ((parent == 0) || 700 (parent->get_package () == cu.get_package ())) hidden_by_scope = false; 701 702 // Override default rule according to the scope filtering mode. 703 704 if (Cmt::get_scope_filtering_mode () == reach_private_uses) hidden_by_scope = false; 705 } 706 707 if (hidden_by_scope) 708 { 709 return (0); 710 } 711 712 // Here the version may contain wild cards 713 714 UseContext save = UseContext::current (); 715 716 /** 717 * "auto_imports" is the state which is specified on the use statement 718 * currently being parsed. 719 */ 720 switch (auto_imports) 721 { 722 case Unspecified: 723 724 // unspecified => we forward the state saved in the current use context 725 726 UseContext::set_current (UseContext::get_current_auto_imports ()); 727 break; 728 case Off: 729 730 // off => the context becomes constrained to be off 731 732 UseContext::set_current (Off); 733 break; 734 case On: 735 736 // on => if current context is off it is kept off 737 // otherwise it is forced to on 738 739 if (UseContext::get_current_auto_imports () != Off) 740 { 741 UseContext::set_current (On); 750 742 } 751 752 /// Now do create or retreive the Use object. 743 break; 744 } 745 746 if (Cmt::get_debug ()) 747 { 748 cout << "about to add " << package << endl; 749 show_packages (); 750 } 751 752 /// Now do create or retreive the Use object. 753 753 Use* new_use = Use::add (path, package, version, 754 754 version_alias, path_alias, native_version, … … 767 767 switch (new_use->auto_imports) 768 768 { 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 769 case Unspecified: 770 new_use->auto_imports = UseContext::get_current_auto_imports (); 771 if (new_use->auto_imports == Unspecified) 772 { 773 new_use->auto_imports = On; 774 } 775 break; 776 case On: 777 break; 778 case Off: 779 if (UseContext::get_current_auto_imports () == On) 780 { 781 /** 782 * Warning : this Use had been previously specified as -no_auto_imports 783 * Now this new specification tries to turn it to auto_imports. 784 * It will be required to propagate the change, according to the 785 * specifications: 786 * 787 * for all sub_uses: 788 * if it is unspecified OR specified as auto_imports: 789 * turn it to auto_imports 790 * 791 */ 792 new_use->set_auto_imports (On); 793 } 794 break; 795 795 } 796 796 … … 826 826 827 827 return (new_use); 828 828 } 829 829 830 830 private: 831 831 832 832 enum 833 {834 need_package,835 need_version,836 need_path,837 need_version_alias,838 need_path_alias,839 finished840 } state;833 { 834 need_package, 835 need_version, 836 need_path, 837 need_version_alias, 838 need_path_alias, 839 finished 840 } state; 841 841 842 842 State auto_imports; … … 888 888 else 889 889 { 890 890 it.set (ew); 891 891 } 892 892 } … … 1432 1432 cout << "Use::reach_package> (" << get_package_name () << " " 1433 1433 << version << ")from " << from_path << endl; 1434 1434 cout << "Use::reach_package> native_version required "<<n_version<<endl; 1435 1435 } 1436 1436 … … 1514 1514 if (Cmt::get_debug ()) 1515 1515 { 1516 1516 cout << "Use::reach_package-5>" << endl; 1517 1517 } 1518 1518 … … 1529 1529 1530 1530 if (CmtSystem::test_file ("cmt/requirements")) 1531 {1531 { 1532 1532 CmtSystem::cd ("cmt"); 1533 1533 … … 1535 1535 1536 1536 if (CmtSystem::test_file ("version.cmt")) 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1537 { 1538 cmt_string v; 1539 1540 v.read ("version.cmt"); 1541 int pos; 1542 pos = v.find ('\n'); 1543 if (pos != cmt_string::npos) v.erase (pos); 1544 pos = v.find ('\r'); 1545 if (pos != cmt_string::npos) v.erase (pos); 1546 1547 CompareStatus s = compare_versions (version, v); 1548 1549 if (Cmt::get_debug ()) 1550 { 1551 cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl; 1552 } 1553 1554 switch (s) 1555 { 1556 case IdenticalIds: 1557 case ExplicitOldMajorIdWinsAgainstWildarded: 1558 case ExplicitOldMinorIdWinsAgainstWildarded: 1559 case ExplicitOldPatchIdWinsAgainstWildarded: 1560 break; 1561 case ExplicitNewMajorIdWinsAgainstWildarded: 1562 case ExplicitNewMinorIdWinsAgainstWildarded: 1563 case NewMinorIdGreaterThanOld: 1564 case ExplicitNewPatchIdWinsAgainstWildarded: 1565 case NewPatchIdGreaterThanOld: 1566 break; 1567 case OldMajorIdGreaterThanNew: 1568 case NewMajorIdGreaterThanOld: 1569 break; 1570 case IncompatibleMajorIds: 1571 return (0); 1572 } 1573 version = v; 1574 } 1575 else if (version == "") 1576 { 1577 version = "v0"; 1578 } 1579 return (1); 1580 1580 } 1581 1581 else if (!CmtSystem::cd (version)) … … 1597 1597 CmtSystem::scan_dir (name, versions); 1598 1598 if (n_version != "") 1599 1599 { 1600 1600 CmtSystem::cmt_string_vector native_versions; 1601 1601 for (int i = 0; i < versions.size (); i++) 1602 1602 { 1603 1603 cmt_string path; 1604 1604 if (CmtSystem::test_directory (versions[i])) 1605 1605 { 1606 1606 path = versions[i]; 1607 1607 path += CmtSystem::file_separator (); 1608 1608 path += "cmt"; 1609 1609 } 1610 1610 else 1611 1611 { 1612 1612 path = "cmt"; 1613 1613 } 1614 1614 path += CmtSystem::file_separator (); 1615 1615 path += "native_version.cmt"; 1616 1616 1617 1617 if (CmtSystem::test_file (path)) 1618 { 1619 cmt_string nv; 1620 nv.read (path); 1621 int pos = nv.find ('\n'); 1622 if (pos != cmt_string::npos) nv.erase (pos); 1623 pos = nv.find ('\r'); 1624 if (pos != cmt_string::npos) nv.erase (pos); 1625 if (nv == n_version) 1626 { 1627 cmt_string& name_entry = native_versions.add (); 1628 // We have found at least one 1629 // cout <<"native_version :"<<n_version<<" ,version: "<< versions[i]<<endl; 1630 this->native_version = n_version; 1631 name_entry += versions[i]; 1632 } 1633 } 1634 } 1618 { 1619 cmt_string nv; 1620 1621 nv.read (path); 1622 int pos = nv.find ('\n'); 1623 if (pos != cmt_string::npos) nv.erase (pos); 1624 1625 pos = nv.find ('\r'); 1626 if (pos != cmt_string::npos) nv.erase (pos); 1627 1628 if (nv == n_version) 1629 { 1630 cmt_string& name_entry = native_versions.add (); 1631 1632 // We have found at least one 1633 // cout << "native_version :" << n_version << " ,version: " << versions[i] << endl; 1634 this->native_version = n_version; 1635 name_entry += versions[i]; 1636 } 1637 } 1638 } 1635 1639 versions = native_versions; 1636 1640 } 1637 1641 1638 1642 int i; … … 1706 1710 } 1707 1711 1708 1709 1710 1711 1712 // 1713 // We have now the list of possible alternate versions. However 1714 // we return that the expected package/version was not found (yet). 1715 // 1712 1716 1713 1717 return (0); … … 1768 1772 1769 1773 if (m_use->reach_package (path, this->native_version)) 1770 {1774 { 1771 1775 if (Cmt::get_debug ()) 1772 1776 { … … 1917 1921 { 1918 1922 cmt_string& name = alternate_versions[i]; 1919 1920 /*1921 if (CmtSystem::getenv ("CMTTESTUSEWILDCARDS") != "")1922 {1923 cout << "select_alternate[" << this << "]> package " << get_package_name () <<1924 " sv=" << specified_version <<1925 " v=" << version <<1926 " av[" << i << "]=" << name << endl;1927 }1928 */1929 1923 1930 1924 if (i == 0) … … 1971 1965 if (reach_package (alternate_paths[selected_index])) 1972 1966 { 1973 /*1974 if (CmtSystem::getenv ("CMTTESTUSEWILDCARDS") != "")1975 {1976 cout << "select_alternate2> package " << get_package_name () <<1977 " sv=" << specified_version <<1978 " v=" << version << endl;1979 }1980 */1981 1982 1967 if (Cmt::get_debug ()) 1983 1968 { … … 2000 1985 const cmt_string& n_version, 2001 1986 Use** old_use, 2002 1987 Use* context_use) 2003 1988 { 2004 1989 bool new_request = add_request (path, package, version); … … 2090 2075 2091 2076 if (Cmt::get_debug ()) 2092 2093 2094 2077 { 2078 cout << " ... exactly same version and path!" << endl; 2079 } 2095 2080 do_need_new = false; // We don't need a new one 2096 2081 if (n_version != use.native_version) 2097 2082 { 2098 2083 if (Cmt::get_debug ()) 2099 cout << " ... but native_version differs (" <<n_version<<"!="<<use.native_version<<") !" <<endl; 2084 { 2085 cout << " ... but native_version differs (" << n_version << "!=" << use.native_version << ") !" << endl; 2086 } 2087 2100 2088 do_need_new = true; 2101 2102 }2089 } 2090 } 2103 2091 else if (version != use.specified_version) 2104 2092 { … … 2129 2117 if ((new_v != -1) && (req_v != -1) && (new_v != req_v)) 2130 2118 { 2131 c out<< "# Required version " << version2119 cerr << "# Required version " << version 2132 2120 << " of package " << package; 2133 2121 2134 2122 if (context_use != 0) 2135 2123 { 2136 c out<< " [from " << context_use->get_package_name () << "]";2124 cerr << " [from " << context_use->get_package_name () << "]"; 2137 2125 } 2138 2126 2139 c out<< " incompatible with selected version " << use.version;2127 cerr << " incompatible with selected version " << use.version; 2140 2128 2141 2129 if (use.version != use.specified_version) 2142 2130 { 2143 c out<< " (" << use.specified_version << ")" ;2131 cerr << " (" << use.specified_version << ")" ; 2144 2132 } 2145 2133 2146 c out<< endl;2134 cerr << endl; 2147 2135 } 2148 2136 } … … 2220 2208 do_need_new = false; // We don't need a new one 2221 2209 if (n_version != use.native_version) 2222 { 2223 if (Cmt::get_debug ()) 2224 cout << " ... but native_version differs (" <<n_version<<"!="<<use.native_version<<") !" <<endl; 2225 do_need_new = true; 2226 } 2210 { 2211 if (Cmt::get_debug ()) 2212 { 2213 cout << " ... but native_version differs (" << n_version << "!=" << use.native_version << ") !" << endl; 2214 } 2215 2216 do_need_new = true; 2217 } 2227 2218 2228 2219 } … … 2254 2245 if ((new_v != -1) && (req_v != -1) && (new_v != req_v)) 2255 2246 { 2256 c out<< "# Required version " << version2247 cerr << "# Required version " << version 2257 2248 << " of package " << package; 2258 2249 2259 2250 if (context_use != 0) 2260 2251 { 2261 c out<< " [from " << context_use->get_package_name () << "]";2252 cerr << " [from " << context_use->get_package_name () << "]"; 2262 2253 } 2263 2254 2264 c out<< " incompatible with selected version " << use.version;2255 cerr << " incompatible with selected version " << use.version; 2265 2256 2266 2257 if (use.version != use.specified_version) 2267 2258 { 2268 c out<< " (" << use.specified_version << ")" ;2259 cerr << " (" << use.specified_version << ")" ; 2269 2260 } 2270 2261 2271 c out<< endl;2262 cerr << endl; 2272 2263 } 2273 2264 } … … 2395 2386 { 2396 2387 // Since we don't need a new Use, it means that old_use exists ! 2397 //if (specified_auto_imports !=old_use->auto_imports) 2398 //{ 2399 // if (Cmt::get_debug ()) 2400 // cout <<"# update auto_imports field in the use"<<endl; 2401 // old_use->auto_imports = specified_auto_imports; 2402 //} 2388 2403 2389 use = old_use; 2404 2390 old_use = 0; … … 2422 2408 cmt_string here = CmtSystem::pwd (); 2423 2409 2424 2425 2426 2427 2410 // 2411 // Store the specified sub_uses. Some of them may become discarded 2412 // later on. 2413 // 2428 2414 if (context_use != 0) 2429 2415 { … … 2543 2529 else 2544 2530 { 2545 2546 2547 2548 2531 // 2532 // This new version is different from the old one 2533 // thus we have to choose 2534 // 2549 2535 static BestFitSelector selector; 2550 2536 Use* selected_use = selector.operate (old_use, use); 2551 2537 2552 2538 if (Cmt::get_debug ()) … … 2558 2544 } 2559 2545 2560 2561 2562 2563 2546 // 2547 // Some situations managed by selector.operate happen 2548 // to fail discarding the rejected Use. 2549 // 2564 2550 if (use != selected_use) 2565 2551 { 2566 2552 use = use->set_selected_version (selected_use); 2567 2553 } 2568 2554 … … 2575 2561 } 2576 2562 2577 2578 2579 2580 2581 2563 // 2564 // The following statement is no longer considered as useful. 2565 // It is commented. But we should clarify why it was really needed! 2566 // 2567 //use->undiscard (); 2582 2568 2583 2569 if (found) … … 2595 2581 if ((use != &cu) && (package == cu.get_package ())) 2596 2582 { 2597 2583 // This is a recursive call to the current package!! 2598 2584 registered = true; 2599 2585 use->done = true; … … 2626 2612 /* 2627 2613 We look for all existing uses in that package. 2628 2614 */ 2629 2615 for (int i = 0; i < puses.size(); i++) 2630 2616 { … … 3161 3147 Symbol::expand (text); 3162 3148 3163 if (!Cmt::get_quiet ()) c out<< " Creating the reference file " << ref_file << endl;3149 if (!Cmt::get_quiet ()) cerr << " Creating the reference file " << ref_file << endl; 3164 3150 text.write (ref_file); 3165 3151 } … … 3186 3172 3187 3173 //if (!Cmt::get_quiet ()) 3188 c out<< " Symlinking " << libname << " to " << s << endl;3174 cerr << " Symlinking " << libname << " to " << s << endl; 3189 3175 3190 3176 if (symlinkcmd == "") … … 3229 3215 if (!Cmt::get_quiet ()) 3230 3216 { 3231 c out<< "# package " << get_package_name () <<3217 cerr << "# package " << get_package_name () << 3232 3218 " " << version << " " << path << 3233 3219 " not found" << … … 3339 3325 Use* Use::get_selected_version () 3340 3326 { 3341 //cout << "get_selected_version for package " << get_package_name () << endl;3342 3343 3327 if (!discarded) return (this); 3344 3328 … … 3373 3357 When switching, m_index and auto_imports are 3374 3358 transfered from the un-selected to the newly selected. 3375 3359 */ 3376 3360 Use* Use::set_selected_version (Use* selected_use) 3377 3361 { … … 3414 3398 auto_imports = new_state; 3415 3399 3416 3400 // We propagate only when we switch from Off to On 3417 3401 3418 3402 if ((old_state == Off) && (new_state == On)) … … 3637 3621 3638 3622 Result s accumulated into "list" 3639 3623 */ 3640 3624 bool Use::get_paths (Use* to, UsePtrVector& list) 3641 3625 { … … 3703 3687 /** 3704 3688 Now "this" is a candidate new entry in the list 3705 3689 */ 3706 3690 3707 3691 // First figure out whether 'to' is used by 'this'. … … 3716 3700 /** 3717 3701 Let's scan sub_uses now 3718 3702 */ 3719 3703 size = sub_uses.size (); 3720 3704 … … 3749 3733 Is that a bug? 3750 3734 Anyway we don't pursue on that branch. 3751 3735 */ 3752 3736 continue; 3753 3737 } … … 4034 4018 { 4035 4019 /* 4036 4037 { 4038 4039 4040 4041 4042 } 4043 4044 4045 4046 4020 if (verbose && !Cmt::get_quiet ()) 4021 { 4022 cerr << "# Required explicit version " << new_version 4023 << " of package " << ref_use->get_package_name () 4024 << " incompatible with selected explicit version " << ref_version 4025 << endl; 4026 } 4027 4028 CmtError::set (CmtError::version_conflict, "BestFitSelector::operate> "); 4029 4030 if (ref_use != new_use) new_use->discard (); 4047 4031 */ 4048 4032 … … 4105 4089 4106 4090 /* 4107 if (verbose && !Cmt::get_quiet ())4108 { 4109 4110 4111 4112 4091 if (verbose && !Cmt::get_quiet ()) 4092 { 4093 cerr << "# keep " << ref_vc << " version " << ref_version 4094 << " of package " << ref_use->get_package_name () 4095 << " (ignore " << new_vc << " version " << new_version << ")" 4096 << endl; 4113 4097 } 4114 4098 */ … … 4158 4142 { 4159 4143 /* 4160 if (verbose &&!Cmt::get_quiet ())4161 { 4162 4163 4164 4165 4144 if (verbose &&!Cmt::get_quiet ()) 4145 { 4146 cerr << "# keep " << ref_rc << " release " << ref_version 4147 << " of package " << ref_use->get_package_name () 4148 << " (ignore " << new_rc << " release " << new_version << ")" 4149 << endl; 4166 4150 } 4167 4151 */ … … 4217 4201 { 4218 4202 /* 4219 if (verbose && !Cmt::get_quiet ())4220 { 4221 4222 4223 4224 4225 4226 4203 if (verbose && !Cmt::get_quiet ()) 4204 { 4205 cerr << "# keep " << ref_pc << " patch " << ref_version 4206 << " [" << ref_use->specified_version << "]" 4207 << " of package " << ref_use->get_package_name () 4208 << " (ignore " << new_pc << " version " << new_version << ")" 4209 << " [" << new_use->specified_version << "]" 4210 << endl; 4227 4211 } 4228 4212 */ … … 4429 4413 Project* Use::get_project () 4430 4414 { 4431 4432 4433 4434 4435 4436 4437 } 4415 Project* p; 4416 cmt_string cmtpath = ""; 4417 cmt_string offset = ""; 4418 get_cmtpath_and_offset (cmtpath, offset); 4419 p = Project::find_by_cmtpath (cmtpath); 4420 return p; 4421 }
Note: See TracChangeset
for help on using the changeset viewer.