Changeset 438 for CMT/HEAD


Ignore:
Timestamp:
Feb 2, 2008, 6:44:28 PM (16 years ago)
Author:
rybkin
Message:

See C.L. 343

Location:
CMT/HEAD
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r437 r438  
     12008-02-02    <rybkin@lal.in2p3.fr> 343
     2
     3        * source/cmt_parser.cxx: Correct treatment of the -with_version_directory
     4        and -without_version_directory command line options
     5        * source/cmt.h: idem
     6       
    172008-02-02    <rybkin@lal.in2p3.fr> 342
    28
  • CMT/HEAD/source/cmt.h

    r411 r438  
    8383  static void clear ();
    8484
    85   static void configure ();
     85  //  static void configure ();
     86  static void configure (const ArgParser& ap);
    8687  static void configure_cmt_path (Use* use);
    8788  static void configure_config_tag ();
     
    8990  static void configure_current_dir ();
    9091  static void configure_current_package ();
    91   static void configure_current_structuring_style ();
     92  //  static void configure_current_structuring_style ();
     93  static void configure_current_structuring_style (const ArgParser& ap);
    9294  static void configure_default_path ();
    9395  static void configure_home (Use* use);
     
    228230  static void install_test_cleanup_scripts ();
    229231  static void install_test_setup_scripts ();
    230   static bool load (const cmt_string& path,
     232  //  static bool load (const cmt_string& path,
     233  static bool load (const ArgParser& ap,
     234                    const cmt_string& path,
    231235                    const cmt_string& package,
    232236                    const cmt_string& version,
  • CMT/HEAD/source/cmt_parser.cxx

    r435 r438  
    505505
    506506//----------------------------------------------------------
    507 void Cmt::configure ()
     507//void Cmt::configure ()
     508void Cmt::configure (const ArgParser& ap)
    508509{
    509510  Log;
     
    546547
    547548  log << "configure_current_structuring_style" << log_endl;
    548   configure_current_structuring_style ();
     549  //  configure_current_structuring_style ();
     550  configure_current_structuring_style (ap);
    549551
    550552  log << "configure_current_package" << log_endl;
     
    881883          CmtStructuringStyle structuring_style(default_structuring_style);
    882884          CmtStructuringStyle style(default_structuring_style);
    883           // - the project the package belongs to
    884           Project* p = Project::get_current ();
    885           if (p)
    886             {
    887               style = p->get_strategy ("VersionDirectory") ? with_version_directory : without_version_directory ;
    888               StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
    889               if (def != 0)
    890                 {
    891                   if (p->is_specified (def)) structuring_style = style;
    892                 }
    893             }
     885          // - the command line options
     886          //   or
    894887          // - the CMTSTRUCTURINGSTYLE environment variable
    895888          if (structuring_style == default_structuring_style)
    896889            {
    897890              structuring_style = get_current_structuring_style ();
     891            }
     892          // - the project the package belongs to
     893          if (structuring_style == default_structuring_style)
     894            {
     895              Project* p = Project::get_current ();
     896              if (p)
     897                {
     898                  style = p->get_strategy ("VersionDirectory") ? with_version_directory : without_version_directory ;
     899                  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
     900                  if (def != 0)
     901                    {
     902                      if (p->is_specified (def)) structuring_style = style;
     903                    }
     904                }
    898905            }
    899906          // - the child projects of the project the package belongs to
     
    950957
    951958//----------------------------------------------------------
    952 void Cmt::configure_current_structuring_style ()
    953 {
     959//void Cmt::configure_current_structuring_style ()
     960void Cmt::configure_current_structuring_style (const ArgParser& ap)
     961{
     962  for (int i = ap.argc - 1; i >= 0; i--)
     963    {
     964      const cmt_string& arg = ap.argv[i];
     965      if (arg == "-without_version_directory")
     966        {
     967          Me.m_current_structuring_style = without_version_directory;
     968          return;
     969        }
     970      else if (arg == "-with_version_directory")
     971        {
     972          Me.m_current_structuring_style = with_version_directory;
     973          return;
     974        }
     975    }
     976
    954977  cmt_string s;
    955978
     
    21372160    }
    21382161
    2139   configure_current_package ();
     2162  //  configure_current_package ();
    21402163
    21412164  Generator::build_default_makefile ();
     
    23072330    }
    23082331
    2309   configure_current_package ();
     2332  //  configure_current_package ();
    23102333
    23112334  Generator::build_default_makefile ();
     
    34323455
    34333456  clear     ();
    3434   configure ();
     3457  //  configure ();
     3458  configure (ap);
    34353459
    34363460  cout << "# ----------- Clients of " << package <<
     
    46504674 *    This is considered to be rather unsafe, and should be replaced by query functions.
    46514675 */
    4652 bool Cmt::load (const cmt_string& path,
     4676//bool Cmt::load (const cmt_string& path,
     4677bool Cmt::load (const ArgParser& ap,
     4678                const cmt_string& path,
    46534679                const cmt_string& package,
    46544680                const cmt_string& version,
     
    46564682{
    46574683  clear ();
    4658   configure ();
     4684  //  configure ();
     4685  configure (ap);
    46594686
    46604687  Me.m_action  = action_load;
     
    49755002  clear ();
    49765003
    4977   configure ();
     5004  //  configure ();
     5005  configure (ap);
    49785006
    49795007  CmtError::clear ();
Note: See TracChangeset for help on using the changeset viewer.