Changeset 431


Ignore:
Timestamp:
Jan 14, 2008, 3:02:48 PM (16 years ago)
Author:
rybkin
Message:

See C.L. 337

Location:
CMT/HEAD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r430 r431  
     12008-01-14    <rybkin@lal.in2p3.fr> 337
     2
     3        * source/cmt_parser.cxx: Make use of the structuring style, when
     4        configuring a package without a version.cmt file, to allow the use
     5        of digits in package names of such packages structured without
     6        a version directory
     7       
    182007-11-25    <rybkin@lal.in2p3.fr> 336
    29
  • CMT/HEAD/source/cmt_parser.cxx

    r428 r431  
    543543  configure_current_dir ();
    544544
     545  guess_current_project ();
     546
     547  log << "configure_current_structuring_style" << log_endl;
     548  configure_current_structuring_style ();
     549
    545550  log << "configure_current_package" << log_endl;
    546551  configure_current_package ();
    547 
    548   log << "configure_current_structuring_style" << log_endl;
    549   configure_current_structuring_style ();
    550552
    551553  Use& use = Use::current();
     
    560562
    561563  use.change_path (Me.m_current_path);
    562 
    563   guess_current_project ();
    564564
    565565  if (CmtError::has_pending_error ())
     
    875875          Me.m_current_style = no_version_style;
    876876        }
    877       else if (CmtSystem::is_version_directory (up_branch))
    878         {
    879           // The up branch IS a version directory.
    880 
    881           Me.m_current_version = up_branch;
    882           CmtSystem::dirname (up_dir, up_dir);
    883           CmtSystem::basename (up_dir, Me.m_current_package);
    884           CmtSystem::dirname (up_dir, Me.m_current_path);
    885         }
    886877      else
    887         {
    888           // No version descriptor
    889           // No version directory. The version is defaulted to v*
    890  
    891           CmtSystem::basename (up_dir, Me.m_current_package);
    892           Me.m_current_version = "v*";
    893           CmtSystem::dirname (up_dir, Me.m_current_path);
    894 
    895           Me.m_current_style = no_version_style;
    896         }
    897 
     878        {
     879          // Try to determine the structuring style from:
     880          //
     881          CmtStructuringStyle structuring_style(default_structuring_style);
     882          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            }
     894          // - the CMTSTRUCTURINGSTYLE environment variable
     895          if (structuring_style == default_structuring_style)
     896            {
     897              structuring_style = get_current_structuring_style ();
     898            }
     899          // - the child projects of the project the package belongs to
     900          if (structuring_style == default_structuring_style)
     901            {
     902              structuring_style = style;
     903            }
     904          // - the default value of the Structure strategy
     905          if (structuring_style == default_structuring_style)
     906            {
     907              structuring_style = StrategyMgr::get_default_strategy ("VersionDirectory") ? with_version_directory : without_version_directory ;
     908            }
     909
     910          // Make use of the structuring style
     911          //
     912          if (structuring_style == with_version_directory && CmtSystem::is_version_directory (up_branch))
     913            {
     914              // The up branch IS a version directory.
     915             
     916              Me.m_current_version = up_branch;
     917              CmtSystem::dirname (up_dir, up_dir);
     918              CmtSystem::basename (up_dir, Me.m_current_package);
     919              CmtSystem::dirname (up_dir, Me.m_current_path);
     920            }
     921          else
     922            {
     923              if (structuring_style == with_version_directory)
     924                {
     925                  cerr << "#CMT> warning: " << up_branch << " is not correct version syntax. Assuming it is package name" << endl;
     926                }
     927              // No version descriptor
     928              // No version directory. The version is defaulted to v*
     929             
     930              Me.m_current_package = up_branch;
     931              Me.m_current_version = "v*";
     932              CmtSystem::dirname (up_dir, Me.m_current_path);
     933             
     934              Me.m_current_style = no_version_style;
     935            }
     936        }
    898937      build_prefix (Me.m_current_package, Me.m_current_prefix);
    899938      build_config (Me.m_current_prefix, Me.m_current_config);
Note: See TracChangeset for help on using the changeset viewer.