Changeset 400


Ignore:
Timestamp:
Apr 23, 2007, 11:10:18 AM (17 years ago)
Author:
arnault
Message:

Text formatting
Sending warnings & errors to stderr
Using internally PWD for every cd/pwd
CL 327

Location:
CMT/HEAD
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r397 r400  
     12007-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
     62007-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
    1382007-03-28 Vincent Garonne <garonne@lal.in2p3.fr> 326
    239
  • 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.h
    2 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.h
    3 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.h
    4 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.h
    5 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.h
    6 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.h
    7 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.h
    8 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.h
    9 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.h
    10 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.h
    11 cmt_string_cxx_dependencies =  ../source/cmt_string.cxx   ../source/cmt_std.h   ../source/cmt_string.h
    12 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.h
    13 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.h
    14 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.h
    15 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.h
    16 cmt_error_cxx_dependencies =  ../source/cmt_error.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_error.h   ../source/cmt_vector.h
    17 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.h
    18 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.h
    19 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.h
    20 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.h
    21 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.h
    22 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.h
    23 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.h
    24 cmt_regexp_cxx_dependencies =  ../source/cmt_regexp.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_regexp.h   ../source/cmt_vector.h   ../source/cmt_system.h
    25 cmt_model_cxx_dependencies =  ../source/cmt_model.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt_model.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_fragment.h   ../source/cmt_map.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_tag.h   ../source/cmt_symbol.h
    26 cmt_project_cxx_dependencies =  ../source/cmt_project.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_map.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_branch.h   ../source/cmt_fragment.h   ../source/cmt_group.h   ../source/cmt_constituent.h   ../source/cmt_language.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_cmtpath_pattern.h   ../source/cmt_database.h   ../source/cmt_syntax.h   ../source/cmt_error.h
    27 cmt_syntax_cxx_dependencies =  ../source/cmt_syntax.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_map.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt.h   ../source/cmt_parser.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_syntax.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_fragment.h   ../source/cmt_group.h   ../source/cmt_constituent.h   ../source/cmt_error.h   ../source/cmt_branch.h   ../source/cmt_language.h   ../source/cmt_cmtpath_pattern.h
    28 cmt_install_area_cxx_dependencies =  ../source/cmt_install_area.cxx   ../source/cmt_std.h   ../source/cmt_string.h   ../source/cmt_vector.h   ../source/cmt_regexp.h   ../source/cmt_system.h   ../source/cmt_parser.h   ../source/cmt.h   ../source/cmt_install_area.h   ../source/cmt_map.h   ../source/cmt_include.h   ../source/cmt_script.h   ../source/cmt_pattern.h   ../source/cmt_scope_section.h   ../source/cmt_use.h   ../source/cmt_awk.h   ../source/cmt_project.h   ../source/cmt_syntax.h   ../source/cmt_tag.h   ../source/cmt_symbol.h   ../source/cmt_cmtpath_pattern.h
    29 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.h
    30 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.h
    31 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.h
    32 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.h
    33 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.h
    34 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.h
     1cmt_cxx_dependencies =  ../source/cmt.cxx
     2cmt_awk_cxx_dependencies =  ../source/cmt_awk.cxx
     3cmt_branch_cxx_dependencies =  ../source/cmt_branch.cxx
     4cmt_constituent_cxx_dependencies =  ../source/cmt_constituent.cxx
     5cmt_deps_builder_cxx_dependencies =  ../source/cmt_deps_builder.cxx
     6cmt_fragment_cxx_dependencies =  ../source/cmt_fragment.cxx
     7cmt_generator_cxx_dependencies =  ../source/cmt_generator.cxx
     8cmt_include_cxx_dependencies =  ../source/cmt_include.cxx
     9cmt_parser_cxx_dependencies =  ../source/cmt_parser.cxx
     10cmt_script_cxx_dependencies =  ../source/cmt_script.cxx
     11cmt_string_cxx_dependencies =  ../source/cmt_string.cxx
     12cmt_system_cxx_dependencies =  ../source/cmt_system.cxx
     13cmt_tag_cxx_dependencies =  ../source/cmt_tag.cxx
     14cmt_use_cxx_dependencies =  ../source/cmt_use.cxx
     15cmt_symbol_cxx_dependencies =  ../source/cmt_symbol.cxx
     16cmt_error_cxx_dependencies =  ../source/cmt_error.cxx
     17cmt_pattern_cxx_dependencies =  ../source/cmt_pattern.cxx
     18cmt_language_cxx_dependencies =  ../source/cmt_language.cxx
     19cmt_cvs_cxx_dependencies =  ../source/cmt_cvs.cxx
     20cmt_group_cxx_dependencies =  ../source/cmt_group.cxx
     21cmt_database_cxx_dependencies =  ../source/cmt_database.cxx
     22cmt_lock_cxx_dependencies =  ../source/cmt_lock.cxx
     23cmt_triggers_cxx_dependencies =  ../source/cmt_triggers.cxx
     24cmt_regexp_cxx_dependencies =  ../source/cmt_regexp.cxx
     25cmt_model_cxx_dependencies =  ../source/cmt_model.cxx
     26cmt_project_cxx_dependencies =  ../source/cmt_project.cxx
     27cmt_syntax_cxx_dependencies =  ../source/cmt_syntax.cxx
     28cmt_install_area_cxx_dependencies =  ../source/cmt_install_area.cxx
     29cmt_cmtpath_pattern_cxx_dependencies =  ../source/cmt_cmtpath_pattern.cxx
     30cmt_sequence_cxx_dependencies =  ../source/cmt_sequence.cxx
     31cmt_generators_cxx_dependencies =  ../source/cmt_generators.cxx
     32cmt_scope_section_cxx_dependencies =  ../source/cmt_scope_section.cxx
     33cmt_log_cxx_dependencies =  ../source/cmt_log.cxx
     34cmt_commands_cxx_dependencies =  ../source/cmt_commands.cxx
  • CMT/HEAD/source/cmt.cxx

    r389 r400  
    1414/*----------------------------------------------------------*/
    1515{
    16    //cout << "argc=" << argc << endl;
    1716  int status = Cmt::parser (argc, argv);
     17
    1818  // Extract the pure status code
    1919  if  (status > 255)
    20     status =  status/256;
     20    {
     21      status =  status/256;
     22    }
     23
    2124  return (status);
    2225}
  • CMT/HEAD/source/cmt_awk.cxx

    r344 r400  
    1818public:
    1919  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;)
    2144      {
     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;
    2284      }
    2385
    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)
    31115      {
    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            //
    46129           
    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;
    89155      }
    90156
    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)
    99158      {
    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      }
    124194       
    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  }
    204197
    205198private:
     
    252245          int nl = text.find (pos, '\n');
    253246         
    254             // Get the first end-of-line (either lf or cr-lf)
    255 
    256             //--------------------
    257             //
    258             //     cr    1    0
    259             //   nl
    260             //
    261             //    1      a    b
    262             //
    263             //    0      c    d
    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          //--------------------
    266259         
    267260          int first = nl;
     
    269262          if (cr != cmt_string::npos)
    270263            {
    271                 // cases a or c
     264              // cases a or c
    272265
    273266              if (nl == cmt_string::npos)
    274267                {
    275                     // case a
     268                  // case a
    276269                  first = cr;
    277270                }
    278271              else
    279272                {
    280                     // case c
     273                  // case c
    281274                  first = (nl < cr) ? nl : cr;
    282275                }
     
    285278          if (first == cmt_string::npos)
    286279            {
    287                 // This is likely the last line since there is no end-of-line
     280              // This is likely the last line since there is no end-of-line
    288281              text.substr (pos, line);
    289282              pos = max_pos;
     
    291284          else if (first > pos)
    292285            {
    293                 // The eol was found beyond the current position
    294                 // (ie. this is a non empty line)
     286              // The eol was found beyond the current position
     287              // (ie. this is a non empty line)
    295288              text.substr (pos, first - pos, line);
    296289              pos = first + 1;
     
    298291          else
    299292            {
    300                 // an empty line
     293              // an empty line
    301294              line = "";
    302295              pos++;
     
    337330  if (m_condition != ok) return (m_condition);
    338331
    339     /*
    340   if (CmtSystem::testenv ("CMTTESTAWK"))
    341     {
    342     }
    343   else
    344     {
    345       cmt_string line;
    346       int pos = 0;
    347       int max_pos;
    348 
    349       max_pos = text.size ();
    350 
    351       for (pos = 0; pos < max_pos;)
    352         {
    353           int cr = text.find (pos, "\r\n");
    354           int nl = text.find (pos, '\n');
    355          
    356             // Get the first end-of-line (either lf or cr-lf)
    357          
    358           int first = nl;
    359          
    360           if (cr != cmt_string::npos)
    361             {
    362               if (nl == cmt_string::npos)
    363                 {
    364                   first = cr;
    365                 }
    366               else
    367                 {
    368                   first = (nl < cr) ? nl : cr;
    369                 }
    370             }
    371          
    372           if (first == cmt_string::npos)
    373             {
    374                 // This is likely the last line since there is no end-of-line
    375               text.substr (pos, line);
    376               pos = max_pos;
    377             }
    378           else if (first > pos)
    379             {
    380                 // The eol was found beyond the current position
    381                 // (ie. this is a non empty line)
    382               text.substr (pos, first - pos, line);
    383               pos = first + 1;
    384             }
    385           else
    386             {
    387                 // an empty line
    388               line = "";
    389               pos++;
    390             }
    391          
    392           m_line_number++;
    393          
    394           if (line != "")
    395             {
    396               if (expression.match (line))
    397                 {
    398                   filter (line);
    399                   if (m_condition != ok) return (m_condition);
    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  */
    405398
    406399  end ();
     
    441434void Awk::filter (const cmt_string& /*line*/)
    442435{
    443     //cout << "awk> " << line << endl;
    444436}
    445437
     
    612604  if (level > 10)
    613605    {
    614       //cout << "#PathScanner::scan_path> too deep search path=" << path << endl;
    615606      return;
    616607    }
     
    652643      CmtSystem::basename (here, entry);
    653644      CmtSystem::dirname (path, where);
    654 
    655       //cout << "## here=" << here << " entry=" << entry << " where=" << where << endl;
    656645
    657646      if ((level == 0) && (entry == "InstallArea")) continue;
     
    674663          version = entry;
    675664          CmtSystem::basename (path, name);
    676 
    677           //cout << "#1" << endl;
    678665
    679666          a.run (name, version, where);
     
    719706              pos = version.find ('\r');
    720707              if (pos != cmt_string::npos) version.erase (pos);
    721 
    722               //cout << "#2" << endl;
    723708
    724709              a.run (entry, version, path, true);
     
    755740                  // The structure is without the version directory.
    756741                 
    757                   //cout << "#3" << endl;
    758                  
    759742                  a.run (name, "v1", path);
    760743                  has_package = true;
     
    771754                {
    772755                  // The structure is with the version directory.
    773                  
    774                   //cout << "#4" << endl;
    775756                 
    776757                  a.run (name, version, where);
     
    796777          if (CmtSystem::is_version_directory (version))
    797778            {
    798               //cout << "#5" << endl;
    799              
    800779              a.run (entry, version, where);
    801780              has_package = true;
     
    814793          where += entry;
    815794         
    816           //cout << "#6" << endl;
    817          
    818795          a.run (name, "v1", where);
    819796          has_package = true;
     
    826803      //
    827804      // Here this is a non-package directory. Let's search further down
    828       //cout << "#7" << endl;
    829805
    830806      scan_path (here, level + 1, a);
     
    845821          p += e;
    846822
    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 
    856823          scan_path (p, 1, a);
    857824        }
     
    907874          if (CmtSystem::test_file (req))
    908875            {
    909               //cout << " -> no version" << endl;
    910 
    911876              cmt_string req;
    912877             
     
    930895                }
    931896
    932               cout << package << " " << version << " " << path << endl;
    933 
    934897              result = true;
    935898            }
     
    947910          if (CmtSystem::test_file (req))
    948911            {
    949               //cout << " -> cmt" << endl;
    950 
    951912              cout << package << " " << version << " " << path << endl;
    952913
     
    955916          else
    956917            {
    957               //cout << " -> no cmt" << endl;
    958 
    959918              req = name;
    960919              req += CmtSystem::file_separator ();
     
    965924              if (CmtSystem::test_file (req))
    966925                {
    967                   //cout << " -> mgr" << endl;
    968 
    969926                  cout << package << " " << version << " " << path << endl;
    970927
     
    973930              else
    974931                {
    975                   //cout << " -> no mgr" << endl;
    976932                }
    977933            }
     
    979935      else
    980936        {
    981           //cout << " -> stop" << endl;
    982937        }
    983938    }
  • CMT/HEAD/source/cmt_branch.cxx

    r11 r400  
    2121/*----------------------------------------------------------*/
    2222void Branch::action (const CmtSystem::cmt_string_vector& words)
    23 /*----------------------------------------------------------*/
     23  /*----------------------------------------------------------*/
    2424{
    2525  for (int i = 1; i < words.size (); i++)
     
    3434/*----------------------------------------------------------*/
    3535Branch* Branch::find (const cmt_string& name)
    36 /*----------------------------------------------------------*/
     36  /*----------------------------------------------------------*/
    3737{
    3838  static BranchVector& Branches = branches ();
     
    5959/*----------------------------------------------------------*/
    6060void Branch::add (const cmt_string& name)
    61 /*----------------------------------------------------------*/
     61  /*----------------------------------------------------------*/
    6262{
    6363  static BranchVector& Branches = branches ();
     
    7777/*----------------------------------------------------------*/
    7878void Branch::print_all (PrintMode mode)
    79 /*----------------------------------------------------------*/
     79  /*----------------------------------------------------------*/
    8080{
    8181  static BranchVector& Branches = branches ();
     
    9393/*----------------------------------------------------------*/
    9494void Branch::clear_all ()
    95 /*----------------------------------------------------------*/
     95  /*----------------------------------------------------------*/
    9696{
    9797  static BranchVector& Branches = branches ();
     
    111111/*----------------------------------------------------------*/
    112112Branch::BranchVector& Branch::branches ()
    113 /*----------------------------------------------------------*/
     113  /*----------------------------------------------------------*/
    114114{
    115115  static Database& db = Database::instance ();
     
    121121/*----------------------------------------------------------*/
    122122Branch::Branch ()
    123 /*----------------------------------------------------------*/
     123  /*----------------------------------------------------------*/
    124124{
    125125}
     
    127127/*----------------------------------------------------------*/
    128128Branch::~Branch ()
    129 /*----------------------------------------------------------*/
     129  /*----------------------------------------------------------*/
    130130{
    131131}
     
    133133/*----------------------------------------------------------*/
    134134const cmt_string& Branch::name () const
    135 /*----------------------------------------------------------*/
     135  /*----------------------------------------------------------*/
    136136{
    137137  return (m_name);
     
    140140/*----------------------------------------------------------*/
    141141void Branch::print (PrintMode mode) const
    142 /*----------------------------------------------------------*/
     142  /*----------------------------------------------------------*/
    143143{
    144144  cout << m_name;
  • CMT/HEAD/source/cmt_cmtpath_pattern.cxx

    r283 r400  
    1919  if (words.size () < 1) return;
    2020
    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     //
     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  //
    3131
    3232  add (words, use, revert);
     
    5151  int first_word = 1;
    5252
    53     //
    54     // Install the cmt-statement as a vector of words.
    55     //
     53  //
     54  // Install the cmt-statement as a vector of words.
     55  //
    5656  for (int i = first_word; i < words.size (); i++)
    5757    {
  • CMT/HEAD/source/cmt_constituent.cxx

    r363 r400  
    121121public:
    122122  typedef enum
    123   {
    124     ready,
    125     need_include
    126   } states;
     123    {
     124      ready,
     125      need_include
     126    } states;
    127127
    128128  constituents_action_iterator (Constituent& c) : m_constituent (c)
     
    178178        if (m_constituent.type == Library)
    179179          {
    180               //m_constituent.build_triggers = true;
     180            //m_constituent.build_triggers = true;
    181181          }
    182182      }
     
    212212    else if (w.substr (0, 8) == "-import=")
    213213      {       
    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             }       
     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          }       
    226226      }
    227227    else if (w.substr (0, 7) == "-group=")
     
    246246    else if (w.substr (0, 1) == "-")
    247247      {
    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            //}
     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        //}
    254254      }
    255255    else if ((equal = w.find ("=")) != cmt_string::npos)
     
    576576  switch (type)
    577577    {
    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;
     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;
    587587    }
    588588 
  • CMT/HEAD/source/cmt_cvs.cxx

    r295 r400  
    1717/**
    1818
    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  */
     19Grep : perform a grep like operation onto a cmt_string
     20
     21o All lines of the input string are collected when they contain
     22the specified pattern.
     23o The input string and the selector pattern are specified in
     24the constructor:
     25
     26Grep (input_string, pattern)
     27
     28o All selected lines are accumulated (appended) into the internal
     29variable m_result . 'space' is the separator.
     30
     31o The accumulator is retrieved by the result () method.
     32
     33*/
    3434class Grep : public Awk
    3535{
     
    4646/**
    4747
    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  */
     48Cut : perform a cut-like operation :
     49
     50o collect the <field>'th field of every line into the m_result
     51internal variable
     52
     53o the field number is given in the constructor and starts at zero.
     54
     55o selected fields are accumulated with a space as separator.
     56
     57*/
    5858class Cut : public Awk
    5959{
     
    244244  /**
    245245     Filter out the space-separated words of a text that don't match a regexp.
    246    */
     246  */
    247247  void filter_list (cmt_string& text, const cmt_regexp& exp)
    248248  {
     
    272272    if (m_verbose || m_simulation)
    273273      {
    274         cout << "#CMT> Executing [" << command << "]" << endl;
     274        cerr << "#CMT> Executing [" << command << "]" << endl;
    275275      }
    276276   
     
    296296            retry++;
    297297           
    298             cout << "# " << message << ": status=" << status << endl;
    299             cout << "#---------------------------------------------------------" << endl;
     298            cerr << "# " << message << ": status=" << status << endl;
     299            cerr << "#---------------------------------------------------------" << endl;
    300300           
    301301            if (retry > 5) exit(0);
     
    314314    if (m_verbose || m_simulation)
    315315      {
    316         cout << "#CMT> Executing [" << command << "]" << endl;
     316        cerr << "#CMT> Executing [" << command << "]" << endl;
    317317      }
    318318   
     
    325325    //if (m_verbose || m_simulation)
    326326    //  {
    327     //       cout << out << endl;
     327    //       cerr << out << endl;
    328328    //  }
     329
    329330    return (status);
    330331  }
     
    350351
    351352     In simulation mode we suppose the expected protocol has been found.
    352    */
     353  */
    353354  bool check_protocol ()
    354355  {
     
    403404        if (found)
    404405          {
    405             cout << "#CMT> Protocol level " << m_protocol_level << endl;
     406            cerr << "#CMT> Protocol level " << m_protocol_level << endl;
    406407          }
    407408        else
    408409          {
    409             cout << "#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;
    410411          }
    411412      }
     
    420421     We create a temporary directory just to lauch the command. However nothing
    421422     should change in this temporary directory since the pluggin returns an error status.
    422    */
     423  */
    423424  void retreive_cvs_infos (const cmt_string& module)
    424425  {
     
    456457        if (!CmtSystem::mkdir (tmp_dir))
    457458          {
    458             cout << "#CMT> Cannot create the temporary directory [" << tmp_dir << "]" << endl;
     459            cerr << "#CMT> Cannot create the temporary directory [" << tmp_dir << "]" << endl;
    459460            return;
    460461          }
     
    465466    if (!CmtSystem::cd (tmp_dir))
    466467      {
    467         cout << "#CMT> Cannot move to the temporary directory " << tmp_dir << endl;
     468        cerr << "#CMT> Cannot move to the temporary directory " << tmp_dir << endl;
    468469       
    469470        if (m_verbose)
    470471          {
    471             cout << "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl;
     472            cerr << "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl;
    472473          }
    473474       
     
    479480    if (m_verbose)
    480481      {
    481         cout << "#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; 
    482483      }
    483484   
    484485    /**
    485486       The script associated to such entries is supposed to :
    486         1) extract the set of <infos> from ${module}/cmt/requirements
    487                                         or ${module}/cmt/project.cmt
    488         2) build an output of the form :
    489             <infos>=info1 info2 info3 ...
     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 ...
    490491     
    491492       Currently this script can be found in
     
    535536    if (m_verbose)
    536537      {
    537         cout << "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl;
     538        cerr << "#CMT> now removing tmp_dir " << tmp_dir << " home=" << home_dir << endl;
    538539      }
    539540   
     
    549550     the script named cmt_buildcvsinfos2.sh (referenced in the loginfo script)
    550551   
    551       This script performs a scan in the CVS repository for the following types of
     552     This script performs a scan in the CVS repository for the following types of
    552553     information :
    553554   
    554        the recognized structure below this module (none, project, package)
    555        all top symbolic tags installed for the module
    556        all symbolic tags installed for the module
    557        all branches available below this module
    558        all subpackages installed below the module.
    559        all subprojects installed below the module.
    560    
    561         In principle, only modules corresponding to true CMT products (packages or projects) are considered.
    562           o tags are obtained from the requirements or the project file
    563           o branches are sub-directories which are not themselves packages
    564           o subpackages are sub-directories which are CMT packages
    565             (a subdirectory is always either a branch or a subpackage)
     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)
    566567  */
    567568  void get_cvs_infos_with_offset (const cmt_string& module)
     
    569570    if (!check_protocol ())
    570571      {
    571         cout << "#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;
    572573        return;
    573574      }
     
    575576    if (module == "")
    576577      {
    577         cout << "#CMT> cmt cvs needs a module name" << endl;
     578        cerr << "#CMT> cmt cvs needs a module name" << endl;
    578579        return;
    579580      }
     
    583584        if (m_verbose)
    584585          {
    585             cout << "#CMT> cvs infos for module " << module << " already there" << endl;
     586            cerr << "#CMT> cvs infos for module " << module << " already there" << endl;
    586587          }
    587588      }
     
    712713       from the answr of the CVS pluggin.
    713714       The pattern is a regexp but it may also contain the <package> template
    714      */
     715    */
    715716    cmt_string tag_filter = CmtSystem::getenv ("CMTCVSTAGFILTER");
    716717   
     
    758759     matching a given regular expression.
    759760
    760        o The first matching tag is returned into 'version'
    761        o Success is returned as function value.
    762 
    763    */
     761     o The first matching tag is returned into 'version'
     762     o Success is returned as function value.
     763
     764  */
    764765  bool match_version_request (const cmt_string& text,
    765766                              const cmt_regexp& version_exp,
     
    835836    if (m_verbose)
    836837      {
    837              cout << "#CMT> requesting cvs infos onto module " << module << endl;
     838        cerr << "#CMT> requesting cvs infos onto module " << module << endl;
    838839      }
    839840   
     
    843844      {
    844845        versions = "";
    845         cout << "#CMT> Product " << product << " not found in ${CVSROOT}" << endl;
     846        cerr << "#CMT> Product " << product << " not found in ${CVSROOT}" << endl;
    846847        return (false);
    847848      }
     
    927928  bool do_need_version ()
    928929  {
    929      bool need_version = false;
     930    bool need_version = false;
    930931
    931932    if (structure_info == "project")
    932     {
    933              need_version = true;
    934              //CmtStructuringStyle style = Cmt::get_current_structuring_style ();
    935          //if (style == default_structuring_style)
    936              //{
    937              //   Use& current_use = Use::current ();
    938              //   if (current_use.get_strategy ("VersionDirectory"))
    939              //      need_version = true;
    940              //}
    941              //else if (style == with_version_directory)
    942              //    need_version = true;               
    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      }
    945946    else
    946947      {
    947              CmtStructuringStyle style = Cmt::get_current_structuring_style ();
    948          if (style == default_structuring_style)
    949              {
    950                 Use& current_use = Use::current ();
    951                 if (current_use.get_strategy ("VersionDirectory"))
    952                    need_version = true;
    953              }
    954              else if (style == with_version_directory)
    955                  need_version = true;           
     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;         
    956957      }
    957958
     
    961962  /**
    962963     Take care of structuring style for packages and of project vs package conventions
    963    */
     964  */
    964965  cmt_string build_version_directory (const cmt_string& offset,
    965966                                      const cmt_string& product,
     
    994995  /**
    995996     Wrapper to mkdir handling simulation and verbose options.
    996    */
     997  */
    997998  bool mkdir (const cmt_string& dir)
    998999  {
    9991000    if (m_simulation)
    10001001      {
    1001         cout << "#CMT> Would create the " << dir << " directory" << endl;
     1002        cerr << "#CMT> Would create the " << dir << " directory" << endl;
    10021003      }
    10031004    else
     
    10071008            if (m_verbose)
    10081009              {
    1009                 cout << "#CMT> About to mkdir " << dir << endl;
     1010                cerr << "#CMT> About to mkdir " << dir << endl;
    10101011              }
    10111012
     
    10131014            if (!CmtSystem::cd (dir))
    10141015              {
    1015                 cout << "# Error creating the directory :" << dir << endl;
    1016                 cout << "#---------------------------------------------------------" << endl;
     1016                cerr << "# Error creating the directory :" << dir << endl;
     1017                cerr << "#---------------------------------------------------------" << endl;
    10171018                return (false);
    10181019              }
     
    10261027     package context. Thus it's likely that CMTPATH are not completely defined.
    10271028     This function manually prepends CMTPATH entries to the environment variable.
    1028    */
     1029  */
    10291030  void add_cmtpath (const cmt_string& dir)
    10301031  {
     
    10441045    if (m_verbose)
    10451046      {
    1046         cout << "#CMT> CMTPATH=" << CmtSystem::getenv ("CMTPATH") << endl;
     1047        cerr << "#CMT> CMTPATH=" << CmtSystem::getenv ("CMTPATH") << endl;
    10471048      }
    10481049  }
     
    10501051  /**
    10511052     Specific checkout of one project
    1052    */
     1053  */
    10531054  bool really_checkout_project_contents (const cmt_string& offset,
    10541055                                         const cmt_string& project,
     
    10621063    cmt_string dir = currentdir;
    10631064
    1064     cout << "  # get project files into " << dir << endl;
     1065    cerr << "  # get project files into " << dir << endl;
    10651066
    10661067
     
    10961097     if the top directory of a product is empty. (In this case the
    10971098     co -l results in nothing)
    1098    */
     1099  */
    10991100  void make_management_files (const cmt_string& module,
    11001101                              const cmt_string& entries_text)
     
    11261127        if (m_simulation)
    11271128          {
    1128             cout << "#CMT> Would fill in the CVS/Root file with " << endl;
    1129             cout << s << endl;
     1129            cerr << "#CMT> Would fill in the CVS/Root file with " << endl;
     1130            cerr << s << endl;
    11301131          }
    11311132        else
     
    11331134            if (m_verbose)
    11341135              {
    1135                 cout << "#CMT> Fill in the CVS/Root file with " << endl;
    1136                 cout << s << endl;
     1136                cerr << "#CMT> Fill in the CVS/Root file with " << endl;
     1137                cerr << s << endl;
    11371138              }
    11381139            s.write (f);
     
    11591160        if (m_simulation)
    11601161          {
    1161             cout << "#CMT> Would fill in the CVS/Repository file with " << endl;
    1162             cout << s << endl;
     1162            cerr << "#CMT> Would fill in the CVS/Repository file with " << endl;
     1163            cerr << s << endl;
    11631164          }
    11641165        else
     
    11661167            if (m_verbose)
    11671168              {
    1168                 cout << "#CMT> Fill in the CVS/Repository file with " << endl;
    1169                 cout << s << endl;
     1169                cerr << "#CMT> Fill in the CVS/Repository file with " << endl;
     1170                cerr << s << endl;
    11701171              }
    11711172            s.write (f);
     
    11751176    if (m_simulation)
    11761177      {
    1177         cout << "#CMT> Would write the top CVS/Entries file with " << endl;
    1178         cout << entries_text << endl;
     1178        cerr << "#CMT> Would write the top CVS/Entries file with " << endl;
     1179        cerr << entries_text << endl;
    11791180      }
    11801181    else
     
    11981199        if (m_verbose)
    11991200          {
    1200             cout << "#CMT> Fill in the top CVS/Entries file with " << endl;
    1201             cout << text << endl;
     1201            cerr << "#CMT> Fill in the top CVS/Entries file with " << endl;
     1202            cerr << text << endl;
    12021203          }
    12031204
     
    12141215     3) build the CVS/Entries file for subdirs and co individual subdirs
    12151216     4) write the CVS management files if CVS did not do it.
    1216    */
     1217  */
    12171218  bool really_checkout_package_contents (const cmt_string& offset,
    12181219                                         const cmt_string& package,
     
    12251226    cmt_string dir = currentdir;
    12261227
    1227     cout << "  # get top files " << endl;
     1228    cerr << "  # get top files " << endl;
    12281229           
    12291230    cmt_string command = "cvs -f -Q co -l ";
     
    12581259    if (need_version)
    12591260      {
    1260                if (!mkdir (version)) return (false);   
    1261                dir += CmtSystem::file_separator ();
    1262                dir += version;
     1261        if (!mkdir (version)) return (false);   
     1262        dir += CmtSystem::file_separator ();
     1263        dir += version;
    12631264      }
    12641265    else
     
    12721273    if (m_verbose)
    12731274      {
    1274         cout << "#CMT> Now getting subdirectories pwd=" << CmtSystem::pwd () << " dir=" << dir << endl;
     1275        cerr << "#CMT> Now getting subdirectories pwd=" << CmtSystem::pwd () << " dir=" << dir << endl;
    12751276      }
    12761277   
     
    12791280    if (branches == "")
    12801281      {
    1281             branches = branches_info;
     1282        branches = branches_info;
    12821283      }
    12831284   
     
    12921293    if (!CmtSystem::test_directory ("CVS"))
    12931294      {
    1294           int i;
    1295           for (i = 0; i < branch_vector.size (); i++)
    1296             {
    1297                cmt_string& branch = branch_vector[i];   
    1298                if (i > 0)
    1299                    {
    1300                       command += CmtSystem::command_separator ();
    1301                    }
    1302        
    1303                command += "cvs -f -Q co ";
    1304        
    1305                if (!at_head)
    1306                   {
    1307                      command += "-r ";
    1308                      command += version;
    1309                   }
    1310        
    1311                command += " -d ";
    1312                command += branch;
    1313                command += " ";
    1314                command += module;
    1315                command += "/";    // CVS uses the '/' notation on all platforms!!
    1316                command += branch;
    1317        
    1318                text += "D/";
    1319                text += branch;
    1320                text += "////\n";
    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          }
    13221323        execute_and_retry (command, "Error getting package contents");
    13231324
     
    13251326
    13261327        if (need_touch_files)
    1327         { 
    1328    
    1329             cout << "# --> udapte the file timestamps" << endl;                 
     1328          { 
     1329   
     1330            cerr << "# --> udapte the file timestamps" << endl;                 
    13301331            for (i = 0; i < branch_vector.size (); i++)
    1331             {   
    1332                     cmt_string& branch = branch_vector[i];   
     1332              {
     1333                cmt_string& branch = branch_vector[i];   
    13331334                CmtSystem::cmt_string_vector& list = CmtSystem::scan_dir (branch);
    13341335                int j;
    13351336                for (j = 0; j < list.size (); j++)
    1336                     if (CmtSystem::test_file(list[j]))               
    1337                         CmtSystem::touch_file (list[j]);
    1338             }
    1339         }       
     1337                  if (CmtSystem::test_file(list[j]))               
     1338                    CmtSystem::touch_file (list[j]);
     1339              }
     1340          }       
    13401341        return (true);   
    13411342      }
     
    13531354    for (i = 0; i < branch_vector.size (); i++)
    13541355      {
    1355             cmt_string& branch = branch_vector[i];
    1356             if (branch != "CVS")
    1357             {   
    1358                 command += " ";
    1359                 command += branch;
    1360              }
     1356        cmt_string& branch = branch_vector[i];
     1357        if (branch != "CVS")
     1358          {   
     1359            command += " ";
     1360            command += branch;
     1361          }
    13611362      }
    13621363
     
    13681369
    13691370    if (need_touch_files)
    1370    
    1371    
    1372         cout << "# --> udapte the file timestamps" << endl;                 
     1371     
     1372   
     1373        cerr << "# --> udapte the file timestamps" << endl;                 
    13731374        for (i = 0; i < branch_vector.size (); i++)
    1374         {       
    1375                 cmt_string& branch = branch_vector[i];   
     1375          {     
     1376            cmt_string& branch = branch_vector[i];   
    13761377            CmtSystem::cmt_string_vector& list = CmtSystem::scan_dir (branch);
    13771378            int j;
    13781379            for (j = 0; j < list.size (); j++)
    1379                 if (CmtSystem::test_file(list[j]))               
    1380                     CmtSystem::touch_file (list[j]);
    1381         }
    1382     }       
     1380              if (CmtSystem::test_file(list[j]))               
     1381                CmtSystem::touch_file (list[j]);
     1382          }
     1383      }       
    13831384    return (true);
    13841385  }
     
    13861387  /**
    13871388     Effective checkout of a package or a project
    1388    */
     1389  */
    13891390  bool really_checkout (const cmt_string& offset,
    13901391                        const cmt_string& product,
     
    13981399    cmt_string out;
    13991400   
    1400     cout << "# ================= working on " << structure_info << " " << product
     1401    cerr << "# ================= working on " << structure_info << " " << product
    14011402         << " version " << version;
    14021403
    1403     if (at_head) cout << " (At head) ";
     1404    if (at_head) cerr << " (At head) ";
    14041405
    14051406    cmt_string full_offset;
     
    14161417      }
    14171418   
    1418     cout << echo_ppath << " in " << dir << endl;
     1419    cerr << echo_ppath << " in " << dir << endl;
    14191420
    14201421    if (do_need_version ())
     
    14571458     FME is first converted into a RE then a directory search is performed.
    14581459     An empty string is returned if no match is found.
    1459    */
     1460  */
    14601461  cmt_string find_matching_version (const cmt_string& expression)
    14611462  {
     
    15621563        add_cmtpath (here);
    15631564
    1564         cout << "  # --> now getting project packages from the " << container << " " << here << endl;
     1565        cerr << "  # --> now getting project packages from the " << container << " " << here << endl;
    15651566
    15661567        CmtSystem::cd (here);
     
    15821583     Check whether a given directory structure matches an expected product structure
    15831584     given by the structure info obtained from the most recent request to the CVS pluggin
    1584    */
     1585  */
    15851586  bool check_structure (const cmt_string& dir, const cmt_string& version)
    15861587  {
     
    15881589    if (!CmtSystem::test_directory (dir))
    15891590      {
    1590                return (false);
     1591        return (false);
    15911592      }
    15921593
     
    16041605        if (CmtSystem::test_file (file_name))
    16051606          {       
    1606                if (!do_need_version ())
    1607                {
    1608                    // open the version.cmt file and compare the version
    1609                  cmt_string current_version;
    1610                  cmt_string version_file = dir;
    1611                  version_file += CmtSystem::file_separator ();
    1612                  version_file += "CVS";
    1613                  version_file += CmtSystem::file_separator ();
    1614                  version_file += "Tag";
    1615                  current_version.read (version_file);               
    1616                  //cout <<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl;
    1617                  return current_version=="N"+version+"\n";                 
    1618                 }   
    1619                 else
    1620                        result = true;
     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;
    16211622          }
    16221623        else
     
    16311632            if (CmtSystem::test_file (file_name))
    16321633              {
    1633                if (!do_need_version ())
    1634                {
    1635                    // open the version.cmt file and compare the version
    1636                  cmt_string current_version;
    1637                  cmt_string version_file = dir;
    1638                  version_file += CmtSystem::file_separator ();
    1639                  version_file += "CVS";
    1640                  version_file += CmtSystem::file_separator ();
    1641                  version_file += "Tag";
    1642                  current_version.read (version_file);               
    1643                  //cout <<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl;
    1644                  return current_version=="N"+version+"\n";                 
    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                  }   
    16461647                else
    1647                        result = true;
     1648                  result = true;
    16481649              }
    16491650          }
     
    16631664            result = true;
    16641665          }
    1665     }
     1666      }
    16661667
    16671668    return (result);
     
    16781679     - the version directory
    16791680     - the CVS tag
    1680    */
     1681  */
    16811682  void do_checkout_phase2 (const cmt_string& offset,
    16821683                           const cmt_string& product,
     
    16861687    if (m_verbose)
    16871688      {
    1688         cout << "#CMT> do_checkout_phase2> offset=" << offset
     1689        cerr << "#CMT> do_checkout_phase2> offset=" << offset
    16891690             << " " << structure_info << "=" << product
    16901691             << " specified_version=" << specified_version
     
    17111712    if (version == "")
    17121713      {
    1713         cout << "# ================= No version specified for " << structure_info << " " << product << endl;
     1714        cerr << "# ================= No version specified for " << structure_info << " " << product << endl;
    17141715        return;
    17151716      }
     
    17311732    cmt_string effective_version = "";
    17321733    if (do_need_version ())
    1733     {
    1734     /* Important this part should be enhanced ASAP
    1735        and deal with many other cases.... arghhhh !!
    1736     */   
     1734      {
     1735        /* Important this part should be enhanced ASAP
     1736           and deal with many other cases.... arghhhh !!
     1737        */   
    17371738        effective_version = find_matching_version (dir);         
    1738     }
     1739      }
    17391740
    17401741
     
    17621763        if (cvs_tag.find ("*") != cmt_string::npos)
    17631764          {
    1764             cout << "# ================= " << structure_info << " " << product
     1765            cerr << "# ================= " << structure_info << " " << product
    17651766                 << " version " << cvs_tag << echo_ppath
    17661767                 << " has wild cards and will not be considered." << endl;
     
    18011802    if (check_structure (dir, version))
    18021803      {
    1803              cout << "# ================= " << structure_info << " " << product
    1804                   << " version "            << version        << echo_ppath
    1805                   << " already installed."  << endl;   
    1806              recursive = false;
     1804        cerr << "# ================= " << structure_info << " " << product
     1805             << " version "            << version        << echo_ppath
     1806             << " already installed."  << endl;
     1807        recursive = false;
    18071808      }
    18081809    else
     
    18141815        if (!really_checkout (offset, product, version, cvs_tag, module, dir, at_head))
    18151816          {
    1816             cout << "# bad return from really_checkout_product" << endl;
     1817            cerr << "# bad return from really_checkout_product" << endl;
    18171818            return;
    18181819          }
     
    18251826    if (m_simulation)
    18261827      {
    1827         cout << "#CMT> " << structure_info << " directory not really created " << dir << endl;
     1828        cerr << "#CMT> " << structure_info << " directory not really created " << dir << endl;
    18281829      }
    18291830    else if (structure_info == "package")
     
    18311832        if (!CmtSystem::cd (dir))
    18321833          {
    1833             cout << "#CMT> Package directory not created " << dir << endl;
     1834            cerr << "#CMT> Package directory not created " << dir << endl;
    18341835            return;
    18351836          }
     
    18701871            else
    18711872              {
    1872                 cout << "# " << product << " not a CMT package" << endl;
     1873                cerr << "# " << product << " not a CMT package" << endl;
    18731874                return;
    18741875              }
     
    18851886            if (did_recurse)
    18861887              {
    1887                   if (no_config==false)           
    1888                         execute ("cmt -quiet broadcast cmt -quiet config");
     1888                if (no_config==false)             
     1889                  execute ("cmt -quiet broadcast cmt -quiet config");
    18891890             
    18901891              }
    18911892            else
    18921893              {
    1893                   if (no_config==false)
    1894                         execute ("cmt -quiet config");
     1894                if (no_config==false)
     1895                  execute ("cmt -quiet config");
    18951896              }
    18961897          }
     
    18981899          {
    18991900            if (no_config==false)
    1900             execute ("cmt -quiet config");
     1901              execute ("cmt -quiet config");
    19011902          }
    19021903      }
     
    19061907        if (m_verbose)
    19071908          {
    1908             cout << "#CMT> dir=" << dir << endl;
     1909            cerr << "#CMT> dir=" << dir << endl;
    19091910          }
    19101911       
    19111912        if (!CmtSystem::cd (dir))
    19121913          {
    1913             cout << "#CMT> Project directory not created " << dir << endl;
     1914            cerr << "#CMT> Project directory not created " << dir << endl;
    19141915            return;
    19151916          }
     
    19231924        if (!CmtSystem::test_file (file_name))
    19241925          {
    1925             cout << "# " << product << " not a CMT project" << endl;
     1926            cerr << "# " << product << " not a CMT project" << endl;
    19261927            return;
    19271928          }
     
    19321933          }
    19331934
    1934         cout << "# ================= Project " << product << " completed" << endl;
     1935        cerr << "# ================= Project " << product << " completed" << endl;
    19351936
    19361937      }
     
    19461947     o perform the cmt config for packages.
    19471948
    1948    */
     1949  */
    19491950  void do_checkout_phase1 (const cmt_string& module,
    19501951                           const cmt_string& version_dir,
     
    19611962        if (m_verbose)
    19621963          {
    1963             cout << "#CMT> Missing module name" << endl;
     1964            cerr << "#CMT> Missing module name" << endl;
    19641965          }
    19651966        return;
     
    19801981      if (error_info != "")
    19811982        {
    1982           cout << error_info << endl;
     1983          cerr << error_info << endl;
    19831984          return;
    19841985        }
     
    20222023    if (m_verbose)
    20232024      {
    2024         cout << "#CMT> about to checkout " << structure_info
     2025        cerr << "#CMT> about to checkout " << structure_info
    20252026             << " " << product << " version " << version << " into " << top_dir << endl;
    20262027      }
     
    20432044        if (!CmtSystem::test_file (file_name))
    20442045          {
    2045             cout << "# " << 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;
    20462047            return;
    20472048          }
     
    20752076            else
    20762077              {
    2077                 cout << "# " << 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;
    20782079                return;
    20792080              }
     
    20822083        if (m_verbose)
    20832084          {
    2084             cout << "#CMT> product " << product << " has been checked out" << endl;
     2085            cerr << "#CMT> product " << product << " has been checked out" << endl;
    20852086          }
    20862087       
    20872088        if (!m_recursive)
    20882089          {
    2089               if (no_config==false)
    2090                 execute ("cmt -quiet config");
     2090            if (no_config==false)
     2091              execute ("cmt -quiet config");
    20912092          }
    20922093      }
     
    20952096  void help ()
    20962097  {
    2097     cout << "> cd <some work area>" << endl;
    2098     cout << "> cmt checkout [modifier ...] <package|project>" << endl;
    2099     cout << "" << endl;
    2100     cout << "   modifier :" << endl;
    2101     cout << "   -l        Do not process used packages (default)." << endl;
    2102     cout << "   -R        Process used products recursively." << endl;
    2103     cout << "   -r rev    Check out version tag. (is sticky)" << endl;
    2104     cout << "   -vd dir   Use this version directory instead of CVS tag." << endl;
    2105     cout << "   -d dir    Check out into dir instead of module name." << endl;
    2106     cout << "   -o offset Offset in the CVS repository" << endl;
    2107     cout << "   -requirements <requirements file path>  Check out packages referenced in this requirements file" << endl;
    2108     cout << "   -t  Change file timestamps to the date of checkout" << endl;
    2109     cout << "   -n        simulation mode on" << endl;
    2110     cout << "   -no_config  Disable config step after checkout" << endl;   
    2111     cout << "   -v        verbose mode on" << endl;
    2112     cout << "   --help    print this help" << endl;
    2113     cout << "" << endl;
    2114     cout << "> cmt cvstags <package|project>" << endl;
    2115     cout << "> cmt cvssubpackages <directory>" << endl;
    2116     cout << "> cmt cvssubprojects <directory>" << endl;
    2117     cout << "" << 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;
    21182119  }
    21192120
     
    21212122     Implementation of the cmt cvstags
    21222123     Get the CVS tags of a module
    2123    */
     2124  */
    21242125  void tags (const CmtSystem::cmt_string_vector& arguments)
    21252126  {
     
    21322133    if (CmtSystem::getenv ("CVSROOT") == "")
    21332134      {
    2134         cout << "# Please set CVSROOT first !" << endl;
     2135        cerr << "# Please set CVSROOT first !" << endl;
    21352136        return;
    21362137      }
     
    21592160            if (error_info != "")
    21602161              {
    2161                 cout << error_info << endl;
     2162                cerr << error_info << endl;
    21622163              }
    21632164            else
     
    21842185                  {
    21852186                    const cmt_string& s = v[i];
    2186                     cout << s << endl;
     2187                    cerr << s << endl;
    21872188                  }
    21882189              }
     
    21942195     Implementation of the cmt cvsbranches
    21952196     Get the subdirs of a module that are not subackages
    2196    */
     2197  */
    21972198  void branches (const cmt_string& module)
    21982199  {
     
    22032204    if (error_info != "")
    22042205      {
    2205         cout << error_info << endl;
     2206        cerr << error_info << endl;
    22062207      }
    22072208    else
    22082209      {
    2209         cout << branches_info << endl;
     2210        cerr << branches_info << endl;
    22102211      }
    22112212  }
     
    22142215     Implementation of the cmt cvssubpackages
    22152216     Get the subdirs of a module that ARE CMT subpackages
    2216    */
     2217  */
    22172218  void subpackages (const cmt_string& module)
    22182219  {
     
    22232224    if (error_info != "")
    22242225      {
    2225         cout << error_info << endl;
     2226        cerr << error_info << endl;
    22262227      }
    22272228    else
    22282229      {
    2229         cout << subpackages_info << endl;
     2230        cerr << subpackages_info << endl;
    22302231      }
    22312232  }
     
    22342235     Implementation of the cmt cvssubrojects
    22352236     Get the subdirs of a module that ARE CMT projects
    2236    */
     2237  */
    22372238  void subprojects (const cmt_string& module)
    22382239  {
     
    22432244    if (error_info != "")
    22442245      {
    2245         cout << error_info << endl;
     2246        cerr << error_info << endl;
    22462247      }
    22472248    else
    22482249      {
    2249         cout << subprojects_info << endl;
     2250        cerr << subprojects_info << endl;
    22502251      }
    22512252  }
     
    22552256     Parse the arguments
    22562257     Then call do_checkout for each argument
    2257    */
     2258  */
    22582259  void checkout (const CmtSystem::cmt_string_vector& arguments)
    22592260  {
     
    22662267    if (CmtSystem::getenv ("CVSROOT") == "")
    22672268      {
    2268         cout << "# Please set CVSROOT first !" << endl;
     2269        cerr << "# Please set CVSROOT first !" << endl;
    22692270        return;
    22702271      }
     
    23502351              }
    23512352            else if (option == "-t")
    2352             {   
    2353                need_touch_files = true;
    2354            
     2353              {   
     2354                need_touch_files = true;
     2355             
    23552356            else if (option == "-l")
    23562357              {
     
    23762377            else if (option == "-no_config")
    23772378              {
    2378                     no_config = true;
     2379                no_config = true;
    23792380              }       
    23802381            else if (option == "-v")
     
    24452446void Grep::filter (const cmt_string& line)
    24462447{
    2447     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Grep::filter" << endl;
     2448  //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "Grep::filter" << endl;
    24482449
    24492450  if (m_result != "") m_result += " ";
     
    24652466void Cut::begin ()
    24662467{
    2467     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Cut::begin" << endl;
     2468  //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "Cut::begin" << endl;
    24682469  m_result = "";
    24692470}
     
    24712472void Cut::filter (const cmt_string& line)
    24722473{
    2473     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "Cut::filter" << endl;
     2474  //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "Cut::filter" << endl;
    24742475
    24752476  static CmtSystem::cmt_string_vector words;
     
    25342535void RecursivePass1::filter (const cmt_string& line)
    25352536{
    2536     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "RecursivePass1::filter> "
    2537     //                                          << "line=[" << line << "]" << endl;
     2537  //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "RecursivePass1::filter> "
     2538  //                                          << "line=[" << line << "]" << endl;
    25382539
    25392540  if (line.find ("use CMT") != cmt_string::npos) return;
     
    25492550
    25502551  enum
    2551   {
    2552     need_package,
    2553     need_version,
    2554     need_path,
    2555     no_need
    2556   } state = need_package;
     2552    {
     2553      need_package,
     2554      need_version,
     2555      need_path,
     2556      no_need
     2557    } state = need_package;
    25572558
    25582559  cmt_string package;
     
    25682569      switch (state)
    25692570        {
    2570           case need_package:
    2571             package = s;
    2572             state = need_version;
    2573             break;
    2574           case need_version:
    2575             version = s;
    2576             state = need_path;
    2577             break;
    2578           case need_path:
    2579             path = s;
    2580             state = no_need;
    2581             break;
     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;
    25822583        }
    25832584    }
     
    25852586  if (version.find ("*") != cmt_string::npos)
    25862587    {
    2587         /*
    2588       cout << "# ================= Package " << package
    2589            << " version " << version << " " << path
    2590            << " has wild cards and will not be considered." << endl;
    2591         */
     2588      /*
     2589        cerr << "# ================= Package " << package
     2590        << " version " << version << " " << path
     2591        << " has wild cards and will not be considered." << endl;
     2592      */
    25922593      return;
    25932594    }
     
    26042605    {
    26052606      m_first = false;
    2606       cout << "  # --> now propagate cmt checkout to :" << endl;
     2607      cerr << "  # --> now propagate cmt checkout to :" << endl;
    26072608    }
    26082609 
    2609   cout << "  #     " << package << " " << version << " " << path << endl;
     2610  cerr << "  #     " << package << " " << version << " " << path << endl;
    26102611}
    26112612
     
    26272628void RecursivePass2::filter (const cmt_string& line)
    26282629{
    2629     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "RecursivePass2::filter> "
    2630     //                                          << "line=[" << line << "]" << endl;
     2630  //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "RecursivePass2::filter> "
     2631  //                                          << "line=[" << line << "]" << endl;
    26312632
    26322633  /**
     
    26472648
    26482649  enum
    2649   {
    2650     need_package,
    2651     need_version,
    2652     need_path,
    2653     no_need
    2654   } state = need_package;
     2650    {
     2651      need_package,
     2652      need_version,
     2653      need_path,
     2654      no_need
     2655    } state = need_package;
    26552656
    26562657  cmt_string package;
     
    26662667      switch (state)
    26672668        {
    2668           case need_package:
    2669             package = s;
    2670             state = need_version;
    2671             break;
    2672           case need_version:
    2673             version = s;
    2674             state = need_path;
    2675             break;
    2676           case need_path:
    2677             path = s;
    2678             state = no_need;
    2679             break;
     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;
    26802681        }
    26812682    }
     
    26832684  if (version.find ("*") != cmt_string::npos)
    26842685    {
    2685         /*
    2686       cout << "# ================= Package " << package
    2687            << " version " << version << " " << path
    2688            << " has wild cards and will not be considered." << endl;
    2689         */
     2686      /*
     2687        cerr << "# ================= Package " << package
     2688        << " version " << version << " " << path
     2689        << " has wild cards and will not be considered." << endl;
     2690      */
    26902691    }
    26912692  else
     
    27152716
    27162717  enum
    2717   {
    2718     need_project,
    2719     need_version,
    2720     need_tag,
    2721     no_need
    2722   } state = need_project;
     2718    {
     2719      need_project,
     2720      need_version,
     2721      need_tag,
     2722      no_need
     2723    } state = need_project;
    27232724
    27242725  cmt_string project;
     
    27322733      switch (state)
    27332734        {
    2734           case need_project:
    2735             project = s;
    2736             state = need_version;
    2737             break;
    2738           case need_version:
    2739             version = s;
    2740             state = need_tag;
    2741             break;
    2742           case need_tag:
    2743             tag = s;
    2744             state = no_need;
    2745             break;
     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;
    27462747        }
    27472748    }
     
    27492750  if (version.find ("*") != cmt_string::npos)
    27502751    {
    2751         /*
    2752       cout << "# ================= Project " << project
    2753            << " version " << version << " " << path
    2754            << " has wild cards and will not be considered." << endl;
    2755         */
     2752      /*
     2753        cerr << "# ================= Project " << project
     2754        << " version " << version << " " << path
     2755        << " has wild cards and will not be considered." << endl;
     2756      */
    27562757      return;
    27572758    }
     
    27682769    {
    27692770      m_first = false;
    2770       cout << "  # --> now propagate cmt checkout to :" << endl;
     2771      cerr << "  # --> now propagate cmt checkout to :" << endl;
    27712772    }
    27722773 
    2773   cout << "  #     " << project << " " << version << " " << tag << endl;
     2774  cerr << "  #     " << project << " " << version << " " << tag << endl;
    27742775}
    27752776
     
    27912792void RecursivePass4::filter (const cmt_string& line)
    27922793{
    2793     //if (CmtSystem::testenv ("CMTTESTAWK")) cout << "RecursivePass4::filter> "
    2794     //                                          << "line=[" << line << "]" << endl;
     2794  //if (CmtSystem::testenv ("CMTTESTAWK")) cerr << "RecursivePass4::filter> "
     2795  //                                          << "line=[" << line << "]" << endl;
    27952796
    27962797  /**
     
    28112812
    28122813  enum
    2813   {
    2814     need_project,
    2815     need_version,
    2816     need_tag,
    2817     no_need
    2818   } state = need_project;
     2814    {
     2815      need_project,
     2816      need_version,
     2817      need_tag,
     2818      no_need
     2819    } state = need_project;
    28192820
    28202821  cmt_string project;
     
    28282829      switch (state)
    28292830        {
    2830           case need_project:
    2831             project = s;
    2832             state = need_version;
    2833             break;
    2834           case need_version:
    2835             version = s;
    2836             state = need_tag;
    2837             break;
    2838           case need_tag:
    2839             tag = s;
    2840             state = no_need;
    2841             break;
     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;
    28422843        }
    28432844    }
     
    28452846  if (version.find ("*") != cmt_string::npos)
    28462847    {
    2847         /*
    2848       cout << "# ================= Project " << project
    2849            << " version " << version
    2850            << " has wild cards and will not be considered." << endl;
    2851         */
     2848      /*
     2849        cerr << "# ================= Project " << project
     2850        << " version " << version
     2851        << " has wild cards and will not be considered." << endl;
     2852      */
    28522853    }
    28532854  else
  • CMT/HEAD/source/cmt_deps_builder.cxx

    r399 r400  
    1818//
    1919enum state_def
    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 };
     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  };
    3030
    3131//--------------------------------------------------
     
    122122  // To ignore leading spaces and tabs
    123123  while ( (*ptr == ' ') || (*ptr == '\t'))
    124   {
    125     ptr++;
    126   }
     124    {
     125      ptr++;
     126    }
    127127
    128128  if (*ptr == '#')
     
    246246   Any line with no header inclusion
    247247   step through comments and strings
    248  */
     248*/
    249249static char* in_line_action (char* ptr, state_def& state)
    250250{
     
    304304  if (pos == 0)
    305305    {
    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
     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
    309309      ptr += strlen (ptr);
    310310    }
     
    333333  if (pos == 0)
    334334    {
    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
     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
    338338      ptr += strlen (ptr);
    339339    }
     
    362362 
    363363
    364     /*
     364  /*
    365365    Even if we are inside a comment, we must detect strings since comment markers may
    366366    be written inside them.
    367367 
    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  */
     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  */
    385385  pos = strstr (ptr, "*/");
    386386  if ((pos != 0) && (pos < pattern))
     
    402402  if (pos == 0)
    403403    {
    404         // This string is not finished till the end of the line..
    405         // we expect it continues to the nex line...
     404      // This string is not finished till the end of the line..
     405      // we expect it continues to the nex line...
    406406      ptr += strlen (ptr);
    407407    }
     
    428428  if (pos == 0)
    429429    {
    430         // This string is not finished till the end of the line..
    431         // we expect it continues to the nex line...
     430      // This string is not finished till the end of the line..
     431      // we expect it continues to the nex line...
    432432      ptr += strlen (ptr);
    433433    }
     
    453453{
    454454  char * pos = strchr (ptr, '\\'); 
    455  /* Extend this part to deal with continuation character */ 
     455  /* Extend this part to deal with continuation character */ 
    456456  if ( (pos == NULL) || ( (ptr + strlen(ptr)-1)!=pos ))
    457   {
     457    {
    458458      state = in_line;
    459   }
     459    }
    460460 
    461461  ptr    += strlen (ptr);
     
    489489  char* last = text + max_pos;
    490490  while (current < last)
    491   {
     491    {
    492492   
    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");
    495495     
    496496      if ( (crnl==0) && (nl ==0)) break;
     
    500500      char * ptr = 0;
    501501      if (nl==0)  //crnl > 0
    502       {
    503         length = 3;
    504         ptr    = crnl;
    505       }     
     502        {
     503          length = 3;
     504          ptr    = crnl;
     505        }     
    506506      else if (crnl==0) //nl > 0
    507       {
    508         length = 2;                       
    509         ptr    = nl;
    510       }     
     507        {
     508          length = 2;                       
     509          ptr    = nl;
     510        }     
    511511      else if (crnl < nl)
    512       {
    513         length = 3;
    514         ptr    = crnl;                 
    515       }
     512        {
     513          length = 3;
     514          ptr    = crnl;                 
     515        }
    516516      else // (crnl > nl)
    517       {
    518         length = 2;                       
    519         ptr    = nl;         
    520       }
     517        {
     518          length = 2;                       
     519          ptr    = nl;         
     520        }
    521521      strcpy (ptr, ptr+length);
    522522      current = ptr;
    523523      last -= length;
    524   }
     524    }
    525525 
    526526  pos = 0;
     
    575575        {
    576576          // neither nl nor cr+nl found => this is the last line
    577                marker_pos = 0;
     577          marker_pos = 0;
    578578        }
    579579      else
    580580        {
    581581          marker_pos = first;
    582               marker = *marker_pos;
    583               *marker_pos = 0;
     582          marker = *marker_pos;
     583          *marker_pos = 0;
    584584        }
    585585
     
    658658      << dir_name << log_endl;
    659659
    660     //
    661     // Return 0 when the file is found in the current directory
    662     //
     660  //
     661  // Return 0 when the file is found in the current directory
     662  //
    663663  if (CmtSystem::test_file (name))
    664664    {
     
    682682  full_name += name;
    683683
    684     //
    685     // Return 1 when the file is found in the directory of the
    686     // upper level source file
    687     //
     684  //
     685  // Return 1 when the file is found in the directory of the
     686  // upper level source file
     687  //
    688688  if (CmtSystem::test_file (full_name))
    689689    {
     
    703703  int path_index = -1;
    704704
    705     //
    706     // Return [path_index + 2] when the include file is found at one of
    707     // the include_paths
    708     //
     705  //
     706  // Return [path_index + 2] when the include file is found at one of
     707  // the include_paths
     708  //
    709709  for (path_index = 0; path_index < include_paths.size (); path_index++)
    710710    {
     
    862862  if (preprocessor == "")
    863863    {
    864         //
    865         //   Since no preprocessor command is defined,
    866         // we use the internal mechanism provided here.
    867         //
     864      //
     865      //   Since no preprocessor command is defined,
     866      // we use the internal mechanism provided here.
     867      //
    868868      cmt_string new_dir;
    869869
     
    880880  else
    881881    {
    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         //
     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      //
    900900      preprocessor += " ";
    901901      macro = Symbol::find ("includes");
     
    908908      CmtSystem::execute (preprocessor, output);
    909909
    910         //
    911         // Make the output as one single big line.
    912         //
     910      //
     911      // Make the output as one single big line.
     912      //
    913913
    914914      output.replace_all ("\n", " ");
     
    919919      CmtSystem::split (output, " \t", files);
    920920
    921         //
    922         // Analyze each entry
    923         //
     921      //
     922      // Analyze each entry
     923      //
    924924     
    925925      for (int i = 1; i < files.size (); i++)
     
    934934          CmtSystem::dirname (file, dir);
    935935
    936             //
    937             // Only declared include_paths will be taken into account
    938             // Others are considered as system include paths.
    939             //
     936          //
     937          // Only declared include_paths will be taken into account
     938          // Others are considered as system include paths.
     939          //
    940940         
    941941          for (int j = 0; j < m_include_paths.size (); j++)
     
    948948                  full_name += name;
    949949
    950                     //
    951                     // We add in the "m_deps" list the symbolic form
    952                     // of the path rather that the expanded one.
    953                     //
     950                  //
     951                  // We add in the "m_deps" list the symbolic form
     952                  // of the path rather that the expanded one.
     953                  //
    954954                 
    955955                  m_deps.push_back (full_name);
  • CMT/HEAD/source/cmt_fragment.cxx

    r11 r400  
    137137  if (fragment == 0)
    138138    {
    139       cout << "Fragment " << name << " not found" << endl;
     139      cerr << "Fragment " << name << " not found" << endl;
    140140    }
    141141  else
     
    719719              // Macro found
    720720              cmt_string value = macro->resolve_macro_value ();
    721               //cout << "resolve_macro_value2> value=" << value << endl;
     721
    722722              out.replace_all (pattern, value);
    723723
     
    730730              // Macro not found. Look for env. variable
    731731              cmt_string value = CmtSystem::getenv (macro_name);
    732               //cout << "resolve_macro_value3> " << macro_name << "=" << value << endl;
     732
    733733              out.replace_all (pattern, value);
    734734
     
    983983              // Macro found
    984984              cmt_string value = macro->resolve_macro_value ();
    985               //cout << "resolve_macro_value2> value=" << value << endl;
    986985              out.replace_all (pattern, value);
    987986
     
    994993              // Macro not found. Look for env. variable
    995994              cmt_string value = CmtSystem::getenv (macro_name);
    996               //cout << "resolve_macro_value3> " << macro_name << "=" << value << endl;
    997995              out.replace_all (pattern, value);
    998996
  • CMT/HEAD/source/cmt_generator.cxx

    r185 r400  
    306306  fclose (m_output_file);
    307307
    308     //--- Complete the operation --------------
     308  //--- Complete the operation --------------
    309309
    310310  commit (m_output_file_name);
     
    502502        }
    503503
    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         */
     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      */
    517517
    518518      for (int j = 0; j < files.size (); j++)
     
    746746{
    747747public :
    748    WinDefAwk (const cmt_string& library_name)
    749     {
    750       m_name = library_name;
    751     }
     748  WinDefAwk (const cmt_string& library_name)
     749  {
     750    m_name = library_name;
     751  }
    752752
    753753  void begin ()
    754     {
    755       cout << "LIBRARY " << m_name << endl;
    756       cout << "EXPORTS" << endl;
    757     }
     754  {
     755    cout << "LIBRARY " << m_name << endl;
     756    cout << "EXPORTS" << endl;
     757  }
    758758
    759759  void filter (const cmt_string& line)
    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     }
     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  }
    804804
    805805  void end ()
    806     {
    807     }
     806  {
     807  }
    808808
    809809private:
  • CMT/HEAD/source/cmt_generators.cxx

    r197 r400  
    9999    {
    100100      cout << "CmtGenerator::analyze_file> constituent=" <<
    101           constituent.name <<
    102           " file=" << file << endl;
     101        constituent.name <<
     102        " file=" << file << endl;
    103103    }
    104104
     
    144144
    145145      if (CmtSystem::getenv("STRUCTURED_OUTPUT")!="" || Cmt::build_nmake ())
    146       {
     146        {
    147147          obj +=  m_CONSTITUENT;
    148148          obj +=  CmtSystem::file_separator ();
    149       }
     149        }
    150150
    151151      obj += name;
     
    170170  else
    171171    {
    172         //cout << "#CMT> analyze_file file=" << file << " no language" << endl;
    173 
    174172      if (m_LINKMACRO == "java")
    175173        {
     
    197195    {
    198196      cout << "CmtGenerator::analyze_file> constituent=" <<
    199           constituent.name <<
    200           " obj=" << obj << endl;
     197        constituent.name <<
     198        " obj=" << obj << endl;
    201199    }
    202200
     
    517515
    518516  make_header_fragment.copy (m_output_file, constituent.variables, 8,
    519                                          &m_TITLE,
     517                             &m_TITLE,
    520518                             &m_CONSTITUENT,
    521519                             &m_CONSTITUENTSUFFIX,
    522                                          &m_USER,
     520                             &m_USER,
    523521                             &m_DATE,
    524522                             &m_PACKAGE,
    525                                          &m_HASTARGETTAG,
    526                                          &m_STRUCTURED_OUTPUT
     523                             &m_HASTARGETTAG,
     524                             &m_STRUCTURED_OUTPUT
    527525                             );
    528526
     
    25422540public:
    25432541  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)
    25442582      {
     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);
    25452605      }
    2546 
    2547   void begin ()
     2606    else
    25482607      {
    2549         m_sources = "";
     2608        return (true);
    25502609      }
    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  }
    26132611
    26142612  cmt_string& get_sources ()
    2615       {
    2616         return (m_sources);
    2617       }
     2613  {
     2614    return (m_sources);
     2615  }
    26182616
    26192617private:
     
    27352733      //cerr << "file_name=" << file_name << endl;
    27362734
    2737         // Get rid of files that may come from the makefile fragment
     2735      // Get rid of files that may come from the makefile fragment
    27382736      if (file_name.find ("requirements") != cmt_string::npos) source_number--;
    27392737      else if (file_name.find (".make") != cmt_string::npos) source_number--;
     
    27752773                  const cmt_string& line = build (name);
    27762774                 
    2777                   //cout << ">>> line=[" << line << "]" << endl;
    2778                  
    27792775                  add_line_to_text (line, dependencies);
    27802776                }
     
    27962792          const cmt_string& line = build (full_name);
    27972793                 
    2798             //cout << ">>> name2=" << full_name << endl;
    2799                  
    28002794          add_line_to_text (line, dependencies);
    28012795
    2802             //cout << ">>from deps : " << filter.get_sources () << endl;
    28032796          filter.add_source (full_name);
    28042797
    28052798        }
    28062799
    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??
    28102801
    28112802      for (i = 0; i < sources.size (); i++)
     
    28312822                    {
    28322823                      const cmt_string& line = build (name);
    2833                  
    2834                         //cout << ">>> name3=" << name << endl;
    28352824                 
    28362825                      add_line_to_text (line, dependencies);
  • CMT/HEAD/source/cmt_group.cxx

    r11 r400  
    2121//----------------------------------------------------------
    2222Group* Group::find (const cmt_string& name)
    23 //----------------------------------------------------------
     23  //----------------------------------------------------------
    2424{
    2525  static GroupVector& Groups = groups ();
     
    3737//----------------------------------------------------------
    3838Group* Group::add (const cmt_string& name)
    39 //----------------------------------------------------------
     39  //----------------------------------------------------------
    4040{
    4141  static GroupVector& Groups = groups ();
     
    5656//----------------------------------------------------------
    5757Group::GroupVector& Group::groups ()
    58 //----------------------------------------------------------
     58  //----------------------------------------------------------
    5959{
    6060  static Database& db = Database::instance ();
     
    6666/*----------------------------------------------------------*/
    6767void Group::clear_all ()
    68 /*----------------------------------------------------------*/
     68  /*----------------------------------------------------------*/
    6969{
    7070  static GroupVector& Groups = groups ();
     
    8181/*----------------------------------------------------------*/
    8282void Group::show_all ()
    83 /*----------------------------------------------------------*/
     83  /*----------------------------------------------------------*/
    8484{
    8585  static GroupVector& Groups = groups ();
     
    9494//----------------------------------------------------------
    9595Group::Group ()
    96 //----------------------------------------------------------
     96  //----------------------------------------------------------
    9797{
    9898}
     
    100100//----------------------------------------------------------
    101101Group::Group (const cmt_string& name) : m_name (name)
    102 //----------------------------------------------------------
     102  //----------------------------------------------------------
    103103{
    104104}
     
    106106//----------------------------------------------------------
    107107const cmt_string& Group::name () const
    108 //----------------------------------------------------------
     108  //----------------------------------------------------------
    109109{
    110110  return (m_name);
     
    113113//----------------------------------------------------------
    114114void Group::set (const cmt_string& name)
    115 //----------------------------------------------------------
     115  //----------------------------------------------------------
    116116{
    117117  m_name = name;
     
    120120//----------------------------------------------------------
    121121void Group::clear ()
    122 //----------------------------------------------------------
     122  //----------------------------------------------------------
    123123{
    124124  m_name = "";
     
    127127//----------------------------------------------------------
    128128Group& Group::operator = (const Group& other)
    129 //----------------------------------------------------------
     129  //----------------------------------------------------------
    130130{
    131131  m_name = other.m_name;
     
    136136//----------------------------------------------------------
    137137bool Group::operator == (const cmt_string& name) const
    138 //----------------------------------------------------------
     138  //----------------------------------------------------------
    139139{
    140140  return ((m_name == name));
     
    143143//----------------------------------------------------------
    144144bool Group::operator != (const cmt_string& name) const
    145 //----------------------------------------------------------
     145  //----------------------------------------------------------
    146146{
    147147  return ((m_name != name));
  • CMT/HEAD/source/cmt_install_area.cxx

    r11 r400  
    8686  if (installarea == "") return;
    8787
    88   // cout << "InstallArea installed in " << installarea << endl;
    89 
    9088  if (!Cmt::get_quiet ())
    9189    {
     
    10098  CmtSystem::split (installarea_paths, " \t", areapaths);
    10199
    102     // Try a cleanup only in this selected install area
     100  // Try a cleanup only in this selected install area
    103101
    104102  for (int i = 0; i < areapaths.size (); i++)
     
    118116      cmt_regexp expression (".*[.]cmtref$");
    119117
    120         // Look for all cmtref files in this PATH pattern
     118      // Look for all cmtref files in this PATH pattern
    121119
    122120      CmtSystem::scan_dir (path, expression, refs);
     
    126124          const cmt_string& ref_file = refs[j];
    127125
    128             // We get the absolute location of the installed file
     126          // We get the absolute location of the installed file
    129127
    130128          cmt_string ref;
     
    148146          if (pos != cmt_string::npos) ref.erase (pos);
    149147
    150             //  If the referenced file cannot be reached we remove the
    151             // corresponding installation
    152             //  (this happens if the referenced file has be removed, or
    153             //   moved away)
     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)
    154152         
    155153          if (!CmtSystem::test_file (ref))
     
    157155              cmt_string ref_name;
    158156
    159                 // Get the name of the referenced file
     157              // Get the name of the referenced file
    160158              CmtSystem::basename (ref, ref_name);
    161159
    162                 // Get the installation directory
     160              // Get the installation directory
    163161              CmtSystem::dirname (ref_file, ref);
    164162
     
    166164              ref += ref_name;
    167165             
    168                 // Remove both the installed file
    169                 // and the reference file
     166              // Remove both the installed file
     167              // and the reference file
    170168
    171169              if (!Cmt::get_quiet ())
    172170                {
    173                   cout << "# Removing obsolete installed file ["  << ref << "]";
    174                   cout << "  (and " << ref_file << ")" << endl;
     171                  cerr << "# Removing obsolete installed file ["  << ref << "]";
     172                  cerr << "  (and " << ref_file << ")" << endl;
    175173                }
    176174
  • CMT/HEAD/source/cmt_language.cxx

    r11 r400  
    2222/*----------------------------------------------------------*/
    2323void Language::show (const cmt_string& name)
    24 /*----------------------------------------------------------*/
     24  /*----------------------------------------------------------*/
    2525{
    2626  Language& language = find (name);
     
    3333/*----------------------------------------------------------*/
    3434void Language::show_all ()
    35 /*----------------------------------------------------------*/
     35  /*----------------------------------------------------------*/
    3636{
    3737  static LanguageVector& Languages = languages ();
     
    4949/*----------------------------------------------------------*/
    5050void Language::show_names ()
    51 /*----------------------------------------------------------*/
     51  /*----------------------------------------------------------*/
    5252{
    5353  static LanguageVector& Languages = languages ();
     
    6464/*----------------------------------------------------------*/
    6565void Language::setup_all_fragments ()
    66 /*----------------------------------------------------------*/
     66  /*----------------------------------------------------------*/
    6767{
    6868  static LanguageVector& Languages = languages ();
     
    8484/*----------------------------------------------------------*/
    8585Language& Language::find (const cmt_string& name)
    86 /*----------------------------------------------------------*/
     86  /*----------------------------------------------------------*/
    8787{
    8888  static LanguageVector& Languages = languages ();
     
    109109/*----------------------------------------------------------*/
    110110Language& Language::find_with_suffix (const cmt_string& suffix)
    111 /*----------------------------------------------------------*/
     111  /*----------------------------------------------------------*/
    112112{
    113113  static LanguageVector& Languages = languages ();
     
    138138/*----------------------------------------------------------*/
    139139void Language::action (const CmtSystem::cmt_string_vector& words)
    140 /*----------------------------------------------------------*/
     140  /*----------------------------------------------------------*/
    141141{
    142142  cmt_string name;
     
    194194/*----------------------------------------------------------*/
    195195Language& Language::add (const cmt_string& name)
    196 /*----------------------------------------------------------*/
     196  /*----------------------------------------------------------*/
    197197{
    198198  static LanguageVector& Languages = languages ();
     
    217217/*----------------------------------------------------------*/
    218218void Language::clear_all ()
    219 /*----------------------------------------------------------*/
     219  /*----------------------------------------------------------*/
    220220{
    221221  static LanguageVector& Languages = languages ();
     
    231231/*----------------------------------------------------------*/
    232232Language::LanguageVector& Language::languages ()
    233 /*----------------------------------------------------------*/
     233  /*----------------------------------------------------------*/
    234234{
    235235  static Database& db = Database::instance ();
     
    241241/*----------------------------------------------------------*/
    242242Language& Language::null ()
    243 /*----------------------------------------------------------*/
     243  /*----------------------------------------------------------*/
    244244{
    245245  static Language null_instance;
     
    250250/*----------------------------------------------------------*/
    251251Language::Language ()
    252 /*----------------------------------------------------------*/
     252  /*----------------------------------------------------------*/
    253253{
    254254  clear ();
     
    257257/*----------------------------------------------------------*/
    258258Language::~Language ()
    259 /*----------------------------------------------------------*/
     259  /*----------------------------------------------------------*/
    260260{
    261261}
     
    263263/*----------------------------------------------------------*/
    264264void Language::clear ()
    265 /*----------------------------------------------------------*/
     265  /*----------------------------------------------------------*/
    266266{
    267267  m_name = "";
     
    277277/*----------------------------------------------------------*/
    278278void Language::show ()
    279 /*----------------------------------------------------------*/
     279  /*----------------------------------------------------------*/
    280280{
    281281  cout << "language " << m_name;
     
    327327/*----------------------------------------------------------*/
    328328void Language::setup_fragments ()
    329 /*----------------------------------------------------------*/
     329  /*----------------------------------------------------------*/
    330330{
    331331  cmt_string n = fragment_name;
     
    340340/*----------------------------------------------------------*/
    341341bool Language::operator == (const cmt_string& name) const
    342 /*----------------------------------------------------------*/
     342  /*----------------------------------------------------------*/
    343343{
    344344  if (m_name == name) return (true);
     
    348348/*----------------------------------------------------------*/
    349349bool Language::operator == (const Language& other) const
    350 /*----------------------------------------------------------*/
     350  /*----------------------------------------------------------*/
    351351{
    352352  if (this == &other) return (true);
     
    356356/*----------------------------------------------------------*/
    357357bool Language::operator != (const Language& other) const
    358 /*----------------------------------------------------------*/
     358  /*----------------------------------------------------------*/
    359359{
    360360  if (this != &other) return (true);
  • CMT/HEAD/source/cmt_lock.cxx

    r11 r400  
    1919    {
    2020    case locked_by_user:
    21       cout << "Package already locked by you" << endl;
     21      cerr << "Package already locked by you" << endl;
    2222      return (s);
    2323    case locked_by_another_user:
     
    5454    }
    5555
    56   cout << "Package now locked" << endl;
     56  cerr << "Package now locked" << endl;
    5757
    5858  return (locked_by_user);
     
    7272      return (s);
    7373    case not_locked:
    74       cout << "The package was not locked" << endl;
     74      cerr << "The package was not locked" << endl;
    7575      return (s);
    7676    }
     
    9797    }
    9898
    99   cout << "Package now unlocked" << endl;
     99  cerr << "Package now unlocked" << endl;
    100100
    101101  return (not_locked);
  • CMT/HEAD/source/cmt_log.cxx

    r11 r400  
    3636  if (!check ()) return (*this);
    3737
    38   cout << c;
     38  cerr << c;
    3939  return (*this);
    4040}
     
    4444  if (!check ()) return (*this);
    4545
    46   cout << s;
     46  cerr << s;
    4747  return (*this);
    4848}
     
    5252  if (!check ()) return (*this);
    5353
    54   cout << i;
     54  cerr << i;
    5555  return (*this);
    5656}
     
    6060  if (!check ()) return (*this);
    6161
    62   cout << d;
     62  cerr << d;
    6363  return (*this);
    6464}
     
    6868  if (!check ()) return (*this);
    6969
    70   cout << p;
     70  cerr << p;
    7171  return (*this);
    7272}
     
    7676  if (!check ()) return (*this);
    7777
    78   cout << endl;
     78  cerr << endl;
    7979  return (*this);
    8080}
  • CMT/HEAD/source/cmt_model.cxx

    r11 r400  
    133133  cmt_string attribute = "[^=/>]+=((\"([^\"]|\\\\\")*\")|(\'([^\']|\\\\\')*\'))";
    134134
    135   //cout << "attribute=[" << attribute << "]" << endl;
    136 
    137135  cmt_regexp exp_open_element (open_element);
    138136  cmt_regexp exp_open_elements (open_elements);
     
    149147  static int expand_level = 0;
    150148
    151   //cout << "Text=[" << text << "]" << endl;
    152 
    153149  filter (text);
    154 
    155   //cout << "Text=[" << text << "]" << endl;
    156150
    157151  int pos = 0;
     
    200194      display (remaining);
    201195
    202       //cout << "pos=" << pos << " open_element -> p=" << it._pos << " l=" << it._length << endl;
    203196      pos = it._pos + it._length;
    204197
     
    210203        }
    211204
    212       //cout << "pos=" << pos << " word -> p=" << it._pos << " l=" << it._length << endl;
    213205      pos += it._length;
    214206
    215207      cmt_string element = it (text);
    216       //cout << "pos=" << pos << " element=" << element << endl;
    217208
    218209      subargs.clear ();
     
    228219          if (it._pos == pos)
    229220            {
    230               //cout << "pos=" << pos << " skip_spaces -> p=" << it._pos << " l=" << it._length << endl;
    231221              pos += it._length;
    232222            }
    233 
    234           //cout << "pos=" << pos << endl;
    235223
    236224          it = exp_close_element.begin (text, pos);
    237225          if (it._pos == pos)
    238226            {
    239               //cout << "Recursing to [" << element << "]" << endl;
    240 
    241227              int i;
    242228
     
    272258                    }
    273259
    274                   //cout << "+ name = [" << value << "]" << endl;
    275 
    276260                  if (multiple)
    277261                    {
     
    298282              if (multiple)
    299283                {
    300                   //cout << "+ count = " << multiple_count << endl;
    301284                  for (int n = 0; n < multiple_count; n++)
    302285                    {
     
    319302                            }
    320303
    321                           //cout << "+ values = [" << value << "]" << endl;
    322 
    323304                          values.clear ();
    324305                          CmtSystem::split (value, " \t", values);
     
    334315                          Variable& v = variables[i-1];
    335316
    336                           //cout << "+ value = [" << value << "]" << endl;
    337 
    338317                          v = value;
    339318                        }
     
    359338            }
    360339
    361           //cout << "Try attribute at pos=" << pos << " [" << text.substr (pos) << "]" << endl;
    362 
    363340          it = exp_attribute.begin (text, pos);
    364341          if (it._pos != pos)
     
    368345            }
    369346
    370           //cout << "pos=" << pos << " attribute -> p=" << it._pos << " l=" << it._length << endl;
    371           //cout << "pos=" << pos << " attr=[" << it (text) << "]" << endl;
    372 
    373347          {
    374348            cmt_string& s = subargs.add ();
     
    385359void CmtModel::test_regexp (const cmt_string& pattern, const cmt_string& input_text)
    386360{
    387   cout << "Testing pattern [" << pattern << "] against [" << input_text << "]" << endl;
     361  cerr << "Testing pattern [" << pattern << "] against [" << input_text << "]" << endl;
    388362 
    389363  cmt_regexp exp (pattern);
     
    397371      if (it == exp.end ())
    398372        {
    399           cout << "No match" << endl;
     373          cerr << "No match" << endl;
    400374        }
    401375      else
    402376        {
    403           cout << "p=" << it._pos << " l=" << it._length << " -> [" << it (input_text) << "]" << endl;
     377          cerr << "p=" << it._pos << " l=" << it._length << " -> [" << it (input_text) << "]" << endl;
    404378        }
    405379    }
  • CMT/HEAD/source/cmt_parser.cxx

    r371 r400  
    439439    {                                                       
    440440      /*                                                     
    441         Do genvsnet for one specific target.                 
     441                                                             Do genvsnet for one specific target.                 
    442442      */                                                     
    443443      constituent = Constituent::find (target);             
     
    450450    {                                                       
    451451      /*                                                     
    452         Do genvsnet for all possible targets.               
     452                                                             Do genvsnet for all possible targets.               
    453453      */                                                     
    454454      Constituent::build_all_vsnet_files (Me.m_simulation);       
     
    537537  log << "configure_current_package" << log_endl;
    538538  configure_current_package ();
     539
    539540  log << "configure_current_structuring_style" << log_endl;
    540541  configure_current_structuring_style ();
     
    640641  {
    641642    m_current_dir = CmtSystem::pwd ();
     643
    642644    m_done = false;
    643645    m_prefix = "";
     
    661663  void filter (const cmt_string& line)
    662664  {
    663     //cout << "line=" << line << endl;
    664 
    665665    if (m_done)
    666666      {
     
    895895      Me.m_current_style = none_style;
    896896    }
    897 
    898   //cout << "configure_current_package> current style=" << Me.m_current_style << endl;
    899897}
    900898
     
    10261024void Cmt::restore_all_tags (Use* use)
    10271025{
    1028     //cerr << "restore_all_tags" << endl;
     1026  //cerr << "restore_all_tags" << endl;
    10291027
    10301028  Cmt::configure_tags (use);
    10311029
    1032     /*
    1033       Then get existing extra tags
    1034      */
     1030  /*
     1031    Then get existing extra tags
     1032  */
    10351033
    10361034  if (CmtSystem::testenv ("CMTEXTRATAGS"))
     
    10731071  Log;
    10741072
    1075   //if (Me.m_debug) cout << "configure_tags0> current_tag=" << Me.m_current_tag << endl;
    1076 
    10771073  log << "current_tag=" << Me.m_current_tag << log_endl;
    10781074
     
    11111107    }
    11121108
    1113   //if (Me.m_debug) cout << "configure_tags> current_tag=" << Me.m_current_tag << endl;
    11141109  log << "current_tag=" << Me.m_current_tag << log_endl;
    11151110
     
    11261121  tag->mark ();
    11271122
    1128     //Me.m_current_tag = config_tag;
     1123  //Me.m_current_tag = config_tag;
    11291124}
    11301125
     
    11861181
    11871182  void filter (const cmt_string& line)
    1188       {
    1189         cout << line << endl;
    1190       }
     1183  {
     1184    cout << line << endl;
     1185  }
    11911186};
    11921187
     
    13711366                {
    13721367                  cerr << "#CMT> package " << use->get_package_name () <<
    1373                       " " << use->version << " " << use->path <<
    1374                       " not found" <<
    1375                       endl;
     1368                    " " << use->version << " " << use->path <<
     1369                    " not found" <<
     1370                    endl;
    13761371                }
    13771372            }
     
    13931388                  cmt_string& p = packages.add ();
    13941389                  p = use->get_package_name ();
    1395 
    1396                   //cout << ">>> adding " << s << " to selection" << endl;
    13971390                }
    13981391            }
     
    14231416        cmt_string& p = packages.add ();
    14241417        p = use->get_package_name ();
    1425 
    1426         //cout << ">>> adding current " << s << " to selection" << endl;
    14271418      }
    14281419    }
     
    16171608
    16181609          if ((status != 0) && !ignore_errors)
    1619               //if ((status != 0) && !ignore_errors)
     1610            //if ((status != 0) && !ignore_errors)
    16201611            {
    16211612              if (status != 2) CmtError::set (CmtError::execution_error, cmd);
     
    17111702    {
    17121703      const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
    1713 
    1714       //cout << "#IA2>" << endl;
    17151704     
    17161705      cmt_string s1 = ia_mgr.get_installarea ();
     
    20372026    }
    20382027
    2039     //Use::UsePtrVector& Uses = Use::get_ordered_uses ();
     2028  //Use::UsePtrVector& Uses = Use::get_ordered_uses ();
    20402029
    20412030  Use& current_use = Use::current ();
     
    20482037      cout << "default_path " << Me.m_default_path << endl;
    20492038      cout << "cmt config " <<
    2050           Me.m_current_package << " " <<
    2051           Me.m_current_version << " " <<
    2052           Me.m_current_path << endl;
     2039        Me.m_current_package << " " <<
     2040        Me.m_current_version << " " <<
     2041        Me.m_current_path << endl;
    20532042    }
    20542043
     
    20632052    {
    20642053
    2065         //
    2066         // Here we are in a standalone package (ie completely unstructured)
    2067         //
     2054      //
     2055      // Here we are in a standalone package (ie completely unstructured)
     2056      //
    20682057
    20692058      if (CmtSystem::test_file ("requirements"))
     
    21152104          CmtSystem::split (s, '.', words);
    21162105          if (words.size()>=2)
    2117               if (CmtSystem::get_makefile_suffix () == "nmake" && words[1] == "nmake")
    2118                       CmtSystem::remove_file (s);
    2119               else if (CmtSystem::get_makefile_suffix () == "make" && words[1] == "make")
    2120                       CmtSystem::remove_file (s);
     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);
    21212110        }
    21222111    }
     
    21382127          CmtSystem::split (s, '.', words);
    21392128          if (words.size()>=2)
    2140               if (CmtSystem::get_makefile_suffix () == "nmake" && words[1] == "nmake")
    2141                       CmtSystem::remove_file (s);
    2142               else if (CmtSystem::get_makefile_suffix () == "make" && words[1] == "make")
    2143                       CmtSystem::remove_file (s);
     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);
    21442133        }   
    21452134    }
    2146      //exit(-1);
    2147 
    2148   /*
    2149   // cout << "Try a cleanup of the installation area " << endl;
    2150 
    2151     //
    2152     //  Try a cleanup of the installation area
    2153     //
    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   */
    21662135
    21672136  CmtSystem::cd (branch);
     
    21772146  use.change_path (Me.m_current_path);
    21782147  use.style     = Me.m_current_style;
    2179 
    2180   //cout << "do_config> current style=" << Me.m_current_style << endl;
    21812148
    21822149  Me.m_quiet = true;
     
    22402207      cout << "default_path " << Me.m_default_path << endl;
    22412208      cout << "cmt config "   <<
    2242           Me.m_current_package << " " <<
    2243           Me.m_current_version << " " <<
    2244           Me.m_current_path << endl;
     2209        Me.m_current_package << " " <<
     2210        Me.m_current_version << " " <<
     2211        Me.m_current_path << endl;
    22452212    }
    22462213
     
    22552222    {
    22562223
    2257         //
    2258         // Here we are in a standalone package (ie completely unstructured)
    2259         //
     2224      //
     2225      // Here we are in a standalone package (ie completely unstructured)
     2226      //
    22602227
    22612228      if (CmtSystem::test_file ("requirements"))
     
    23622329    }
    23632330
    2364     //if (Me.m_current_package == "CMT") return;
    2365     //if (Me.m_current_package == "methods") return;
     2331  //if (Me.m_current_package == "CMT") return;
     2332  //if (Me.m_current_package == "methods") return;
    23662333
    23672334  cmt_string the_path;
     
    26982665          Me.m_action = action_show_action_names;
    26992666          /*
    2700           if (!Me.m_quiet)
     2667            if (!Me.m_quiet)
    27012668            {
    2702               cerr << "Existing actions:" << endl;
    2703               print_symbol_names (ap.mode);
     2669            cerr << "Existing actions:" << endl;
     2670            print_symbol_names (ap.mode);
    27042671            }
    27052672          */
     
    27322699      Symbol::expand (cmd);
    27332700
    2734       cout << "Execute action " << ap.arguments[0] << " => " << cmd << endl;
     2701      cerr << "Execute action " << ap.arguments[0] << " => " << cmd << endl;
    27352702
    27362703      int status = CmtSystem::execute (cmd);
    27372704      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        }
    27402708    }
    27412709}
     
    28262794  //(unsused) Use& use = Use::current();
    28272795
    2828   cout << "try to lock package " << package << " in " << CmtSystem::pwd () << endl;
     2796  cerr << "try to lock package " << package << " in " << CmtSystem::pwd () << endl;
    28292797
    28302798  set_standard_macros ();
     
    28402808  const cmt_string& path    = Me.m_current_path;
    28412809
    2842     //Use::UsePtrVector& Uses = Use::get_ordered_uses ();
     2810  //Use::UsePtrVector& Uses = Use::get_ordered_uses ();
    28432811
    28442812  if (Me.m_current_package == "CMT") return;
     
    28792847  if (!CmtSystem::cd (the_path))
    28802848    {
    2881       cout << "Path " << the_path << " not reachable" << endl;
     2849      cerr << "Path " << the_path << " not reachable" << endl;
    28822850      return;
    28832851    }
     
    28872855      if (CmtSystem::remove_directory (version))
    28882856        {
    2889           cout << "Version " << version << " has been removed from " << the_path << endl;
     2857          cerr << "Version " << version << " has been removed from " << the_path << endl;
    28902858          CmtSystem::cmt_string_vector contents;
    28912859          CmtSystem::scan_dir (".", contents);
     
    28952863              if (CmtSystem::remove_directory (package))
    28962864                {
    2897                   cout << "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;
    28982866                }
    28992867            }
     
    29012869      else
    29022870        {
    2903           cout << "Impossible to remove version " << version << " from " << the_path << endl;
     2871          cerr << "Impossible to remove version " << version << " from " << the_path << endl;
    29042872        }
    29052873    }
     
    29162884          if (!CmtSystem::remove_directory ("cmt"))
    29172885            {
    2918               cout << "Unstructured version " << version
     2886              cerr << "Unstructured version " << version
    29192887                   << " has been removed from " << the_path << endl;
    29202888            }
    29212889          else
    29222890            {
    2923               cout << "Impossible to remove unstructured version " << version
     2891              cerr << "Impossible to remove unstructured version " << version
    29242892                   << " from " << the_path << endl;
    29252893            }
     
    29272895      else
    29282896        {
    2929           cout << "Version " << version << " not found" << endl;
     2897          cerr << "Version " << version << " not found" << endl;
    29302898        }
    29312899    }
    29322900  else
    29332901    {
    2934       cout << "Version " << version << " not found" << endl;
     2902      cerr << "Version " << version << " not found" << endl;
    29352903    }
    29362904}
     
    29792947            {
    29802948              cerr << "#CMT> package " << use->get_package_name () <<
    2981                   " " << use->version << " " << use->path <<
    2982                   " not found" <<
    2983                   endl;
     2949                " " << use->version << " " << use->path <<
     2950                " not found" <<
     2951                endl;
    29842952            }
    29852953        }
     
    30483016                  const CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
    30493017
    3050                   //cout << "#IA4>" << endl;
    3051 
    30523018                  cmt_string s1 = ia_mgr.get_installarea ();
    30533019
     
    30723038                  }
    30733039
    3074                     // Now deleting the reference file
     3040                  // Now deleting the reference file
    30753041
    30763042                  s = symunlink;
     
    31043070              Symbol::expand (s);
    31053071
    3106               if (!Me.m_quiet) cout << s << endl;
     3072              if (!Me.m_quiet) cerr << s << endl;
     3073
    31073074              int status = CmtSystem::execute (s);
    31083075
     
    31483115  SequenceRunner runner;
    31493116
    3150   cout << "# cmt run_sequence: sequence " << ap.arguments[0] << endl;
     3117  cerr << "# cmt run_sequence: sequence " << ap.arguments[0] << endl;
    31513118
    31523119  runner.run (ap.arguments[0]);
     
    31993166    }
    32003167
    3201   cout << "Writing version file : " << version << endl;
     3168  cerr << "Writing version file : " << version << endl;
    32023169
    32033170  version.write ("version.cmt");
     
    32413208  print (ap.mode);
    32423209
    3243     //
    3244     //  Try a cleanup of the installation area
    3245     //
     3210  //
     3211  //  Try a cleanup of the installation area
     3212  //
    32463213  if (current_use.get_strategy ("InstallArea"))
    32473214    {
    32483215      CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
    32493216
    3250       //cout << "#IA5>" << endl;
    3251 
    32523217      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 "  << q
    3276                        << "# Doing cleanup in the installation area " << installarea
    3277                        << q << endl;
    3278                 }
    3279             }
    3280 
    3281           ia_mgr.config ();
    3282         }
    3283       */
    32843218    }
    32853219}
     
    34163350  cmt_string cmtpath;
    34173351  cmt_string offset;
    3418   cmt_string pauthor = "";
    34193352
    34203353  Use& use = Use::current();   
    34213354  use.get_cmtpath_and_offset (cmtpath, offset);
     3355
    34223356  Project* p = Project::find_by_cmtpath (cmtpath);
    34233357
    3424   cout <<p->get_author ()<<endl;
    3425 
     3358  cout << p->get_author () << endl;
    34263359}
    34273360
     
    34623395      scanner.scan_path (path_name, collector);
    34633396    }
     3397
    34643398  cout << "# ----------- " << collector.count () << " clients found." << endl;
    34653399}
     
    39703904  // (unused??) Use& use = Use::current();
    39713905
    3972   cout << "try to unlock package " << package << " in " << CmtSystem::pwd () << endl;
     3906  cerr << "try to unlock package " << package << " in " << CmtSystem::pwd () << endl;
    39733907
    39743908  set_standard_macros ();
     
    39923926
    39933927/*
    3994 const CmtSystem::cmt_string_vector& Cmt::get_cmt_path ()
    3995 {
     3928  const CmtSystem::cmt_string_vector& Cmt::get_cmt_path ()
     3929  {
    39963930  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  {
    40013935  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  {
    40063940  return (Me.m_cmt_path_sources);
    4007 }
     3941  }
    40083942*/
    40093943
     
    41124046
    41134047/**---------------------------------------------------------
    4114   guess_current_project
     4048   guess_current_project
    41154049
    41164050   if current directory is in one of the CMTPATHs, do nothing.
    41174051
    4118   Otherwise, we want to guess the current project
    4119 
    4120   move up in directories until cmt/project.cmt is found
    4121 
    4122   for (;;)
    4123   {
    4124     if test -f ./cmt/project.cmt
    4125       ok:
    4126         this directory should become the first entry of the CMTPATH
    4127         break
    4128 
    4129     if (at top) break;
    4130 
    4131     move up
    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*/
    41344068void Cmt::guess_current_project ()
    41354069{
     
    41374071
    41384072  log << "guess_current_project" << log_endl;
     4073
     4074  cmt_string here = CmtSystem::pwd ();
    41394075
    41404076  if (Project::find_in_cmt_paths (Me.m_current_dir) == "")
     
    41654101              break;
    41664102            }
     4103
    41674104          if (CmtSystem::pwd () == pwd)
    41684105            {
     
    41704107            }
    41714108        }
     4109
    41724110      CmtSystem::cd (Me.m_current_dir);
    41734111    }
     
    41844122
    41854123  Me.m_autoconfigure_cmtpath = true;
     4124
     4125  CmtSystem::cd (here);
    41864126}
    41874127
     
    42604200#endif
    42614201
    4262   cout << "Creating cleanup scripts." << endl;
     4202  cerr << "Creating cleanup scripts." << endl;
    42634203
    42644204  cmt_string temp;
     
    43464286#endif
    43474287
    4348   cout << "Creating setup scripts." << endl;
     4288  cerr << "Creating setup scripts." << endl;
    43494289
    43504290  Use& current_use = Use::current ();
     
    44604400#endif
    44614401
    4462   cout << "Creating cleanup scripts." << endl;
     4402  cerr << "Creating cleanup scripts." << endl;
    44634403
    44644404  cmt_string temp;
     
    45354475  Symbol* macro           = Symbol::find (macro_name);
    45364476  if (macro != 0)
    4537   {
     4477    {
    45384478      cmt_string value = macro->resolve_macro_value ();
    45394479      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    }   
    45534495}
    45544496//----------------------------------------------------------
     
    45654507#endif
    45664508
    4567   cout << "Creating setup scripts." << endl;
     4509  cerr << "Creating setup scripts." << endl;
    45684510
    45694511  Use& current_use = Use::current ();
     
    48924834  if (CmtError::has_pending_error ()) return (false);
    48934835
    4894     /**
    4895      * See reach_current_package for an explanation of this call
    4896      */
     4836  /**
     4837   * See reach_current_package for an explanation of this call
     4838   */
    48974839  Pattern::apply_all_globals ();
    48984840
     
    51405082    case action_version :
    51415083      use_cmt ();
    5142         //
    5143         // Now parse the requirements file stored in ${CMTHOME}
    5144         //
     5084      //
     5085      // Now parse the requirements file stored in ${CMTHOME}
     5086      //
    51455087     
    51465088      use_home_requirements ();
     
    54905432        case action_awk :
    54915433          do_awk (ap);
    5492       break;
     5434          break;
    54935435        case action_broadcast :
    54945436          do_broadcast (ap);
     
    57685710      int code = CmtError::get_last_error_code ();     
    57695711      if (code == CmtError::execution_failed)
    5770       {
     5712        {
    57715713          code = CmtError::get_last_execution_error();
    5772       }   
     5714        }   
    57735715     
    57745716      if (!Me.m_quiet) CmtError::print ();
     
    57975739  set_standard_macros ();
    57985740
    5799     //cerr << "# current_tag=" << Me.m_current_tag << endl;
    5800     //cerr << "# current_config=" << Me.m_current_config << endl;
     5741  //cerr << "# current_tag=" << Me.m_current_tag << endl;
     5742  //cerr << "# current_config=" << Me.m_current_config << endl;
    58015743
    58025744  if (Me.m_current_tag == "")
     
    58105752    }
    58115753
    5812     //
    5813     //  Now check if all extra tags are still valid. Some of them
    5814     //  may be discarded du to some conflict with highest priority
    5815     //  tags, or with exclude statements
    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  //
    58175759
    58185760  {
     
    59305872          if (use->m_hidden) continue;
    59315873
    5932               Package* p = use->get_package ();
    5933               if (p->is_cmt ()) continue;
     5874          Package* p = use->get_package ();
     5875          if (p->is_cmt ()) continue;
    59345876
    59355877
     
    60736015
    60746016      if (has_pattern)
    6075        {
    6076          if (!expression.match (symbol.name)) continue;
    6077        }
     6017        {
     6018          if (!expression.match (symbol.name)) continue;
     6019        }
    60786020
    60796021      if (Me.m_action == action_show_macro_names)
     
    62026144      if (!CmtSystem::test_file ("requirements"))
    62036145        {
    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             */
    62136146          return (0);
    62146147        }
     
    63106243          tag = Tag::add (env, PriorityConfig, "reach current package", 0);
    63116244          tag->mark ();
    6312             //Me.m_current_tag = env;
     6245          //Me.m_current_tag = env;
    63136246
    63146247          //if (!Me.m_quiet) cerr << "reach_current_package1> current_tag=" << Me.m_current_tag << endl;
     
    63326265  if (Me.m_debug) cout << "reach_current_package2> current_tag=" << Me.m_current_tag << endl;
    63336266
    6334     /**
    6335      *   It would be useful to change this mechanism. Instead of
    6336      *  applying all global patterns at once to all use contexts, it
    6337      *  would be much better to apply it at the end of each
    6338      *  requirements file parsing, and only in the context the
    6339      *  appropriate Use.
    6340      *
    6341      *   This would avoid the current flaw which is that when a global
    6342      *  pattern specifies a "private" definition, it is actually
    6343      *  applied in the scope context of the Current Use and not in
    6344      *  each individual Use. Therefore the private is lost.
    6345      *
    6346      *   However, this induces problems since some pattern definitions
    6347      *  are done AFTER the use statements, which will NOT receive the
    6348      *  pattern aplications.
    6349      *
    6350      *   Therefore it is decided to leave this "bad" mechanism until
    6351      *  everybody is aware of this constraint.
    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   */
    63556288  Pattern::apply_all_globals ();
    63566289
     
    63706303  cmt_string result;
    63716304
    6372     /*
    6373     //if (CmtSystem::getenv ("CMTTESTPREFIX") != "")
    6374     {
    6375     */
    6376 
    6377     //
    6378     //  If there is a common prefix between
    6379     //  use->real_path and pwd
    6380     //  we have
    6381     //  use->real_path = /<prefix>/aaa
    6382     //  pwd            = /<prefix>/bbb
    6383     //
    6384     //  Then use->real_path may be expressed as:
    6385     //  ../..../../aaa
    6386     //   where ../..../../ moves up to /<prefix>
    6387     //
    6388     //   Then we try to find the shortest between
    6389     //
    6390     //     /<prefix> and ../..../..
    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  //
    63926325  cmt_string a = path;
    63936326 
     
    64036336  int i;
    64046337 
    6405     //cout << "Package " << use->get_package_name () << endl;
    6406  
    64076338  for (i = 0; i < m; i++)
    64086339    {
    64096340      const cmt_string& fa = va[i];
    64106341      const cmt_string& fb = pwd[i];
    6411      
    6412         //cout << "  fa=" << fa << " fb=" << fb << endl;
    64136342     
    64146343      if (fa != fb) break;
     
    64196348  if (i > 0)
    64206349    {
    6421         // We have the prefix.
    6422         // if we count what remains from pwd, then
    6423         // we have the number of ../ required to
    6424         // move to /<prefix>
     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>
    64256354      int j;
    64266355     
     
    64386367    }
    64396368 
    6440     //
    6441     // Here ups contains the ../..../../aaa form
    6442     // for the use->real_path or is empty when there
    6443     // were no common prefix.
    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  //
    64456374 
    6446     //if (ups != "")
     6375  //if (ups != "")
    64476376  if ((ups != "") &&
    64486377      (ups.size () < path.size ()))
     
    70977026        cout << "fill_for_all_constituents>" << endl;
    70987027      }
     7028
    70997029    Constituent::parse_all ();
    71007030
    71017031    Use::UsePtrVector& Uses = Use::get_ordered_uses ();
    7102 
     7032   
    71037033    const Constituent::ConstituentVector& constituents =
    7104     Constituent::constituents ();
     7034      Constituent::constituents ();
    71057035
    71067036 
    7107     /// Prepare the auto_imports states in a vector
     7037    // Prepare the auto_imports states in a vector
    71087038    cmt_vector<bool> base_auto_imports_states;
    71097039
     
    71117041
    71127042    int number;
    7113 
     7043   
    71147044    for (number = 0; number < Uses.size (); number++)
    71157045      {
    7116         Use* use = Uses[number];
    7117         base_auto_imports_states[number] = (use->auto_imports != Off);
     7046        Use* use = Uses[number];
     7047        base_auto_imports_states[number] = (use->auto_imports != Off);
    71187048      }
    7119 
    7120     /// Now scan all constituents
    7121 
     7049   
     7050    // Now scan all constituents
     7051       
    71227052    for (number = 0; number < constituents.size (); number++)
    71237053      {
    7124         const Constituent& constituent = constituents[number];
    7125 
     7054        const Constituent& constituent = constituents[number];
     7055       
    71267056        if (Cmt::get_debug ())
    71277057          {
    71287058            cout << "Checking " << constituent.name  << " against imports requests" << endl;
    71297059          }
    7130         Use::UsePtrVector imports;
    7131         int i;
    7132 
    7133         /**
    7134         *  Problem for imports in constituents.
    7135         *
    7136         *     1) use_xxx has holes due to the corresponding
    7137         *         -no_auto_imports options attached to some
    7138         *        use statements (including the transitive ones)
    7139         *
    7140         *     2) the -import=yyy options provided to a given constituent
    7141         *        should restore the appropriate holes as well as
    7142         *        all transitive ones.
    7143         *
    7144         *     3) for use_linkopts, missing pieces must be filled at
    7145         *        the right position. (for others, order is not relevant
     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
    71467076         *        while transitive access is required for all)
    7147         *
    7148         */
    7149 
    7150         if (constituent.type == Document)
     7077        *
     7078        */
     7079       
     7080        if (constituent.type == Document)
    71517081          {
    71527082            continue;
    71537083          }
    7154 
    7155         if (constituent.imports.size () == 0)
    7156           {
    7157             buffer = "macro_append ";
    7158             buffer += constituent.name;
    7159             buffer += "_use_linkopts ";
    7160             buffer += " \" ";
    7161       
    7162             current_use->fill_macro (buffer, "linkopts");
    7163       
    7164             for (i = 0; i < Uses.size (); i++)
    7165               {
    7166                 if (base_auto_imports_states[i])
    7167                   {
    7168                     Use* u = Uses[i];
    7169               
    7170                     if (u->discarded) continue;
    7171                     if (u->m_hidden) continue;
    7172 
    7173                             Package* p = u->get_package ();
    7174                             if (p->is_cmt ()) continue;
     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;
    71757105                   
    7176                     u->fill_macro (buffer, "linkopts");
    7177                   }
    7178               }
    7179             buffer += "\"";
    7180             apply ();
    7181 
    7182           /*
    7183             buffer = "macro_append ";
    7184             buffer += constituent.name;
    7185             buffer += "_use_linkopts ";
    7186 
    7187             buffer += " \" $(use_linkopts)\"";
    7188             apply ();
    7189             */
    7190 
    7191             continue;
    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       
    71947124        // From here on, the constituent HAS import options.
    7195 
    7196         /**
     7125       
     7126        /**
    71977127         * Create a private copy of the state vector. This private copy
    71987128         * will be updated according to -import=xxx modifiers for the
    71997129         * current constituent.
    72007130         */
    7201         cmt_vector<bool> auto_imports_states (base_auto_imports_states);
    7202 
    7203         for (i = 0; i < constituent.imports.size (); i++)
    7204           {
    7205             const cmt_string& import = constituent.imports[i];
     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];
    72067136           
    7207             //
    7208             // Resolve the imported uses
    7209             //
    7210 
    7211             int use_index = Use::find_index (import, "", "");
    7212 
    7213             if (use_index >= 0)
    7214               {
    7215                 Use* u = Uses[use_index];
    7216            
    7217                 if (u->discarded) continue;
    7218                 if (u->m_hidden) continue;
     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;
    72197149               
    72207150                if (Cmt::get_debug ())
     
    72287158                         << endl;
    72297159                  }
    7230 
     7160               
    72317161                Package* p = u->get_package ();
    72327162                if (p->is_cmt ()) continue;
    7233 
     7163               
    72347164                if (u->auto_imports != Off) continue;
    7235 
     7165               
    72367166                Use::set_auto_imports_state (use_index, auto_imports_states);
    7237               }
    7238           }
    7239 
    7240         if (Cmt::get_debug ())
    7241           {
    7242             cout << constituent.name  << " has imports " << endl;
    7243           }
    7244 
    7245 
     7167              }
     7168          }
     7169       
     7170        if (Cmt::get_debug ())
     7171          {
     7172            cout << constituent.name  << " has imports " << endl;
     7173          }
     7174       
     7175       
    72467176        /**
    72477177         *   Find all newly exposed packages and precompute this list inside
     
    72517181          {
    72527182            if (base_auto_imports_states[i]== On && auto_imports_states[i] == Off) continue;
    7253            
     7183            
    72547184            Use* u = Uses[i];
    7255 
     7185           
    72567186            if (u->discarded) continue;
    72577187            if (u->m_hidden)  continue;
     
    72687198          }
    72697199       
    7270         if (imports.size () == 0) continue;
    7271 
     7200        if (imports.size () == 0) continue;
     7201       
    72727202        cmt_string prefix;
    7273            
     7203       
    72747204        //
    72757205        // Documents are not considered
     
    72847214            break;
    72857215          }
    7286            
     7216       
    72877217        buffer = "macro_append ";
    72887218        buffer += prefix;
     
    73737303       
    73747304        /**
    7375           *  Setting ${CONSTITUENT}linkopts is a temporary solution
    7376           *  until the backward compatibility solution for a proper
    7377           *  replacement of use_linkopts by ${CONSTITUENT}_use_linkopts
    7378           *  is acheived.
    7379           *
    7380           */
    7381        buffer = "macro_append ";
    7382        buffer += constituent.name;
    7383        buffer += "linkopts ";
    7384        buffer += " \" ";
    7385        for (i = 0; i < imports.size (); i++)
    7386          {
    7387            Use* u = imports[i];
    7388           
    7389            u->fill_macro (buffer, "linkopts");
    7390          }
    7391        buffer += "\"";
    7392        apply ();
    7393        
    7394        /**
    7395         *  Only for linkopts we take care of the order. This means
    7396         *  that ${CONSTITUENT}_use_linkopts should be used in place of use_linkopts.
    7397         *
    7398         *  (see the application fragments)
     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)
    73997329         *  that ${CONSTITUENT}_use_linkopts will be used in place of use_linkopts.
    74007330         */
     
    74177347                Package* p = u->get_package ();
    74187348                if (p->is_cmt ()) continue;
    7419 
     7349               
    74207350                u->fill_macro (buffer, "linkopts");
    74217351              }
     
    74237353        buffer += "\"";
    74247354        apply ();
    7425 
     7355       
    74267356        //==== GLAST addition for vs.net ==========
    74277357        buffer = "macro ";
     
    74317361      }
    74327362  }
    7433 
     7363 
    74347364  /**
    74357365   *   Macros implied or required to manage constituents.
     
    75357465       
    75367466        SyntaxParser::parse_requirements_line (temp, current_use);
    7537     }
     7467      }
    75387468  }
    75397469
     
    75507480      {
    75517481        CmtInstallAreaMgr& ia_mgr = CmtInstallAreaMgr::instance ();
    7552 
    7553         //cout << "#IA7>" << endl;
    75547482       
    75557483        ia_mgr.setup ();
     
    76267554
    76277555
    7628     /**
    7629      *    TAG management
    7630      */
     7556  /**
     7557   *    TAG management
     7558   */
    76317559
    76327560  bool tag_debug = CmtSystem::testenv ("TAGDEBUG");
     
    76367564  if (Me.m_current_tag != "")
    76377565    {
    7638         // this is when some -tag= argument was used.
     7566      // this is when some -tag= argument was used.
    76397567      if (tag_debug) cerr << "set_standard_macro0.1> current_tag=" << Me.m_current_tag << endl;
    76407568    }
    76417569  else if (Symbol::is_selected ("CMTCONFIG"))
    76427570    {
    7643         // This is when CMTCONFIG has been set from some requirements file
     7571      // This is when CMTCONFIG has been set from some requirements file
    76447572      Symbol* macro = Symbol::find ("CMTCONFIG");
    76457573      if (macro != 0)
     
    76517579  else
    76527580    {
    7653         // this is when no -tag= argument was used.
     7581      // this is when no -tag= argument was used.
    76547582      if (tag_debug) cerr << "set_standard_macro(before2)> current_tag=" << Me.m_current_tag << endl;
    76557583      if (current_use.get_package_name () == "CMT")
     
    76767604                                Me.m_current_style);
    76777605
    7678 
    7679     //
    7680     //  Definitions for installation area mechanisms
    7681     //
    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   */
    76927606
    76937607  builder.fill_for_current_package (Me.m_current_dir);
  • CMT/HEAD/source/cmt_pattern.cxx

    r189 r400  
    160160  if (words.size () < 2) return;
    161161
    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     //
     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  //
    174174
    175175  cmt_string& option = words[1];
     
    193193  if (CmtSystem::testenv ("CMTTESTPATTERN"))
    194194    {
    195       cout << "Pattern::action> add " << name << endl;
     195      cerr << "Pattern::action> add " << name << endl;
    196196    }
    197197}
     
    234234  if (pattern == 0)
    235235    {
    236         // No pattern for the pair <name, use> exist yet.
    237         // create one.
     236      // No pattern for the pair <name, use> exist yet.
     237      // create one.
    238238      Pattern& p = Patterns.add ();
    239239
     
    262262  int first_word = start_index;
    263263
    264     //
    265     // Install the cmt-statement both as a vector of words and as a single line
    266     //
     264  //
     265  // Install the cmt-statement both as a vector of words and as a single line
     266  //
    267267  for (int i = start_index; i < words.size (); i++)
    268268    {
     
    493493      cout << "# " << use->get_package_name ()
    494494           << " applies pattern " << apply_pattern.name << " => " << endl;
     495
    495496      apply_pattern.show ();
     497
    496498      cout << endl;
    497499    }
     
    518520  bool found = false;
    519521
    520     // First show the definitions.
     522  // First show the definitions.
    521523
    522524  Pattern* p = Pattern::find (name);
     
    530532  p->show ();
    531533
    532     //
    533     // Then show the packages which explicitly apply the pattern.
    534     //
     534  //
     535  // Then show the packages which explicitly apply the pattern.
     536  //
    535537  Use* use;
    536538  ApplyPattern* apply_pattern = 0;
     
    645647        if (CmtSystem::getenv ("TESTCACHE") != "")
    646648          {
    647             cout << "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;
    648650          }
    649651       
     
    669671        if (CmtSystem::getenv ("TESTCACHE") != "")
    670672          {
    671             cout << "keep cache" << endl;
     673            cerr << "keep cache" << endl;
    672674          }
    673675      }
     
    735737  if (CmtSystem::testenv ("CMTTESTPATTERN"))
    736738    {
    737       cout << "Pattern::apply> replacement=[" << replacement << "]" << endl;
     739      cerr << "Pattern::apply> replacement=[" << replacement << "]" << endl;
    738740    }
    739741
     
    753755  if (CmtSystem::testenv ("CMTTESTPATTERN"))
    754756    {
    755       cout << "Pattern::expand1> line=[" << line << "]" << endl;
     757      cerr << "Pattern::expand1> line=[" << line << "]" << endl;
    756758    }
    757759
     
    760762  if (replacement != "")
    761763    {
    762         // Substitute templates from the cmt statement
     764      // Substitute templates from the cmt statement
    763765      replacement.replace_all ("<package>", context_use->get_package_name ().c_str ());
    764766      replacement.replace_all ("<PACKAGE>", context_use->prefix.c_str ());
     
    801803      if (CmtSystem::testenv ("CMTTESTPATTERN"))
    802804        {
    803           cout << "Pattern::expand2> repl=[" << replacement << "]" << endl;
     805          cerr << "Pattern::expand2> repl=[" << replacement << "]" << endl;
    804806        }
    805807
     
    816818void ApplyPattern::action (const CmtSystem::cmt_string_vector& words, Use* use)
    817819{
    818     //
    819     // Expected syntax is
    820     //
    821     // apply_pattern <pattern-name> [ <template>=<value> ... ]
    822     //   or just
    823     // <pattern-name> [ <template>=<value> ... ]
    824     //
     820  //
     821  // Expected syntax is
     822  //
     823  // apply_pattern <pattern-name> [ <template>=<value> ... ]
     824  //   or just
     825  // <pattern-name> [ <template>=<value> ... ]
     826  //
    825827
    826828  int first_word = 0;
     
    849851  /*
    850852    We then look for all <name>=<value> pairs
    851    */
     853  */
    852854  enum
    853855    {
     
    868870      if (CmtSystem::testenv ("CMTTESTPATTERN"))
    869871        {
    870           cout << "ApplyPattern::action> " << name << " s=[" << s << "] state=" << state << endl;
     872          cerr << "ApplyPattern::action> " << name << " s=[" << s << "] state=" << state << endl;
    871873        }
    872874
     
    892894              if (CmtSystem::testenv ("CMTTESTPATTERN"))
    893895                {
    894                   cout << "ApplyPattern::action-1> n=[" << tname << "] v=[" << tvalue << "]" << endl;
     896                  cerr << "ApplyPattern::action-1> n=[" << tname << "] v=[" << tvalue << "]" << endl;
    895897                }
    896898             
     
    957959              if (CmtSystem::testenv ("CMTTESTPATTERN"))
    958960                {
    959                   cout << "ApplyPattern::action-2> n=[" << tname << "] v=[" << tvalue << "]" << endl;
     961                  cerr << "ApplyPattern::action-2> n=[" << tname << "] v=[" << tvalue << "]" << endl;
    960962                }
    961963             
     
    977979          state = need_template;
    978980
    979               if (CmtSystem::testenv ("CMTTESTPATTERN"))
    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            }
    983985
    984986          cmt_string tsearch = "<";
     
    10641066  if (CmtSystem::testenv ("CMTTESTPATTERN"))
    10651067    {
    1066       cout << "ApplyPattern::apply> " << name << endl;
     1068      cerr << "ApplyPattern::apply> " << name << endl;
    10671069    }
    10681070
     
    10721074      if (CmtSystem::testenv ("CMTTESTPATTERN"))
    10731075        {
    1074           cout << "ApplyPattern::apply> " << name << " not found" << endl;
     1076          cerr << "ApplyPattern::apply> " << name << " not found" << endl;
    10751077        }
    10761078
     
    10971099void IgnorePattern::action (const CmtSystem::cmt_string_vector& words, Use* use)
    10981100{
    1099     //
    1100     // Expected syntax is
    1101     //
    1102     // ignore_pattern <pattern-name>
    1103     //
     1101  //
     1102  // Expected syntax is
     1103  //
     1104  // ignore_pattern <pattern-name>
     1105  //
    11041106
    11051107  if (words.size () < 2) return;
  • CMT/HEAD/source/cmt_project.cxx

    r334 r400  
    185185  - it can correspond to an existing project (ie already declared)
    186186  - it's a new project
    187      - then it tries to read and parse its project file
    188  */
     187  - then it tries to read and parse its project file
     188*/
    189189Project* ProjectFactory::create_project (const cmt_string& specified_name,
    190190                                         const cmt_string& path,
     
    271271  /*
    272272    Now Figure out the project name from the project file
    273        or does not specify the project name
    274    */
     273    or does not specify the project name
     274  */
    275275  bool has_project_file = false;
    276276
     
    343343              // The specified name is not in the path.
    344344              /*
    345               if (!Cmt::get_quiet ())
     345                if (!Cmt::get_quiet ())
    346346                {
    347                   cerr << "#CMT> Warning: specified project name "
    348                        << specified_name
    349                        << " from the caller does not match path." << endl;
     347                cerr << "#CMT> Warning: specified project name "
     348                << specified_name
     349                << " from the caller does not match path." << endl;
    350350                }
    351351              */
     
    369369              // The specified name is not in the path.
    370370              /*
    371               if (!Cmt::get_quiet ())
     371                if (!Cmt::get_quiet ())
    372372                {
    373                   cerr << "#CMT> Warning: specified project name "
    374                        << specified_name
    375                        << " from project file and from caller does not match path." << endl;
     373                cerr << "#CMT> Warning: specified project name "
     374                << specified_name
     375                << " from project file and from caller does not match path." << endl;
    376376                }
    377377              */
     
    387387         
    388388          /*
    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;
     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;
    396396            }
    397397          */
     
    438438
    439439              /*
    440               if (!Cmt::get_quiet ())
     440                if (!Cmt::get_quiet ())
    441441                {
    442                   cerr << "#CMT> Warning: specified project name "
    443                        << project_name
    444                        << " from project file does not match path." << endl;
     442                cerr << "#CMT> Warning: specified project name "
     443                << project_name
     444                << " from project file does not match path." << endl;
    445445                }
    446446              */
     
    491491              // The specified name is not in the path.
    492492              /*
    493               if (!Cmt::get_quiet ())
     493                if (!Cmt::get_quiet ())
    494494                {
    495                   cerr << "#CMT> Warning: specified project name "
    496                        << specified_name
    497                        << " from project graph does not match path." << endl;
     495                cerr << "#CMT> Warning: specified project name "
     496                << specified_name
     497                << " from project graph does not match path." << endl;
    498498                }
    499499              */
     
    577577
    578578      // 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
    580580      Use* project_use = Use::create (project->get_cmtpath(),
    581                                       "package_policy_for_project_"+project->get_name(),                                       
     581                                      "package_policy_for_project_" + project->get_name(),                                       
    582582                                      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;
    585586      project_use->m_hidden  = true;
    586587      project_use->selected  = true;
     
    591592     
    592593     
    593      // add at the uses level ?????
    594     /*static Use::UsePtrVector& uses = Use::get_ordered_uses ();
    595      bool found = false;
    596      int  size  = uses.size ();
    597      cerr << "\n size:"<<size<< ":" << endl;     
    598      for (int n = 0; n < size; n++)
    599      {
    600          Use* tuse = uses[n];
    601          cerr << "\tpackage file [" << tuse->get_package_name() << "]" <<project_use->get_package_name()<< endl;                   
    602          if (tuse->get_package_name()==project_use->get_package_name())
    603                    found=true;
    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        }
    606607   
    607      if (not found)
    608     {
     608        if (not found)
     609        {
    609610        uses.push_back (project_use);
    610611        project_use->m_index = uses.size () - 1;
    611     }
     612        }
    612613      */
    613614
     
    635636                      const cmt_string& path)
    636637{
    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 << ") ";
    639642
    640643  if (path != "")
     
    643646    }
    644647
    645   cout << endl;
    646   cout << "CMT version " << Cmt::get_cmt_version () << "." << endl;
    647   cout << "------------------------------------------" << endl;
     648  cerr << endl;
     649  cerr << "CMT version " << Cmt::get_cmt_version () << "." << endl;
     650  cerr << "------------------------------------------" << endl;
    648651
    649652  if (path != "")
     
    651654      if (!CmtSystem::mkdir (path))
    652655        {
    653           cout << "Cannot create the " << path << " directory" << endl;
     656          cerr << "Cannot create the " << path << " directory" << endl;
    654657          return (false);
    655658        }
     
    657660      if (!CmtSystem::cd (path))
    658661        {
    659           cout << "Cannot access the " << path << " directory" << endl;
     662          cerr << "Cannot access the " << path << " directory" << endl;
    660663          return (false);
    661664        }
     
    664667  if (!CmtSystem::mkdir (name))
    665668    {
    666       cout << "Cannot create the " << name << " directory" << endl;
     669      cerr << "Cannot create the " << name << " directory" << endl;
    667670      return (false);
    668671    }
     
    670673  if (!CmtSystem::cd (name))
    671674    {
    672       cout << "Cannot access the " << name << " directory" << endl;
     675      cerr << "Cannot access the " << name << " directory" << endl;
    673676      return (false);
    674677    }
     
    678681      if (!CmtSystem::mkdir (release))
    679682        {
    680           cout << "Cannot create the " << release << " directory" << endl;
     683          cerr << "Cannot create the " << release << " directory" << endl;
    681684          return (false);
    682685        }
     
    684687      if (!CmtSystem::cd (release))
    685688        {
    686           cout << "Cannot access the " << release << " directory" << endl;
     689          cerr << "Cannot access the " << release << " directory" << endl;
    687690          return (false);
    688691        }
     
    693696      if (!CmtSystem::mkdir ("cmt"))
    694697        {
    695           cout << "Cannot create the cmt directory" << endl;
     698          cerr << "Cannot create the cmt directory" << endl;
    696699          return (false);
    697700        }
    698701      else
    699702        {
    700           cout << "Installing the cmt directory" << endl;
     703          cerr << "Installing the cmt directory" << endl;
    701704        }
    702705    }
     
    706709  if (!CmtSystem::test_file (get_project_file_name ()))
    707710    {
    708       cout << "Creating a new project file" << endl;
     711      cerr << "Creating a new project file" << endl;
    709712
    710713      ofstream f (get_project_file_name ());
     
    717720      else
    718721        {
    719           cout << "Cannot create the project file" << endl;
     722          cerr << "Cannot create the project file" << endl;
    720723          return (false);
    721724        }
     
    731734      p.commit ();
    732735
    733       cout << "project file already there" << endl;
     736      cerr << "project file already there" << endl;
    734737    }
    735738
     
    803806{
    804807  static ProjectVector& Projects = projects ();
    805 
    806   //cout << "Project::add> name=" << name << endl;
    807808
    808809  {
     
    11981199    The goal is to generate CMTPATH even if this EV was not pre-set
    11991200    which is the case when CMTPROJECTPATH is only used
    1200    */
     1201  */
    12011202
    12021203  VisitorForFillCMTPATH visitor (buffer);
     
    14421443
    14431444/**---------------------------------------------------------
    1444  A container statement is met in the project file
     1445   A container statement is met in the project file
    14451446*/
    14461447void Project::container_action (const cmt_string& name, const cmt_string& version)
     
    14531454
    14541455/**---------------------------------------------------------
    1455  A use statement is met in the project file
     1456   A use statement is met in the project file
    14561457*/
    14571458void Project::use_action (const cmt_string& name, const cmt_string& release)
     
    14791480  bool use_has_wild_card = (v == -1) || (r == -1) || (p == -1);
    14801481  if (use_has_wild_card)
    1481   {
     1482    {
    14821483      cmt_string selected_release = "";
     1484
    14831485      if (select_release(name, new_release,selected_release))
    1484       { // yes
    1485           // cout <<"selected_release: "<<selected_release<<endl;   
     1486        {
     1487          // cerr <<"selected_release: "<<selected_release<<endl;   
    14861488          new_release = selected_release;
    1487       }         
    1488    }
     1489        }         
     1490    }
    14891491
    14901492  cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH");
     
    14921494  sep = CmtSystem::path_separator ();
    14931495
    1494   //cerr << "cmtprojectpath = " << cmtprojectpath << endl;
    14951496  CmtSystem::cmt_string_vector items;
    14961497  CmtSystem::split (cmtprojectpath, sep, items);
     
    15101511        }
    15111512
    1512     if (CmtSystem::test_directory (p))
     1513      if (CmtSystem::test_directory (p))
    15131514        {
    15141515          //cerr << "Project directory " << p << " exists " << endl;
     
    15291530
    15301531      if (p != 0)
    1531           {
    1532               found = true;
    1533               p->add_parent (this);
    1534               add_child (p);
    1535 
    1536               update_strategies_from_children ();
    1537             }
     1532        {
     1533          found = true;
     1534          p->add_parent (this);
     1535          add_child (p);
     1536
     1537          update_strategies_from_children ();
     1538        }
    15381539    }
    15391540   
     
    15471548bool Project::select_release(const cmt_string& name, const cmt_string& release, cmt_string& result)
    15481549{
    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);
    16361646}
    16371647
    16381648//---------------------------------------------------------
    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);
     1649const 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);
    16751688}
    16761689
     
    19491962
    19501963   (This is not a specification : see the set_strategy method)
    1951  */
     1964*/
    19521965void Project::update_strategy (StrategyDef* definition, bool b_value)
    19531966{
     
    20022015   We need to update the strategy value accordingly
    20032016   This will not change the specified value for this strategy
    2004  */
     2017*/
    20052018void Project::update_strategy_from_children (StrategyDef* definition)
    20062019{
     
    20932106   We need to update the strategy values accordingly
    20942107   This will not change the specified values
    2095  */
     2108*/
    20962109void Project::update_strategies_from_children ()
    20972110{
     
    21182131/**----------------------------------------------------------
    21192132   The StrategyMgr singleton
    2120  */
     2133*/
    21212134StrategyMgr& StrategyMgr::instance ()
    21222135{
     
    21282141   The StrategyMgr constructor
    21292142   Here are primarily constructed all strategy definitions
    2130  */
     2143*/
    21312144StrategyMgr::StrategyMgr ()
    21322145{
     
    22062219/**----------------------------------------------------------
    22072220   Find a strategy definition by its name
    2208  */
     2221*/
    22092222StrategyDef* StrategyMgr::find_strategy (const cmt_string& name)
    22102223{
     
    22272240/**----------------------------------------------------------
    22282241   Retreive the default value defined for a given strategy
    2229  */
     2242*/
    22302243bool StrategyMgr::get_default_strategy (const cmt_string& name)
    22312244{
     
    22382251   Retreive the priority value defined for a given strategy
    22392252   This value is used when two children of a project request two conflicting strategy values
    2240  */
     2253*/
    22412254bool StrategyMgr::get_priority_strategy (const cmt_string& name)
    22422255{
     
    22482261/**----------------------------------------------------------
    22492262   Return the vector of all existing strategy definitions
    2250  */
     2263*/
    22512264StrategyDef::StrategyDefs& StrategyMgr::get_definitions ()
    22522265{
     
    22762289   Specify a new value for this strategy.
    22772290   This only happens when a strategy statement is met in a project file or in a requirements file.
    2278  */
     2291*/
    22792292void Strategy::set (StrategyDef* definition, bool value, const cmt_string& project_name)
    22802293{
     
    22922305   This has no impact on to the specified value.
    22932306   This will adapt the tag settings
    2294  */
     2307*/
    22952308void Strategy::update (StrategyDef* definition, bool value, const cmt_string& project_name)
    22962309{
     
    23322345  m_on_tag->mark ();
    23332346}
     2347
    23342348//-----------------------------------------------------------
    23352349const cmt_string& StrategyDef::get_default_value () const
     
    23442358    }
    23452359}
     2360
    23462361//-----------------------------------------------------------
    23472362void Project::set_author (const cmt_string& name)
    23482363{
    2349   cout<<"set_author"<<name<<endl;     
     2364  // cerr << "set_author" << name << endl;     
    23502365  this->m_author = name;
    23512366}
     2367
    23522368//-----------------------------------------------------------
    23532369const cmt_string& Project::get_author () const
     
    23552371  return (m_author);
    23562372}
     2373
    23572374//-----------------------------------------------------------
    23582375void Project::project_author_action (const CmtSystem::cmt_string_vector& words)
    23592376{
    23602377  if (m_author != "") m_author += "\n";
     2378
    23612379  for (int i = 1; i < words.size (); i++)
    23622380    {
     
    23672385    }
    23682386}
     2387
    23692388//-----------------------------------------------------------
    23702389Use*  Project::get_use () const
    23712390{
    2372     return m_use;   
     2391  return m_use;   
    23732392
     2393
    23742394//-----------------------------------------------------------
    23752395void  Project::set_use (Use* use)
    23762396
    2377     this->m_use = use;
    2378 }
     2397  this->m_use = use;
     2398}
     2399
    23792400//-----------------------------------------------------------
  • CMT/HEAD/source/cmt_regexp.cxx

    r11 r400  
    1717
    1818static int tab_level = 0;
     19
    1920static void tab ()
    2021{
    2122  for (int i = 0; i < tab_level; i++)
    2223    {
    23       cout << "  ";
     24      cerr << "  ";
    2425    }
    2526}
     
    287288
    288289const cmt_regexp::iterator cmt_regexp_node::match (const cmt_string& /*text*/,
    289                                             int /*pos*/) const
     290                                                   int /*pos*/) const
    290291{
    291292  return (cmt_regexp::iterator::null());
     
    345346void cmt_char_node::dump () const
    346347{
    347   tab (); cout << "char>(" << this << ") c=" << _c << endl;
     348  tab (); cerr << "char>(" << this << ") c=" << _c << endl;
    348349}
    349350
     
    357358
    358359const cmt_regexp::iterator cmt_string_node::match (const cmt_string& text,
    359                                                   int pos) const
     360                                                   int pos) const
    360361{
    361362  if ((pos < 0) || (pos > text.size ()))
     
    378379void cmt_string_node::dump () const
    379380{
    380   tab (); cout << "string (" << this << ") s=[" << _s << "]" << endl;
     381  tab (); cerr << "string (" << this << ") s=[" << _s << "]" << endl;
    381382}
    382383
     
    399400      switch (c)
    400401        {
    401           case '-':
    402             i++;
    403             {
    404               char c1 = _choices[_choices.size () - 1];
    405               char c2 = list[i];
    406               int j;
    407               int j0 = (c1 < c2) ? c1 : c2;
    408               int j1 = (c1 > c2) ? c1 : c2;
    409               for (j = j0; j <= j1; j++)
    410                 {
    411                   _choices += j;
    412                 }
    413             }
    414             break;
    415           case '\\':
    416             i++;
    417             c = list[i];
    418             switch (c)
    419               {
    420                 case '[':
    421                 case ']':
    422                 case '(':
    423                 case ')':
    424                 case '.':
    425                 case '*':
    426                 case '?':
    427                 case '^':
    428                 case '$':
    429                 case '\\':
    430                   c = '\\';
    431                   break;
    432                 case 'r':
    433                   c = '\r';
    434                   break;
    435                 case 't':
    436                   c = '\t';
    437                   break;
    438                 case 'n':
    439                   c = '\n';
    440                   break;
    441                 default:
    442                   break;
    443               }
    444           default:
    445             _choices += c;
    446             break;
     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;
    447448        }
    448449    }
     
    450451
    451452const cmt_regexp::iterator cmt_char_list_node::match (const cmt_string& text,
    452                                                      int pos) const
     453                                                      int pos) const
    453454{
    454455  if ((pos < 0) || (pos > text.size ()))
     
    471472void cmt_char_list_node::dump () const
    472473{
    473   tab (); cout << "char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl;
     474  tab (); cerr << "char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl;
    474475}
    475476
     
    478479//----------------------------------------------------------
    479480cmt_not_char_list_node::cmt_not_char_list_node (cmt_string list) :
    480         cmt_char_list_node (list)
     481  cmt_char_list_node (list)
    481482{
    482483}
    483484
    484485const cmt_regexp::iterator cmt_not_char_list_node::match (const cmt_string& text,
    485                                                       int pos) const
     486                                                          int pos) const
    486487{
    487488  if ((pos < 0) || (pos > text.size ()))
     
    504505void cmt_not_char_list_node::dump () const
    505506{
    506   tab (); cout << "not_char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl;
     507  tab (); cerr << "not_char_list (" << this << ") list=[" << _list << "] choices=[" << _choices << "]" << endl;
    507508}
    508509
     
    512513//----------------------------------------------------------
    513514const cmt_regexp::iterator cmt_any_node::match (const cmt_string& text,
    514                                             int pos) const
     515                                                int pos) const
    515516{
    516517  if ((pos < 0) | (pos >= text.size ()))
     
    524525void cmt_any_node::dump () const
    525526{
    526   tab (); cout << "any (" << this << ") " << endl;
     527  tab (); cerr << "any (" << this << ") " << endl;
    527528}
    528529
     
    540541
    541542const cmt_regexp::iterator cmt_zero_one::match (const cmt_string& text,
    542                                                int pos) const
     543                                                int pos) const
    543544{
    544545  if ((pos < 0) || (pos > text.size ()))
     
    564565void cmt_zero_one::dump () const
    565566{
    566   tab (); cout << "zero_one (" << this << ") " << endl;
     567  tab (); cerr << "zero_one (" << this << ") " << endl;
     568
    567569  if (_node != 0)
    568570    {
     
    602604void cmt_many_node::dump () const
    603605{
    604   tab (); cout << "many (" << this << ") " << endl;
     606  tab (); cerr << "many (" << this << ") " << endl;
     607
    605608  if (_node != 0)
    606609    {
     
    609612      tab_level--;
    610613    }
     614
    611615  tab_level++;
    612616  _follower.dump ();
     
    624628
    625629const cmt_regexp::iterator cmt_zero_more::match (const cmt_string& text,
    626                                             int pos) const
     630                                                int pos) const
    627631{
    628632  if ((pos < 0) || (pos > text.size ()))
     
    699703void cmt_zero_more::dump () const
    700704{
    701   tab (); cout << "zero_more (" << this << ") " << endl;
     705  tab (); cerr << "zero_more (" << this << ") " << endl;
     706
    702707  if (_node != 0)
    703708    {
     
    706711      tab_level--;
    707712    }
     713
    708714  _follower.dump ();
    709715}
     
    717723
    718724const cmt_regexp::iterator cmt_one_more::match (const cmt_string& text,
    719                                             int pos) const
     725                                                int pos) const
    720726{
    721727  if ((pos < 0) || (pos > text.size ()))
     
    798804void cmt_one_more::dump () const
    799805{
    800   tab (); cout << "one_more (" << this << ") " << endl;
     806  tab (); cerr << "one_more (" << this << ") " << endl;
     807
    801808  if (_node != 0)
    802809    {
     
    805812      tab_level--;
    806813    }
     814
    807815  tab_level++;
    808816  _follower.dump ();
     
    816824//----------------------------------------------------------
    817825const cmt_regexp::iterator cmt_begin_node::match (const cmt_string& /*text*/,
    818                                                  int pos) const
     826                                                  int pos) const
    819827{
    820828  if (pos == 0) return (cmt_regexp::iterator (pos, 0));
     
    824832void cmt_begin_node::dump () const
    825833{
    826   tab (); cout << "begin (" << this << ") " << endl;
     834  tab (); cerr << "begin (" << this << ") " << endl;
    827835}
    828836//----------------------------------------------------------
     
    838846void cmt_end_node::dump () const
    839847{
    840   tab (); cout << "end (" << this << ") " << endl;
     848  tab (); cerr << "end (" << this << ") " << endl;
    841849}
    842850//----------------------------------------------------------
     
    930938void cmt_regexp_node_set::dump () const
    931939{
    932   tab (); cout << "regexp_node_set (" << this << ") " << endl;
     940  tab (); cerr << "regexp_node_set (" << this << ") " << endl;
    933941}
    934942
    935943void cmt_regexp_node_set::dump (const cmt_string& title) const
    936944{
    937   tab (); cout << "Set (" << this << ") father=" << _father << " pars=" << _parentheses << endl;
     945  tab (); cerr << "Set (" << this << ") father=" << _father << " pars=" << _parentheses << endl;
     946
    938947  for (int i = 0; i < _nodes.size (); i++)
    939948    {
     
    943952          if (i > 0)
    944953            {
    945               tab (); cout << title << endl;
     954              tab (); cerr << title << endl;
    946955            }
    947956          tab_level++;
     
    950959        }
    951960    }
    952   tab (); cout << "EndSet (" << this << ")" << endl;
     961
     962  tab (); cerr << "EndSet (" << this << ")" << endl;
    953963}
    954964//----------------------------------------------------------
     
    978988 
    979989  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;}
    981992
    982993  for (i = 0; i < _nodes.size (); i++)
     
    988999      if (dbg) tab_level--;
    9891000
    990       if (dbg) {tab (); cout << "  -> it(" << n << ") p=" << it._pos << " l=" << it._length << endl;}
     1001      if (dbg) {tab (); cerr << "  -> it(" << n << ") p=" << it._pos << " l=" << it._length << endl;}
    9911002     
    9921003      if (it == cmt_regexp::iterator::null ()) return (it);
     
    9961007    }
    9971008
    998     // All nodes match
     1009  // All nodes match
    9991010 
    10001011  return (cmt_regexp::iterator (pos, total));
     
    11051116 
    11061117  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;}
    11081120
    11091121  int i;
     
    11271139        }
    11281140
    1129         //        at least one or-ed expression matches
     1141      //        at least one or-ed expression matches
    11301142      // if (it != cmt_regexp::iterator::null ()) return (it);
    11311143    }
     
    11751187    }
    11761188
    1177     //
    1178     // The root is the cmt_or_node which will be returned. It is
    1179     // the top of the hierarchy.
    1180     //
    1181     //  top is the running cmt_and_node.
    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  //
    11831195  cmt_regexp_node_set* or_root = 0;
    11841196  cmt_regexp_node_set* top_and = 0;
    11851197 
    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  {
    11911221    //
    1192     // exp     : and
    1193     //         | exp '|' and
     1222    // First we build an cmt_or_node (corresponding to the
     1223    // first grammatical rule)
    11941224    //
    1195     // and     : unary
    1196     //         | unary and
     1225    //  Then cmt_and_nodes are pushed into it.
     1226    //  and standard nodes are pushed into the running (top_and) cmt_and_node
    11971227    //
    1198     // unary   : primary '*'
    1199     //         | primary '?'
    1200     //
    1201     // primary : '[' opt_begin opt_chars opt_end ']'
    1202     //         | '^'
    1203     //         | '$'
    1204     //         | char
    1205     //         | '(' exp ')'
    1206     //
    1207  
    1208   {
    1209       //
    1210       // First we build an cmt_or_node (corresponding to the
    1211       // 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_node
    1215       //
    12161228    or_root = new cmt_or_node (0);
    12171229    top_and = new cmt_and_node (or_root);
     
    12251237      switch (c)
    12261238        {
    1227           case '[':
     1239        case '[':
    12281240          {
    1229               //
    1230               // The case is
    1231               //
    1232               //  exp   : '['     char ... ']'
    1233               //  exp   : '[' '^' char ... ']'
    1234               //
     1241            //
     1242            // The case is
     1243            //
     1244            //  exp   : '['     char ... ']'
     1245            //  exp   : '[' '^' char ... ']'
     1246            //
    12351247
    12361248            if (i >= expression.size ())
    12371249              {
    1238                   // syntax error : unbalanced '['
     1250                // syntax error : unbalanced '['
    12391251                delete or_root;
    12401252                return;
     
    12541266                switch (c)
    12551267                  {
    1256                     case ']':
    1257                       done = true;
    1258                       break;
    1259                     case '^':
    1260                       if (i == i0) has_not = true;
    1261                       else choices += c;
    1262                       break;
    1263                     case '\\':
    1264                       choices += c;
    1265                       if (i >= expression.size ())
    1266                         {
    1267                             // syntax error : unbalanced '[' and unfinished
    1268                             // escape sequence
    1269                           delete or_root;
    1270                           return;
    1271                         }
    1272                       i++;
    1273                       c = expression[i];
    1274                       choices += c;
    1275                       break;
    1276                     default:
    1277                       choices += c;
    1278                       break;
     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;
    12791291                  }
    12801292                if (done) break;
     
    12831295            if (!done)
    12841296              {
    1285                   // syntax error : unbalanced '['
     1297                // syntax error : unbalanced '['
    12861298                delete or_root;
    12871299                return;
     
    12931305          }
    12941306          break;
    1295           case '*':
     1307        case '*':
    12961308          {
    1297               //
    1298               //  exp : exp '*'
    1299               //
     1309            //
     1310            //  exp : exp '*'
     1311            //
    13001312            if (top_and->nodes () == 0)
    13011313              {
    1302                   // Syntax error : '*' is not preceded by an expression
     1314                // Syntax error : '*' is not preceded by an expression
    13031315                delete or_root;
    13041316                return;
     
    13091321          }
    13101322          break;
    1311           case '+':
     1323        case '+':
    13121324          {
    1313               //
    1314               //  exp : exp '+'
    1315               //
     1325            //
     1326            //  exp : exp '+'
     1327            //
    13161328            if (top_and->nodes () == 0)
    13171329              {
    1318                   // Syntax error : '+' is not preceded by an expression
     1330                // Syntax error : '+' is not preceded by an expression
    13191331                delete or_root;
    13201332                return;
     
    13251337          }
    13261338          break;
    1327           case '?':
     1339        case '?':
    13281340          {
    1329               //
    1330               //  exp : exp '?'
    1331               //
     1341            //
     1342            //  exp : exp '?'
     1343            //
    13321344            if (top_and->nodes () == 0)
    13331345              {
    1334                   // Syntax error : '?' is not preceded by an expression
     1346                // Syntax error : '?' is not preceded by an expression
    13351347                delete or_root;
    13361348                return;
     
    13411353          }
    13421354          break;
    1343           case '.':
    1344               //
    1345               //  exp : '.'
    1346               //
    1347             top_and->push (new cmt_any_node ());
    1348             break;
    1349           case '(':
     1355        case '.':
     1356          //
     1357          //  exp : '.'
     1358          //
     1359          top_and->push (new cmt_any_node ());
     1360          break;
     1361        case '(':
    13501362          {
    1351               //
    1352               //  exp : '(' exp ')'
    1353               //
     1363            //
     1364            //  exp : '(' exp ')'
     1365            //
    13541366            if (top_and->parentheses ())
    13551367              {
    1356                   // This should never happen.
     1368                // This should never happen.
    13571369                delete or_root;
    13581370                return;
     
    13611373            top_and->set_parentheses (true);
    13621374           
    1363               //
    1364               // A new complete expression is started.
    1365               //  -> do as for top_and parsing.
    1366               //
     1375            //
     1376            // A new complete expression is started.
     1377            //  -> do as for top_and parsing.
     1378            //
    13671379           
    13681380            top_and = new cmt_and_node (new cmt_or_node (top_and));
    13691381          }
    13701382          break;
    1371           case ')':
     1383        case ')':
    13721384          {
    1373               //
    1374               //  exp : '(' exp ')'
    1375               //
    1376            
    1377               // top_and is the cmt_and_node into which new nodes are pushed.
     1385            //
     1386            //  exp : '(' exp ')'
     1387            //
     1388           
     1389            // top_and is the cmt_and_node into which new nodes are pushed.
    13781390            cmt_regexp_node_set* or_node = top_and->father ();
    13791391            if (or_node == 0)
    13801392              {
    1381                   // This should never happen : top_and should always be
    1382                   // at least an cmt_and_node hanging at an cmt_or_node
     1393                // This should never happen : top_and should always be
     1394                // at least an cmt_and_node hanging at an cmt_or_node
    13831395                delete or_root;
    13841396                return;
    13851397              }
    13861398           
    1387               //
    1388               // The last cmt_and_node was empty, thus we had either '()' or '(...|)'
    1389               //
     1399            //
     1400            // The last cmt_and_node was empty, thus we had either '()' or '(...|)'
     1401            //
    13901402           
    13911403            if (top_and->nodes () == 0)
     
    14021414            if (top_and == 0)
    14031415              {
    1404                   // Syntax error : too many ')'
     1416                // Syntax error : too many ')'
    14051417                delete or_root;
    14061418                return;
    14071419              }
    14081420           
    1409               //
    1410               // top_and is now the previous running cmt_and_node where the '('
    1411               // was originally met its top_and node contains the parenthesized
    1412               // sub expression  If this one is empty, (due to an empty '()'
    1413               // expression) then it may simply be discarded.
    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            //
    14151427           
    14161428            if (!top_and->parentheses ())
    14171429              {
    1418                   // Syntax error : too many ')'
     1430                // Syntax error : too many ')'
    14191431                delete or_root;
    14201432                return;
     
    14431455         
    14441456          break;
    1445           case '|':
     1457        case '|':
    14461458          {
    1447               //
    1448               //  exp : exp '|' exp
    1449               //
     1459            //
     1460            //  exp : exp '|' exp
     1461            //
    14501462
    14511463            cmt_regexp_node_set* or_node = top_and->father ();
     
    14531465            top_and->reduce ();
    14541466           
    1455               //
    1456               // or is the father cmt_or_node, which only contains cmt_and_nodes
    1457               //
     1467            //
     1468            // or is the father cmt_or_node, which only contains cmt_and_nodes
     1469            //
    14581470           
    14591471            const cmt_regexp_node_set* and_node = (cmt_regexp_node_set*) or_node->top ();
    14601472            if (and_node->nodes () == 0)
    14611473              {
    1462                   // the previous node was empty.
    1463                   // we may discard it
     1474                // the previous node was empty.
     1475                // we may discard it
    14641476                or_node->pop ();
    14651477              }
     
    14681480          }
    14691481          break;
    1470           case '^':
    1471               //
    1472               //  exp : '^'
    1473               //
    1474             top_and->push (new cmt_begin_node ());
    1475             break;
    1476           case '$':
    1477               //
    1478               //  exp : '$'
    1479               //
    1480             top_and->push (new cmt_end_node ());
    1481             break;
    1482           case '\\':
    1483             if (i >= expression.size ())
    1484               {
    1485                 delete or_root;
    1486                 return;
    1487               }
    1488             i++;
    1489             c = expression[i];
    1490             switch (c)
    1491               {
    1492                 case '[':
    1493                 case ']':
    1494                 case '(':
    1495                 case ')':
    1496                 case '.':
    1497                 case '*':
    1498                 case '?':
    1499                 case '^':
    1500                 case '$':
    1501                 case '\\':
    1502                   break;
    1503                 case 'r':
    1504                   c = '\r';
    1505                   break;
    1506                 case 't':
    1507                   c = '\t';
    1508                   break;
    1509                 case 'n':
    1510                   c = '\n';
    1511                   break;
    1512                 default:
    1513                   break;
    1514               }
    1515           default:
    1516             top_and->push (new cmt_char_node (c));
    1517             break;
     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;
    15181530        }
    15191531    }
     
    15251537      if (or_root->nodes () == 1)
    15261538        {
    1527             //
    1528             // Check whether there is at least one non-empty
    1529             // cmt_and_node
    1530             //
     1539          //
     1540          // Check whether there is at least one non-empty
     1541          // cmt_and_node
     1542          //
    15311543          if (and_node->nodes () == 0)
    15321544            {
  • CMT/HEAD/source/cmt_script.cxx

    r11 r400  
    203203  switch (mode)
    204204    {
    205       case Csh :
    206         suffix = ".csh";
    207         cout << "source ";
    208         break;
    209       case Sh :
    210         suffix = ".sh";
    211         cout << ". ";
    212         break;
     205    case Csh :
     206      suffix = ".csh";
     207      cout << "source ";
     208      break;
     209    case Sh :
     210      suffix = ".sh";
     211      cout << ". ";
     212      break;
    213213    }
    214214
  • CMT/HEAD/source/cmt_sequence.cxx

    r11 r400  
    3333void SequenceRunner::filter (const cmt_string& line)
    3434{
    35     //cout << "line=[" << line << "]" << endl;
     35  //cerr << "line=[" << line << "]" << endl;
    3636 
    3737  CmtSystem::cmt_string_vector words;
     
    5151          buffer.write (filename);
    5252          cout << "%%Writing file " << filename << endl;
    53             //cout << buffer << endl;
     53          //cerr << buffer << endl;
    5454          buffer = "";
    5555         
     
    164164          buffer.write (filename);
    165165          cout << "%%Writing file " << filename << endl;
    166             //cout << buffer << endl;
     166          //cerr << buffer << endl;
    167167          buffer = "";
    168168        }
  • CMT/HEAD/source/cmt_symbol.cxx

    r257 r400  
    878878              if (Cmt::get_warnings ())
    879879              {
    880                   cout << "#CMT> Warning: Wrong path item " << t << " in " << name << endl;
     880                  cerr << "#CMT> Warning: Wrong path item " << t << " in " << name << endl;
    881881              }
    882882
     
    12861286          else
    12871287            {
    1288               //cout << "...discarding old values for symbol " << name << " text=[" << text << "]" << endl;
     1288              //cerr << "...discarding old values for symbol " << name << " text=[" << text << "]" << endl;
    12891289                 
    12901290              for (int i = 0; i < (value_lists.size () - 1); i++)
     
    14771477              else
    14781478                {
    1479                   //cout << "; ";
    14801479                  cout << endl;
    14811480                }
     
    22382237                    if (CmtSystem::getenv ("TESTPRR") != "")
    22392238                      {
    2240                         cout << "PRR> s=[" << s << "]";
     2239                        cerr << "PRR> s=[" << s << "]";
    22412240                      }
    22422241
     
    22472246                        if (CmtSystem::getenv ("TESTPRR") != "")
    22482247                          {
    2249                             cout << " match ";
     2248                            cerr << " match ";
    22502249                          }
    22512250                      }
     
    22542253                        if (CmtSystem::getenv ("TESTPRR") != "")
    22552254                          {
    2256                             cout << " no match ";
     2255                            cerr << " no match ";
    22572256                          }
    22582257                      }
     
    22602259                    if (CmtSystem::getenv ("TESTPRR") != "")
    22612260                      {
    2262                         cout << endl;
     2261                        cerr << endl;
    22632262                      }
    22642263                  }
  • CMT/HEAD/source/cmt_syntax.cxx

    r399 r400  
    3131  }
    3232  void action (const CmtSystem::cmt_string_vector& words,
    33                   Project* project,
    34                   const cmt_string& file_name,
    35                   int line_number)
     33               Project* project,
     34               const cmt_string& file_name,
     35               int line_number)
    3636  {}
    3737};
     
    4848  }
    4949  void action (const CmtSystem::cmt_string_vector& words,
    50                   Project* project,
    51                   const cmt_string& file_name,
    52                   int line_number)
     50               Project* project,
     51               const cmt_string& file_name,
     52               int line_number)
    5353  {}
    5454
     
    6464  {
    6565    if (use == &(Use::current ()))
    66     {
    67             Constituent::action (Application, words);
    68      }
     66      {
     67        Constituent::action (Application, words);
     68      }
    6969  }
    7070 
    7171  void action (const CmtSystem::cmt_string_vector& words,
    72                   Project* project,
    73                   const cmt_string& file_name,
    74                   int line_number)
     72               Project* project,
     73               const cmt_string& file_name,
     74               int line_number)
    7575  {}
    7676
     
    8888  }
    8989  void action (const CmtSystem::cmt_string_vector& words,
    90                   Project* project,
    91                   const cmt_string& file_name,
    92                   int line_number)
     90               Project* project,
     91               const cmt_string& file_name,
     92               int line_number)
    9393  {}
    9494
     
    106106  }
    107107  void action (const CmtSystem::cmt_string_vector& words,
    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       }
     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  }
    114114
    115115};
     
    128128  }
    129129  void action (const CmtSystem::cmt_string_vector& words,
    130                   Project* project,
    131                   const cmt_string& file_name,
    132                   int line_number)
    133   {
    134       cmt_string author;
    135       project->project_author_action (words);
     130               Project* project,
     131               const cmt_string& file_name,
     132               int line_number)
     133  {
     134    cmt_string author;
     135    project->project_author_action (words);
    136136  }
    137137};
     
    153153  }
    154154  void action (const CmtSystem::cmt_string_vector& words,
    155                   Project* project,
    156                   const cmt_string& file_name,
    157                   int line_number)
     155               Project* project,
     156               const cmt_string& file_name,
     157               int line_number)
    158158  {}
    159159
     
    170170   
    171171    /*Symbol* symbol = Symbol::find ("use_strategy");
    172     if (symbol != 0)
    173     {
     172      if (symbol != 0)
     173      {
    174174      cmt_string s = symbol->build_macro_value ();
    175175      Symbol::expand (s);
    176176      cerr <<"# value s: "<<s<<endl;     
    177     } */
     177      } */
    178178
    179179    Symbol::expand(value);
     
    221221    for (int i = 1; i < words.size (); i++)
    222222      {
    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                {
     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          {
    232232                   
    233                    if (p != 0) p->set_strategy (strategy, value, use->get_package_name ());
     233            if (p != 0) p->set_strategy (strategy, value, use->get_package_name ());
    234234          }
    235235        else
     
    247247               int line_number)
    248248  {
    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;   
    252251 
    253252           
    254       for (int i = 1; i < words.size (); i++)
    255       {
    256                const cmt_string& w = words[i];
    257 
    258                cmt_string strategy;
    259                cmt_string value;
     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;
    260259
    261260        bool in_error = false;
     
    264263          {
    265264            if (project != 0)
    266             {
    267                // project->set_strategy (strategy, value, project->get_use()->get_package_name ());
    268                project->set_strategy (strategy, value, "");
    269                cmt_string s  = "build_strategy ";
    270            s            += words[i];
    271            s            += "\n";           
    272                bool no_found = true;                     
    273            int size =  project->m_extra_lines.size ();
    274            for (int n = 0; n < size; n++)
    275            {
    276             if (s==project->m_extra_lines[n])
    277                 no_found = false;
    278            }
    279            if (no_found)         
    280            { 
    281               cmt_string & buffer = project->m_extra_lines.add();           
    282               buffer = s;
    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             
    285284          }
    286285        else
     
    306305  }
    307306  void action (const CmtSystem::cmt_string_vector& words,
    308                   Project* project,
    309                   const cmt_string& file_name,
    310                   int line_number)
     307               Project* project,
     308               const cmt_string& file_name,
     309               int line_number)
    311310  {}
    312311};
     
    323322  }
    324323  void action (const CmtSystem::cmt_string_vector& words,
    325                   Project* project,
    326                   const cmt_string& file_name,
    327                   int line_number)
     324               Project* project,
     325               const cmt_string& file_name,
     326               int line_number)
    328327  {}
    329328
     
    342341
    343342  void action (const CmtSystem::cmt_string_vector& words,
    344                   Project* project,
    345                   const cmt_string& file_name,
    346                   int line_number)
     343               Project* project,
     344               const cmt_string& file_name,
     345               int line_number)
    347346  {}
    348347};
     
    381380  }
    382381  void action (const CmtSystem::cmt_string_vector& words,
    383                   Project* project,
    384                   const cmt_string& file_name,
    385                   int line_number)
     382               Project* project,
     383               const cmt_string& file_name,
     384               int line_number)
    386385  {}
    387386
     
    402401  }
    403402  void action (const CmtSystem::cmt_string_vector& words,
    404                   Project* project,
    405                   const cmt_string& file_name,
    406                   int line_number)
     403               Project* project,
     404               const cmt_string& file_name,
     405               int line_number)
    407406  {}
    408407};
     
    422421  }
    423422  void action (const CmtSystem::cmt_string_vector& words,
    424                   Project* project,
    425                   const cmt_string& file_name,
    426                   int line_number)
     423               Project* project,
     424               const cmt_string& file_name,
     425               int line_number)
    427426  {}
    428427};
     
    439438  }
    440439  void action (const CmtSystem::cmt_string_vector& words,
    441                   Project* project,
    442                   const cmt_string& file_name,
    443                   int line_number)
     440               Project* project,
     441               const cmt_string& file_name,
     442               int line_number)
    444443  {}
    445444
     
    457456  }
    458457  void action (const CmtSystem::cmt_string_vector& words,
    459                   Project* project,
    460                   const cmt_string& file_name,
    461                   int line_number)
     458               Project* project,
     459               const cmt_string& file_name,
     460               int line_number)
    462461  {}
    463462
     
    478477  }
    479478  void action (const CmtSystem::cmt_string_vector& words,
    480                   Project* project,
    481                   const cmt_string& file_name,
    482                   int line_number)
     479               Project* project,
     480               const cmt_string& file_name,
     481               int line_number)
    483482  {}
    484483
     
    496495  }
    497496  void action (const CmtSystem::cmt_string_vector& words,
    498                   Project* project,
    499                   const cmt_string& file_name,
    500                   int line_number)
     497               Project* project,
     498               const cmt_string& file_name,
     499               int line_number)
    501500  {}
    502501
     
    517516  }
    518517  void action (const CmtSystem::cmt_string_vector& words,
    519                   Project* project,
    520                   const cmt_string& file_name,
    521                   int line_number)
     518               Project* project,
     519               const cmt_string& file_name,
     520               int line_number)
    522521  {}
    523522};
     
    534533  }
    535534  void action (const CmtSystem::cmt_string_vector& words,
    536                   Project* project,
    537                   const cmt_string& file_name,
    538                   int line_number)
    539   {
    540         action (words, project->get_use(), file_name, line_number);   
     535               Project* project,
     536               const cmt_string& file_name,
     537               int line_number)
     538  {
     539    action (words, project->get_use(), file_name, line_number);   
    541540  }
    542541};
     
    553552  }
    554553  void action (const CmtSystem::cmt_string_vector& words,
    555                   Project* project,
    556                   const cmt_string& file_name,
    557                   int line_number)
    558   {
    559             action (words, project->get_use(), file_name, line_number);
    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  }
    561560};
    562561
     
    572571  }
    573572  void action (const CmtSystem::cmt_string_vector& words,
    574                   Project* project,
    575                   const cmt_string& file_name,
    576                   int line_number)
    577   {
    578             action (words, project->get_use(), file_name, line_number);
    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  }
    580579};
    581580
     
    591590  }
    592591  void action (const CmtSystem::cmt_string_vector& words,
    593                   Project* project,
    594                   const cmt_string& file_name,
    595                   int line_number)
    596   {
    597             action (words, project->get_use(), file_name, line_number);
    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  }
    599598};
    600599
     
    610609  }
    611610  void action (const CmtSystem::cmt_string_vector& words,
    612                   Project* project,
    613                   const cmt_string& file_name,
    614                   int line_number)
     611               Project* project,
     612               const cmt_string& file_name,
     613               int line_number)
    615614 
    616615  {
    617             action (words, project->get_use(), file_name, line_number);
    618       }
     616    action (words, project->get_use(), file_name, line_number);
     617  }
    619618};
    620619
     
    630629  }
    631630  void action (const CmtSystem::cmt_string_vector& words,
    632                   Project* project,
    633                   const cmt_string& file_name,
    634                   int line_number)
    635   {
    636             action (words, project->get_use(), file_name, line_number);
    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  }
    638637};
    639638
     
    649648  }
    650649  void action (const CmtSystem::cmt_string_vector& words,
    651                   Project* project,
    652                   const cmt_string& file_name,
    653                   int line_number)
    654   {
    655             action (words, project->get_use(), file_name, line_number);
    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  }
    657656};
    658657
     
    668667  }
    669668  void action (const CmtSystem::cmt_string_vector& words,
    670                   Project* project,
    671                   const cmt_string& file_name,
    672                   int line_number)
     669               Project* project,
     670               const cmt_string& file_name,
     671               int line_number)
    673672  {}
    674673};
     
    685684  }
    686685  void action (const CmtSystem::cmt_string_vector& words,
    687                   Project* project,
    688                   const cmt_string& file_name,
    689                   int line_number)
     686               Project* project,
     687               const cmt_string& file_name,
     688               int line_number)
    690689  {}
    691690};
     
    700699  {
    701700    /*
    702     if (words.size () > 1)
    703       {
    704         if (use == &(Use::current()))
    705           {
    706             m_current_package = words[1];
    707             build_prefix (m_current_package, m_current_prefix);
     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);
    708707           
    709             if ((use->get_package_name () != "") &&
    710                 (use->get_package_name () != m_current_package))
    711               {
    712                 if (!m_quiet)
    713                   {
    714                     //  cerr << "#CMT> package name mismatch in requirements of " <<
    715                     //  use->get_package_name () << " " <<
    716                     //  use->version << " line #" << line_number;
    717                     //  cerr << " : " << m_current_package << " versus " <<
    718                     //  use->get_package_name () << endl;
    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      }
    721720           
    722             use->set (m_current_package,
    723                       m_current_version,
    724                       m_current_path,
    725                       "",
    726                       "");
     721      use->set (m_current_package,
     722      m_current_version,
     723      m_current_path,
     724      "",
     725      "");
    727726           
    728             use->change_path (m_current_path);
    729             use->style = m_current_style;
    730           }
     727      use->change_path (m_current_path);
     728      use->style = m_current_style;
     729      }
    731730      }
    732731    */
    733732  }
    734733  void action (const CmtSystem::cmt_string_vector& words,
    735                   Project* project,
    736                   const cmt_string& file_name,
    737                   int line_number)
     734               Project* project,
     735               const cmt_string& file_name,
     736               int line_number)
    738737  {}
    739738};
     
    750749  }
    751750  void action (const CmtSystem::cmt_string_vector& words,
    752                   Project* project,
    753                   const cmt_string& file_name,
    754                   int line_number)
     751               Project* project,
     752               const cmt_string& file_name,
     753               int line_number)
    755754  {}
    756755
     
    768767  }
    769768  void action (const CmtSystem::cmt_string_vector& words,
    770                   Project* project,
    771                   const cmt_string& file_name,
    772                   int line_number)
     769               Project* project,
     770               const cmt_string& file_name,
     771               int line_number)
    773772  {}
    774773};
     
    785784  }
    786785  void action (const CmtSystem::cmt_string_vector& words,
    787                   Project* project,
    788                   const cmt_string& file_name,
    789                   int line_number)
     786               Project* project,
     787               const cmt_string& file_name,
     788               int line_number)
    790789  {}
    791790};
     
    802801  }
    803802  void action (const CmtSystem::cmt_string_vector& words,
    804                   Project* project,
    805                   const cmt_string& file_name,
    806                   int line_number)
     803               Project* project,
     804               const cmt_string& file_name,
     805               int line_number)
    807806  {} 
    808807};
     
    819818  }
    820819  void action (const CmtSystem::cmt_string_vector& words,
    821                   Project* project,
    822                   const cmt_string& file_name,
    823                   int line_number)
     820               Project* project,
     821               const cmt_string& file_name,
     822               int line_number)
    824823  {} 
    825824};
     
    835834    Pattern::action (words, use);
    836835  }
    837    void action (const CmtSystem::cmt_string_vector& words,
    838                   Project* project,
    839                   const cmt_string& file_name,
    840                   int line_number)
     836  void action (const CmtSystem::cmt_string_vector& words,
     837               Project* project,
     838               const cmt_string& file_name,
     839               int line_number)
    841840  {}   
    842841};
     
    856855  }
    857856  void action (const CmtSystem::cmt_string_vector& words,
    858                   Project* project,
    859                   const cmt_string& file_name,
    860                   int line_number)
     857               Project* project,
     858               const cmt_string& file_name,
     859               int line_number)
    861860  {} 
    862861};
     
    893892      }
    894893  }
    895    void action (const CmtSystem::cmt_string_vector& words,
    896                   Project* project,
    897                   const cmt_string& file_name,
    898                   int line_number)
     894  void action (const CmtSystem::cmt_string_vector& words,
     895               Project* project,
     896               const cmt_string& file_name,
     897               int line_number)
    899898  {}   
    900899};
     
    911910  }
    912911  void action (const CmtSystem::cmt_string_vector& words,
    913                   Project* project,
    914                   const cmt_string& file_name,
    915                   int line_number)
     912               Project* project,
     913               const cmt_string& file_name,
     914               int line_number)
    916915  {}   
    917916};
     
    928927  }
    929928  void action (const CmtSystem::cmt_string_vector& words,
    930                   Project* project,
    931                   const cmt_string& file_name,
    932                   int line_number)
     929               Project* project,
     930               const cmt_string& file_name,
     931               int line_number)
    933932  {}   
    934933};
     
    945944  }
    946945  void action (const CmtSystem::cmt_string_vector& words,
    947                   Project* project,
    948                   const cmt_string& file_name,
    949                   int line_number)
     946               Project* project,
     947               const cmt_string& file_name,
     948               int line_number)
    950949  {}   
    951950};
     
    962961  }
    963962  void action (const CmtSystem::cmt_string_vector& words,
    964                   Project* project,
    965                   const cmt_string& file_name,
    966                   int line_number)
     963               Project* project,
     964               const cmt_string& file_name,
     965               int line_number)
    967966  {}   
    968967};
     
    979978  }
    980979  void action (const CmtSystem::cmt_string_vector& words,
    981                   Project* project,
    982                   const cmt_string& file_name,
    983                   int line_number)
     980               Project* project,
     981               const cmt_string& file_name,
     982               int line_number)
    984983  {} 
    985984};
     
    997996  }
    998997  void action (const CmtSystem::cmt_string_vector& words,
    999                   Project* project,
    1000                   const cmt_string& file_name,
    1001                   int line_number)
     998               Project* project,
     999               const cmt_string& file_name,
     1000               int line_number)
    10021001  {}
    10031002};
     
    10971096          {
    10981097            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              }
    11141114          }
    11151115        else
     
    12011201            if (project != 0) project->set_strategy (strategy, value, "");
    12021202            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              }     
    12181219          }
    12191220        else
     
    12381239  }
    12391240  void action (const CmtSystem::cmt_string_vector& words,
    1240                   Project* project,
    1241                   const cmt_string& file_name,
    1242                   int line_number)
     1241               Project* project,
     1242               const cmt_string& file_name,
     1243               int line_number)
    12431244  {
    12441245    action (words, project->get_use(), file_name, line_number);   
     
    12571258  }
    12581259  void action (const CmtSystem::cmt_string_vector& words,
    1259                   Project* project,
    1260                   const cmt_string& file_name,
    1261                   int line_number)
    1262   {
    1263               action (words, project->get_use(), file_name, line_number);   
    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 
    12651266};
    12661267
     
    12971298  }
    12981299  void action (const CmtSystem::cmt_string_vector& words,
    1299                   Project* project,
    1300                   const cmt_string& file_name,
    1301                   int line_number)
     1300               Project* project,
     1301               const cmt_string& file_name,
     1302               int line_number)
    13021303  {}
    13031304};
     
    13131314  }
    13141315  void action (const CmtSystem::cmt_string_vector& words,
    1315                   Project* project,
    1316                   const cmt_string& file_name,
    1317                   int line_number)
     1316               Project* project,
     1317               const cmt_string& file_name,
     1318               int line_number)
    13181319  {}
    13191320};
     
    13411342 
    13421343  void action (const CmtSystem::cmt_string_vector& words,
    1343                   Project* project,
    1344                   const cmt_string& file_name,
    1345                   int line_number)
     1344               Project* project,
     1345               const cmt_string& file_name,
     1346               int line_number)
    13461347  {action (words, project->get_use(), file_name, line_number);}
    13471348};
     
    13571358 *  Parse the input file, rejecting comments and
    13581359 * rebuilding complete lines (from sections separated by
    1359  *  \ characters.
     1360 *  \\ characters.
    13601361 *
    13611362 *  Each reformatted line is parsed by filter_line
     
    13781379
    13791380  me.do_parse_requirements (file_name, use);
    1380 
    1381 
     1381 
     1382 
    13821383  if (use != 0)
    1383   {
    1384         //
    1385          
    1386         Project* p = use->get_project ();
    1387         if (p != 0)
     1384    {
     1385      //
     1386     
     1387      Project* p = use->get_project ();
     1388      if (p != 0)
    13881389        {     
    1389            Use* p_use =  p->get_use();
    1390            if (p_use != 0 && p_use != use)
    1391            {
     1390          Use* p_use =  p->get_use();
     1391          if (p_use != 0 && p_use != use)
     1392            {
    13921393             
    13931394              //{
     
    14071408                int size =  p->m_extra_lines.size ();
    14081409                for (int n = 0; n < size; n++)
    1409                 {
     1410                  {
    14101411                    cmt_string& s = p->m_extra_lines[n];
    14111412                    SyntaxParser::parse_requirements_line (s, use);
    1412                 } 
     1413                  } 
    14131414              }
    14141415             
     
    14221423              // request += " ";
    14231424              // 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                {
    14411443                  uses.push_back (p_use);
    1442                 p_use->m_index = uses.size () - 1;
    1443              }
    1444                          
    1445            }
     1444                  p_use->m_index = uses.size () - 1;
     1445                }
     1446             
     1447            }
    14461448        }                 
    1447         use->close_scope_sections ();
    1448   }
     1449      use->close_scope_sections ();
     1450    }
    14491451}
    14501452
     
    14621464 *  Parse a text, rejecting comments and
    14631465 * rebuilding complete lines (from sections separated by
    1464  *  \ characters.
     1466 *  \\ characters.
    14651467 *
    14661468 *  Each reformatted line is parsed by filter_line
     
    14721474  SyntaxParser& me = instance ();
    14731475
    1474     /**
    1475      *
    1476      *    We have to preserve m_current_access since it reflects whether
    1477      *   the current cmt action is run in the context of the current package.
    1478      *   (the opposite is when the cmt command specifies the current package
    1479      *    in its arguments -use=... therefore the pwd is NOT the directory
    1480      *    of the current package)
    1481      *
    1482      *   m_current_access is Developer when pwd =  current
    1483      *                       User      when pwd != current
    1484      *
    1485      *    Therefore, as soon as we reach a used package, this must be switched to User
    1486      *
    1487      *   On the other hand, Cmt::scope reflects the status of the public/private
    1488      *  statements. By default, we are in public context when entering a new requirements
    1489      *  file.
    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   */
    14921494
    14931495  AccessMode saved_current_access;
     
    16541656 *  Parse a text, rejecting comments and
    16551657 * rebuilding complete lines (from sections separated by
    1656  *  \ characters.
     1658 *  \\ characters.
    16571659 *
    16581660 *  Each reformatted line is parsed by filter_line
     
    16791681  max_pos = text.size ();
    16801682
    1681   for (pos = 0; pos < max_pos;)
     1683  for (pos = 0; pos < max_pos; )
    16821684    {
    16831685      int cr = text.find (pos, "\r\n");
     
    18701872      /*
    18711873
    1872         When the first word of the line is not a keyword, it may be an
    1873         implicit pattern application.
    1874 
    1875        */
     1874      When the first word of the line is not a keyword, it may be an
     1875      implicit pattern application.
     1876
     1877      */
    18761878
    18771879      Pattern* p = Pattern::find (command);
  • CMT/HEAD/source/cmt_system.cxx

    r205 r400  
    6666  char* pwd_env = 0;
    6767
    68 #ifdef USE_PWD
    6968  pwd_env = ::getenv ("PWD"); 
    70 #endif
    7169
    7270  if (pwd_env != 0)
     
    7876      ptr = getcwd (buffer, sizeof (buffer));
    7977    }
     78
     79  //cerr << "pwd> " << buffer << endl;
    8080
    8181  const char* t = &buffer[0];
     
    8686bool CmtSystem::cd (const cmt_string& dir)
    8787{
    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);
    118114}
    119115
     
    253249  cmt_string here = CmtSystem::pwd ();
    254250  if  (test_directory(path))
    255   {
     251    {
    256252      CmtSystem::cd (path);
    257253      result = CmtSystem::pwd ();
    258254      CmtSystem::cd (here);
    259255      return true;
    260    }
    261    return false;
     256    }
     257  return false;
    262258}
    263259
     
    421417bool CmtSystem::touch_file (const cmt_string& name)
    422418{
    423     if (CmtSystem::test_file(name))
    424        {
    425             static cmt_string s;
    426             s.read (name);
    427             //unlink  (name);           
    428             FILE* f = fopen (name, "wb");
    429             if (f != NULL)
    430             {
    431               s.write (f);
    432               fclose (f);
    433               return (true);
    434             }
    435             chmod (name.c_str(), 0777);
    436 /*            FILE* f = fopen (name, "a+");
    437 
    438             if (f != NULL)
    439             {
    440                  cmt_string empty = " ";
    441                  empty.write(f);
     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);
    442438                 
    443                  fclose (f);
    444                  return true;
    445              }   
    446 */             
    447         }
    448     return false;
     439      fclose (f);
     440      return true;
     441      }   
     442      */             
     443    }
     444  return false;
    449445}
    450446   
     
    734730          if (::_mkdir (full_path.c_str ()) != 0)
    735731            {
    736                 // cerr << "CMT> cannot create directory " << full_path << endl;
     732              // cerr << "CMT> cannot create directory " << full_path << endl;
    737733              return (false);
    738734            }
     
    740736          if (::mkdir (full_path.c_str (), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH ) != 0)
    741737            {
    742                 // cerr << "CMT> cannot create directory " << full_path << endl;
     738              // cerr << "CMT> cannot create directory " << full_path << endl;
    743739              return (false);
    744740            }
     
    831827#else
    832828
    833   //cout << "scan_dir> dir=" << dir_name << endl;
     829  //cerr << "scan_dir> dir=" << dir_name << endl;
    834830
    835831  DIR* dir = opendir (dir_prefix.c_str ());
     
    851847              (strncmp (name, name_prefix.c_str (), name_prefix.size ()) != 0)) continue;
    852848
    853           //cout << "scan_dir> name=" << name << endl;
     849          //cerr << "scan_dir> name=" << name << endl;
    854850
    855851          cmt_string& name_entry = list.add ();
     
    926922#else
    927923
    928   //cout << "scan_dir> dir=" << dir_name << endl;
     924  //cerr << "scan_dir> dir=" << dir_name << endl;
    929925
    930926  DIR* dir = opendir (dir_prefix.c_str ());
     
    12511247
    12521248  if (name == "CMTCONFIG")
    1253   {
    1254     return (get_cmt_config ());
    1255   }
     1249    {
     1250      return (get_cmt_config ());
     1251    }
    12561252
    12571253  /*
    1258   if (name == "CMTROOT")
    1259   {
    1260           return (get_cmt_root ());
    1261   }
    1262 
    1263   if (name == "CMTSITE")
    1264   {
    1265           return (get_cmt_site ());
    1266   }
     1254    if (name == "CMTROOT")
     1255    {
     1256    return (get_cmt_root ());
     1257    }
     1258
     1259    if (name == "CMTSITE")
     1260    {
     1261    return (get_cmt_site ());
     1262    }
    12671263  */
    12681264
     
    12721268/**
    12731269   Implementation based on a local static map of used environment
    1274 variables to ensure a stable character string. The OS requires
    1275 that the character string sent via a putenv is kept untouched forever
    1276  */
     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*/
    12771273bool CmtSystem::putenv (const cmt_string& name, const cmt_string& value)
    12781274{
     
    15881584int CmtSystem::execute (const cmt_string& command)
    15891585{
    1590   //cout << "CmtSystem::execute1> [" << command << "]" << endl;
     1586  //cerr << "CmtSystem::execute1> [" << command << "]" << endl;
    15911587
    15921588  return (system (command.c_str ()));
     
    15981594  output = "";
    15991595
    1600   //cout << "CmtSystem::execute2> [" << command << "]" << endl;
     1596  //cerr << "CmtSystem::execute2> [" << command << "]" << endl;
    16011597
    16021598  FILE* f = popen (command.c_str (), "r");
     
    16441640
    16451641  for (int i = 0; i < dirs.size (); i++)
    1646       {
    1647         const cmt_string& d = dirs[i];
    1648 
    1649         req = d;
    1650         req += file_separator ();
    1651         req += "mgr";
    1652         req += file_separator ();
    1653         req += "requirements";
    1654 
    1655         if (test_file (req)) return (true);
     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);
    16561652
    16571653      req = d;
     
    17011697
    17021698  enum
    1703   {
    1704     starting,
    1705     at_key,
    1706     at_number
    1707   } state;
     1699    {
     1700      starting,
     1701      at_key,
     1702      at_number
     1703    } state;
    17081704
    17091705  int id;
     
    21472143      if (pos1 == cmt_string::npos) break;
    21482144
    2149         //
    2150         // extract "aaaa/xxxx" from "aaaa/xxxx/../bbbb"
    2151         //
     2145      //
     2146      // extract "aaaa/xxxx" from "aaaa/xxxx/../bbbb"
     2147      //
    21522148      cmt_string p = dir.substr (0, pos1);
    21532149
     
    21582154      if (dn == "") break;
    21592155     
    2160         //
    2161         // Is "aaaa/xxxx" only made of "xxxx" ?
    2162         //
     2156      //
     2157      // Is "aaaa/xxxx" only made of "xxxx" ?
     2158      //
    21632159      pos2 = p.find_last_of (file_separator ());
    21642160     
     
    22032199    }
    22042200
    2205     //if (dir[dir.size () - 1] == file_separator ()) dir.erase (dir.size () - 1);
     2201  //if (dir[dir.size () - 1] == file_separator ()) dir.erase (dir.size () - 1);
    22062202}
    22072203
     
    23052301}
    23062302
     2303
     2304
     2305
     2306
     2307//----------------------------------------------------------
     2308FilePath::FilePath ()
     2309{
     2310  p_name = "";
     2311  l_name = "";
     2312  alternates.resize (0);
     2313}
     2314
     2315//----------------------------------------------------------
     2316FilePath::FilePath (const FilePath& other)
     2317{
     2318  set (other);
     2319}
     2320
     2321//----------------------------------------------------------
     2322FilePath::FilePath (const cmt_string& other)
     2323{
     2324  set (other);
     2325}
     2326
     2327//----------------------------------------------------------
     2328FilePath::FilePath (const char* other)
     2329{
     2330  set (other);
     2331}
     2332
     2333//----------------------------------------------------------
     2334FilePath& FilePath::operator = (const FilePath& other)
     2335{
     2336  FilePath& me = *this;
     2337
     2338  me.set (other);
     2339
     2340  return (me);
     2341}
     2342
     2343//----------------------------------------------------------
     2344FilePath& FilePath::operator = (const cmt_string& other)
     2345{
     2346  FilePath& me = *this;
     2347
     2348  me.set (other);
     2349
     2350  return (me);
     2351}
     2352
     2353//----------------------------------------------------------
     2354FilePath& FilePath::operator = (const char* other)
     2355{
     2356  FilePath& me = *this;
     2357
     2358  me.set (other);
     2359
     2360  return (me);
     2361}
     2362
     2363//----------------------------------------------------------
     2364bool FilePath::operator == (const FilePath& other) const
     2365{
     2366  if (other.p_name == p_name) return (true);
     2367  return (false);
     2368}
     2369
     2370//----------------------------------------------------------
     2371bool 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//----------------------------------------------------------
     2392bool 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//----------------------------------------------------------
     2404bool FilePath::operator != (const FilePath& other) const
     2405{
     2406  const FilePath& me = *this;
     2407
     2408  return (!(me == other));
     2409}
     2410
     2411//----------------------------------------------------------
     2412bool FilePath::operator != (const cmt_string& other) const
     2413{
     2414  const FilePath& me = *this;
     2415
     2416  return (!(me == other));
     2417}
     2418
     2419//----------------------------------------------------------
     2420bool FilePath::operator != (const char* other) const
     2421{
     2422  const FilePath& me = *this;
     2423
     2424  return (!(me == other));
     2425}
     2426
     2427//----------------------------------------------------------
     2428bool FilePath::cd () const
     2429{
     2430  CmtSystem::cd (l_name);
     2431
     2432  return (false);
     2433}
     2434
     2435//----------------------------------------------------------
     2436void 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//----------------------------------------------------------
     2444void 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//----------------------------------------------------------
     2488void 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  
    145145};
    146146
     147class FilePath
     148{
     149public:
     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
     171private:
     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
    147184#endif
  • CMT/HEAD/source/cmt_tag.cxx

    r318 r400  
    104104              if (m_priority > ref->m_priority)
    105105                {
    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                     //
     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                  //
    111111
    112112                  ref->unmark ();
     
    114114              else
    115115                {
    116                     /*
    117                   if (!Cmt::quiet)
     116                  /*
     117                    if (!Cmt::quiet)
    118118                    {
    119                       cerr << "Cannot mark excluded tag " << m_name << " p=" << m_priority
    120                            << " because " << ref->m_name << "(" << ref->m_priority << ")" << endl;
    121                       show (0);
     119                    cerr << "Cannot mark excluded tag " << m_name << " p=" << m_priority
     120                    << " because " << ref->m_name << "(" << ref->m_priority << ")" << endl;
     121                    show (0);
    122122                    }
    123                     */
     123                  */
    124124
    125125                  return;
     
    191191  Tag* tag;
    192192 
    193     if (words.size () < 1) return;
     193  if (words.size () < 1) return;
    194194  name = words[1];
    195195  if (name == "") return;
     
    246246          ref = add (n, PriorityUserTag, "use", use);
    247247
    248             /*
    249           if (!Cmt::quiet)
    250             {
    251               cerr << "Excluding tag " << n << "(" << ref->m_priority << ") from tag "
    252                    << name << "(" << tag->m_priority << ")" << endl;
    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          */
    255255
    256256          tag->add_tag_exclude (ref);
     
    258258        }
    259259
    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         //
     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      //
    267267     
    268268      int count = 0;
     
    305305          if (winner_count > 1)
    306306            {
    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             //
     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          //
    316316         
    317317          if (tag != winner)
     
    343343
    344344  /*
    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     */
     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  */
    364364}
    365365
     
    372372
    373373  /*
    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);
     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);
    389389  */
    390390}
     
    413413          tag->m_priority = priority;
    414414
    415             /*
    416           if (!Cmt::quiet)
    417             {
    418               cerr << "increasing priority of " << name << " p=" << priority << endl;
    419             }
    420             */
     415          /*
     416            if (!Cmt::quiet)
     417            {
     418            cerr << "increasing priority of " << name << " p=" << priority << endl;
     419            }
     420          */
    421421        }
    422422      else
    423423        {
    424             /*
    425           if (!Cmt::quiet)
    426             {
    427               cerr << "keeping priority of " << name << " p=" << tag->m_priority << endl;
    428             }
    429             */
     424          /*
     425            if (!Cmt::quiet)
     426            {
     427            cerr << "keeping priority of " << name << " p=" << tag->m_priority << endl;
     428            }
     429          */
    430430        }
    431431
     
    869869/*
    870870  Check if a tag is part of the operands of a tag
    871  */
     871*/
    872872bool Tag::use_operand (const Tag* other) const
    873873{
     
    890890/*
    891891  Check if a tag is part of the refs of a tag
    892  */
     892*/
    893893bool Tag::use_ref (const Tag* other) const
    894894{
  • CMT/HEAD/source/cmt_triggers.cxx

    r11 r400  
    300300        {
    301301          cerr << "Syntax error in trigger file : bad keyword (" <<
    302               name << ")" << endl;
     302            name << ")" << endl;
    303303        }
    304304      exit (0);
     
    387387DependencyAnalyzer::DependencyAnalyzer (const cmt_string& package_name,
    388388                                        Constituent& constituent_ref) :
    389         package (package_name),
    390         constituent (constituent_ref)
     389  package (package_name),
     390  constituent (constituent_ref)
    391391{
    392392  cmt_string dirs;
     
    414414void DependencyAnalyzer::filter (const cmt_string& line)
    415415{
    416     /* Clip target out of dependency file... */
     416  /* Clip target out of dependency file... */
    417417  int pos = line.find ("=");
    418418  if ((pos == 0) || (pos == cmt_string::npos))
     
    448448    {
    449449      cerr << "#CMT> Warning: It seems there is nothing after \'=\' "
    450           "in dependency file " << m_file_name << endl;
     450        "in dependency file " << m_file_name << endl;
    451451      return;
    452452    }
     
    460460      const cmt_string& dep = deps[i];
    461461
    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         //
     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      //
    468468
    469469      if (dep.find (module) != cmt_string::npos)
     
    571571LibraryAnalyzer::LibraryAnalyzer (const cmt_string& package_name,
    572572                                  Constituent& constituent_ref) :
    573     DependencyAnalyzer (package_name, constituent_ref)
     573  DependencyAnalyzer (package_name, constituent_ref)
    574574{
    575575}
     
    655655ApplicationAnalyzer::ApplicationAnalyzer (const cmt_string& package_name,
    656656                                          Constituent& constituent_ref) :
    657     DependencyAnalyzer (package_name, constituent_ref)
     657  DependencyAnalyzer (package_name, constituent_ref)
    658658{
    659659}
     
    797797  cmt_string package = use->get_package_name ();
    798798
    799     // UseAnalyzer use_analyzer (package);
    800     // use_analyzer.run ("cmt show uses -quiet");
     799  // UseAnalyzer use_analyzer (package);
     800  // use_analyzer.run ("cmt show uses -quiet");
    801801
    802802  UseAnalyzer use_analyzer;
  • CMT/HEAD/source/cmt_use.cxx

    r344 r400  
    114114
    115115typedef 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   NewPatchIdGreaterThanOld
    132 } 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;
    133133
    134134static CompareStatus compare_versions (const cmt_string& ref_version, const cmt_string& new_version)
     
    151151    {
    152152      /*
    153       if (!Cmt::get_quiet ())
    154         {
    155           cout << "#1 Required version " << new_version <<
    156             " incompatible with selected version " << ref_version <<
    157             endl;
     153        if (!Cmt::get_quiet ())
     154        {
     155        cerr << "#1 Required version " << new_version <<
     156        " incompatible with selected version " << ref_version <<
     157        endl;
    158158        }
    159159      */
     
    184184        {
    185185          /*
    186           if (!Cmt::get_quiet ())
    187             {
    188               cout << "#2 Select version " << new_version <<
    189                 " instead of existing " << ref_version <<
    190                 endl;
     186            if (!Cmt::get_quiet ())
     187            {
     188            cerr << "#2 Select version " << new_version <<
     189            " instead of existing " << ref_version <<
     190            endl;
    191191            }
    192192          */
     
    197197        {
    198198          /*
    199           if (!Cmt::get_quiet ())
    200             cout << "#3 keep version " << ref_version <<
    201               " (ignore version " << new_version << ")" <<
    202               endl;
     199            if (!Cmt::get_quiet ())
     200            cerr << "#3 keep version " << ref_version <<
     201            " (ignore version " << new_version << ")" <<
     202            endl;
    203203          */
    204204
     
    223223
    224224          /*
    225           if (!Cmt::get_quiet ())
    226             {
    227               cout << "#4 Select release " << new_version
    228                    << " instead of existing " << ref_version
    229                    << endl;
     225            if (!Cmt::get_quiet ())
     226            {
     227            cerr << "#4 Select release " << new_version
     228            << " instead of existing " << ref_version
     229            << endl;
    230230            }
    231231          */
     
    236236        {
    237237          /*
    238           if (!Cmt::get_quiet ())
    239             cout << "#5 keep release " << ref_version <<
    240               " (ignore release " << new_version << ")" <<
    241               endl;
     238            if (!Cmt::get_quiet ())
     239            cerr << "#5 keep release " << ref_version <<
     240            " (ignore release " << new_version << ")" <<
     241            endl;
    242242          */
    243243
     
    248248    {
    249249      /*
    250       if (!Cmt::get_quiet ())
    251         {
    252           cout << "#6 Select release " << new_version <<
    253             " instead of existing " << ref_version <<
    254             endl;
     250        if (!Cmt::get_quiet ())
     251        {
     252        cerr << "#6 Select release " << new_version <<
     253        " instead of existing " << ref_version <<
     254        endl;
    255255        }
    256256      */
    257257 
    258258      result = NewMinorIdGreaterThanOld;
    259    }
     259    }
    260260  else if ((new_p == -1) || (old_p == -1) || (new_p < old_p))
    261261    {
     
    269269        {
    270270          /*
    271           if (!Cmt::get_quiet ())
    272             {
    273               cout << "#7 Select patch " << new_version <<
    274                 " instead of existing " << ref_version <<
    275                 endl;
     271            if (!Cmt::get_quiet ())
     272            {
     273            cerr << "#7 Select patch " << new_version <<
     274            " instead of existing " << ref_version <<
     275            endl;
    276276            }
    277277          */
     
    282282        {
    283283          /*
    284           if (!Cmt::get_quiet ())
    285             cout << "#8 keep patch " << ref_version <<
    286               " (ignore version " << new_version << ")" <<
    287               endl;
     284            if (!Cmt::get_quiet ())
     285            cerr << "#8 keep patch " << ref_version <<
     286            " (ignore version " << new_version << ")" <<
     287            endl;
    288288          */
    289289
     
    294294    {
    295295      /*
    296       if (!Cmt::get_quiet ())
    297         {
    298           cout << "#9 Select patch " << new_version <<
    299             " instead of existing " << ref_version <<
    300             endl;
     296        if (!Cmt::get_quiet ())
     297        {
     298        cerr << "#9 Select patch " << new_version <<
     299        " instead of existing " << ref_version <<
     300        endl;
    301301        }
    302302      */
     
    500500                {
    501501                  cout << "# package " << use->get_package_name () <<
    502                       " " << use->version << " " << use->path <<
    503                       " not found" <<
    504                       endl;
     502                    " " << use->version << " " << use->path <<
     503                    " not found" <<
     504                    endl;
    505505                }
    506506              CmtError::set (CmtError::package_not_found, use->get_package_name ());
     
    577577
    578578  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)
    579587      {
    580         state = need_package;
    581         auto_imports = Unspecified;
     588        native_version = w.substr (16);
    582589      }
    583 
    584   void set (const cmt_string& w)
     590    else if (w == "-auto_imports")
    585591      {
    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;
    632593      }
     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  }
    633633
    634634  bool ok ()
    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       }
     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  }
    643643
    644644  /**
     
    648648   */
    649649  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 ())
    650656      {
    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++)
    695663          {
    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 () << " ";
    705666          }
    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);
    750742          }
    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.
    753753        Use* new_use = Use::add (path, package, version,
    754754                                 version_alias, path_alias, native_version,
     
    767767            switch (new_use->auto_imports)
    768768              {
    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;
     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;
    795795              }
    796796
     
    826826
    827827        return (new_use);
    828       }
     828  }
    829829
    830830private:
    831831
    832832  enum
    833   {
    834     need_package,
    835     need_version,
    836     need_path,
    837     need_version_alias,
    838     need_path_alias,
    839     finished
    840   } state;
     833    {
     834      need_package,
     835      need_version,
     836      need_path,
     837      need_version_alias,
     838      need_path_alias,
     839      finished
     840    } state;
    841841 
    842842  State auto_imports;
     
    888888      else
    889889        {
    890              it.set (ew);
     890          it.set (ew);
    891891        }
    892892    }
     
    14321432      cout << "Use::reach_package> (" << get_package_name () << " "
    14331433           << version << ")from " << from_path << endl;
    1434           cout << "Use::reach_package> native_version required "<<n_version<<endl;
     1434      cout << "Use::reach_package> native_version required "<<n_version<<endl;
    14351435    }
    14361436   
     
    15141514  if (Cmt::get_debug ())
    15151515    {
    1516         cout << "Use::reach_package-5>" << endl;
     1516      cout << "Use::reach_package-5>" << endl;
    15171517    }
    15181518
     
    15291529
    15301530  if (CmtSystem::test_file ("cmt/requirements"))
    1531   {
     1531    {
    15321532      CmtSystem::cd ("cmt");
    15331533
     
    15351535
    15361536      if (CmtSystem::test_file ("version.cmt"))
    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);
     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);
    15801580    }
    15811581  else if (!CmtSystem::cd (version))
     
    15971597          CmtSystem::scan_dir (name, versions);
    15981598          if (n_version != "")
    1599           {
     1599            {
    16001600              CmtSystem::cmt_string_vector native_versions;           
    16011601              for (int i = 0; i < versions.size (); i++)
    1602               {
     1602                {
    16031603                  cmt_string path;
    16041604                  if (CmtSystem::test_directory (versions[i]))
    1605                   {
     1605                    {
    16061606                      path  = versions[i];
    16071607                      path += CmtSystem::file_separator ();
    16081608                      path += "cmt";
    1609                   }
     1609                    }
    16101610                  else
    1611                   {
     1611                    {
    16121612                      path = "cmt";
    1613                   }
     1613                    }
    16141614                  path += CmtSystem::file_separator ();
    16151615                  path += "native_version.cmt";       
    16161616                                 
    16171617                  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                }
    16351639              versions = native_versions;
    1636           }
     1640            }
    16371641         
    16381642          int i;
     
    17061710        }
    17071711
    1708         //
    1709         //  We have now the list of possible alternate versions. However
    1710         // we return that the expected package/version was not found (yet).
    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      //
    17121716
    17131717      return (0);
     
    17681772
    17691773    if (m_use->reach_package (path, this->native_version))
    1770     {
     1774      {
    17711775        if (Cmt::get_debug ())
    17721776          {
     
    19171921    {
    19181922      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         */
    19291923
    19301924      if (i == 0)
     
    19711965          if (reach_package (alternate_paths[selected_index]))
    19721966            {
    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 
    19821967              if (Cmt::get_debug ())
    19831968                {
     
    20001985                    const cmt_string& n_version,
    20011986                    Use** old_use,
    2002                             Use* context_use)
     1987                    Use* context_use)
    20031988{
    20041989  bool new_request = add_request (path, package, version);
     
    20902075             
    20912076              if (Cmt::get_debug ())
    2092                   {
    2093                       cout << " ... exactly same version and path!" << endl;
    2094                   }           
     2077                {
     2078                  cout << " ... exactly same version and path!" << endl;
     2079                }             
    20952080              do_need_new = false; // We don't need a new one
    20962081              if (n_version != use.native_version)
    2097               {
     2082                {
    20982083                  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
    21002088                  do_need_new = true;   
    2101               }       
    2102            }
     2089                }             
     2090            }
    21032091          else if (version != use.specified_version)
    21042092            {
     
    21292117          if ((new_v != -1) && (req_v != -1) && (new_v != req_v))
    21302118            {
    2131               cout << "# Required version " << version
     2119              cerr << "# Required version " << version
    21322120                   << " of package " << package;
    21332121
    21342122              if (context_use != 0)
    21352123                {
    2136                   cout << " [from " << context_use->get_package_name () << "]";
     2124                  cerr << " [from " << context_use->get_package_name () << "]";
    21372125                }
    21382126
    2139               cout << " incompatible with selected version " << use.version;
     2127              cerr << " incompatible with selected version " << use.version;
    21402128
    21412129              if (use.version != use.specified_version)
    21422130                {
    2143                   cout << " (" << use.specified_version << ")" ;
     2131                  cerr << " (" << use.specified_version << ")" ;
    21442132                }
    21452133
    2146               cout << endl;
     2134              cerr << endl;
    21472135            }
    21482136        }
     
    22202208                  do_need_new = false; // We don't need a new one
    22212209                  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                    }
    22272218                 
    22282219                }
     
    22542245              if ((new_v != -1) && (req_v != -1) && (new_v != req_v))
    22552246                {
    2256                   cout << "# Required version " << version
     2247                  cerr << "# Required version " << version
    22572248                       << " of package " << package;
    22582249
    22592250                  if (context_use != 0)
    22602251                    {
    2261                       cout << " [from " << context_use->get_package_name () << "]";
     2252                      cerr << " [from " << context_use->get_package_name () << "]";
    22622253                    }
    22632254             
    2264                   cout << " incompatible with selected version " << use.version;
     2255                  cerr << " incompatible with selected version " << use.version;
    22652256
    22662257                  if (use.version != use.specified_version)
    22672258                    {
    2268                       cout << " (" << use.specified_version << ")" ;
     2259                      cerr << " (" << use.specified_version << ")" ;
    22692260                    }
    22702261
    2271                   cout << endl;
     2262                  cerr << endl;
    22722263                }
    22732264            }
     
    23952386    {
    23962387      // 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
    24032389      use = old_use;
    24042390      old_use = 0;
     
    24222408  cmt_string here = CmtSystem::pwd ();
    24232409
    2424     //
    2425     // Store the specified sub_uses. Some of them may become discarded
    2426     // later on.
    2427     //
     2410  //
     2411  // Store the specified sub_uses. Some of them may become discarded
     2412  // later on.
     2413  //
    24282414  if (context_use != 0)
    24292415    {
     
    25432529      else
    25442530        {
    2545             //
    2546             //  This new version is different from the old one
    2547             // thus we have to choose
    2548             //
     2531          //
     2532          //  This new version is different from the old one
     2533          // thus we have to choose
     2534          //
    25492535          static BestFitSelector selector;
    2550       Use* selected_use = selector.operate (old_use, use);
     2536          Use* selected_use = selector.operate (old_use, use);
    25512537
    25522538          if (Cmt::get_debug ())
     
    25582544            }
    25592545
    2560             //
    2561             // Some situations managed by selector.operate happen
    2562             // to fail discarding the rejected Use.
    2563             //
     2546          //
     2547          // Some situations managed by selector.operate happen
     2548          // to fail discarding the rejected Use.
     2549          //
    25642550          if (use != selected_use)
    25652551            {
    2566                    use = use->set_selected_version (selected_use);
     2552              use = use->set_selected_version (selected_use);
    25672553            }
    25682554         
     
    25752561    }
    25762562
    2577     //
    2578     // The following statement is no longer considered as useful.
    2579     // It is commented. But we should clarify why it was really needed!
    2580     //
    2581     //use->undiscard ();
     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 ();
    25822568
    25832569  if (found)
     
    25952581      if ((use != &cu) && (package == cu.get_package ()))
    25962582        {
    2597             // This is a recursive call to the current package!!
     2583          // This is a recursive call to the current package!!
    25982584          registered = true;
    25992585          use->done = true;
     
    26262612          /*
    26272613            We look for all existing uses in that package.
    2628            */
     2614          */
    26292615          for (int i = 0; i < puses.size(); i++)
    26302616            {
     
    31613147      Symbol::expand (text);
    31623148
    3163       if (!Cmt::get_quiet ()) cout << "   Creating the reference file " << ref_file << endl;
     3149      if (!Cmt::get_quiet ()) cerr << "   Creating the reference file " << ref_file << endl;
    31643150      text.write (ref_file);
    31653151    }
     
    31863172
    31873173  //if (!Cmt::get_quiet ())
    3188   cout << "   Symlinking " << libname << " to " << s << endl;
     3174  cerr << "   Symlinking " << libname << " to " << s << endl;
    31893175
    31903176  if (symlinkcmd == "")
     
    32293215      if (!Cmt::get_quiet ())
    32303216        {
    3231           cout << "# package " << get_package_name () <<
     3217          cerr << "# package " << get_package_name () <<
    32323218            " " << version << " " << path <<
    32333219            " not found" <<
     
    33393325Use* Use::get_selected_version ()
    33403326{
    3341     //cout << "get_selected_version for package " << get_package_name () << endl;
    3342 
    33433327  if (!discarded) return (this);
    33443328
     
    33733357   When switching, m_index and auto_imports are
    33743358   transfered from the un-selected to the newly selected.
    3375  */
     3359*/
    33763360Use* Use::set_selected_version (Use* selected_use)
    33773361{
     
    34143398  auto_imports = new_state;
    34153399
    3416     // We propagate only when we switch from Off to On
     3400  // We propagate only when we switch from Off to On
    34173401
    34183402  if ((old_state == Off) && (new_state == On))
     
    36373621
    36383622   Result s accumulated into "list"
    3639  */
     3623*/
    36403624bool Use::get_paths (Use* to, UsePtrVector& list)
    36413625{
     
    37033687  /**
    37043688     Now "this" is a candidate new entry in the list
    3705    */
     3689  */
    37063690
    37073691  // First figure out whether 'to' is used by 'this'.
     
    37163700      /**
    37173701         Let's scan sub_uses now
    3718        */
     3702      */
    37193703      size = sub_uses.size ();
    37203704
     
    37493733                     Is that a bug?
    37503734                     Anyway we don't pursue on that branch.
    3751                    */
     3735                  */
    37523736                  continue;
    37533737                }
     
    40344018    {
    40354019      /*
    4036       if (verbose && !Cmt::get_quiet ())
    4037         {
    4038           cerr << "# Required explicit version " << new_version
    4039                << " of package " << ref_use->get_package_name ()
    4040                << " incompatible with selected explicit version " << ref_version
    4041                << endl;
    4042         }
    4043 
    4044       CmtError::set (CmtError::version_conflict, "BestFitSelector::operate> ");
    4045 
    4046       if (ref_use != new_use) new_use->discard ();
     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 ();
    40474031      */
    40484032
     
    41054089
    41064090          /*
    4107           if (verbose && !Cmt::get_quiet ())
    4108             {
    4109               cerr << "# keep " << ref_vc << " version " << ref_version
    4110                    << " of package " << ref_use->get_package_name ()
    4111                    << " (ignore " << new_vc << " version " << new_version << ")"
    4112                    << endl;
     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;
    41134097            }
    41144098          */
     
    41584142        {
    41594143          /*
    4160           if (verbose &&!Cmt::get_quiet ())
    4161             {
    4162               cerr << "# keep " << ref_rc << " release " << ref_version
    4163                    << " of package " << ref_use->get_package_name ()
    4164                    << " (ignore " << new_rc << " release " << new_version << ")"
    4165                    << endl;
     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;
    41664150            }
    41674151          */
     
    42174201        {
    42184202          /*
    4219           if (verbose && !Cmt::get_quiet ())
    4220             {
    4221               cerr << "# keep " << ref_pc << " patch " << ref_version
    4222                    << " [" << ref_use->specified_version << "]"
    4223                    << " of package " << ref_use->get_package_name ()
    4224                    << " (ignore " << new_pc << " version " << new_version << ")"
    4225                    << " [" << new_use->specified_version << "]"
    4226                    << endl;
     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;
    42274211            }
    42284212          */
     
    44294413Project* Use::get_project ()
    44304414{   
    4431     Project* p;
    4432     cmt_string cmtpath = "";
    4433     cmt_string offset  = "";   
    4434     get_cmtpath_and_offset (cmtpath, offset);
    4435     p = Project::find_by_cmtpath (cmtpath);
    4436     return p;   
    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.