Changeset 291


Ignore:
Timestamp:
Oct 26, 2006, 6:32:41 PM (19 years ago)
Author:
garonne
Message:

commit de sauvegarde :)

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/mgr/cmt_dependencies.make

    r144 r291  
    2424cmt_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
    2525cmt_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_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_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_cmtpath_pattern.h   ../source/cmt_database.h   ../source/cmt_syntax.h   ../source/cmt_error.h
     26cmt_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
    2727cmt_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
    2828cmt_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
  • CMT/HEAD/source/cmt_project.cxx

    r283 r291  
    570570      // Last step is to parse the project file
    571571
     572      // First create the Project.m_use for the policy
     573      project->m_use = Use::create (project->get_cmtpath(),
     574                                    "project_"+project->get_name()+"_policy",
     575                                    project->get_release (), "", "", "");                                   
     576      project->m_use->done = false;
     577     
    572578      if (Cmt::get_debug ())
    573579        {
  • CMT/HEAD/source/cmt_project.h

    r273 r291  
    1111#include "cmt_parser.h"
    1212#include "cmt_system.h"
     13#include "cmt_use.h"
    1314#include "cmt_awk.h"
     15
    1416
    1517class Project;
     
    186188 
    187189  void visit (IProjectVisitor& visitor);
     190
     191
     192  Use* m_use;
    188193 
    189194private:
     
    207212
    208213  bool m_configured;
    209 
    210214  cmt_vector <Strategy> m_strategies;
    211215};
  • CMT/HEAD/source/cmt_syntax.cxx

    r284 r291  
    109109                  const cmt_string& file_name,
    110110                  int line_number)
    111   {}
     111  {
     112      action (words, project->m_use, file_name, line_number);
     113  }
    112114
    113115};
     
    163165  bool decode (const cmt_string& w, cmt_string& strategy, cmt_string& value)
    164166  {
    165     bool result = true;
    166 
    167     value = w;
    168 
    169     if (w == "prototypes")
     167    bool result = true;   
     168     
     169    value =  w;
     170    Symbol::expand(value);
     171               
     172
     173    if (value == "prototypes")
    170174      {
    171175        strategy = "BuildPrototypes";
    172176      }
    173     else if (w == "no_prototypes")
     177    else if (value == "no_prototypes")
    174178      {
    175179        strategy = "BuildPrototypes";
    176180      }
    177     else if ((w == "with_installarea") || (w == "with_install_area"))
     181    else if ((value == "with_installarea") || (value == "with_install_area"))
    178182      {
    179183        value = "with_installarea";
    180184        strategy = "InstallArea";
    181185      }
    182     else if ((w == "without_installarea") || (w == "without_install_area"))
     186    else if ((value == "without_installarea") || (value == "without_install_area"))
    183187      {
    184188        value = "without_installarea";
     
    232236               int line_number)
    233237  {
    234     for (int i = 1; i < words.size (); i++)
     238      for (int i = 1; i < words.size (); i++)
    235239      {
    236240        const cmt_string& w = words[i];
     
    494498    Symbol::action (words, CommandMacro, use);
    495499  }
    496   void action (const CmtSystem::cmt_string_vector& words,
    497                   Project* project,
    498                   const cmt_string& file_name,
    499                   int line_number)
    500   {}
     500 
     501 
     502  void action (const CmtSystem::cmt_string_vector& words,
     503                  Project* project,
     504                  const cmt_string& file_name,
     505                  int line_number)
     506  {                         
     507      action (words, project->m_use, file_name, line_number);
     508  }
    501509};
    502510
     
    515523                  const cmt_string& file_name,
    516524                  int line_number)
    517   {}
     525  {
     526      action (words, project->m_use, file_name, line_number);   
     527  }
    518528};
    519529
     
    532542                  const cmt_string& file_name,
    533543                  int line_number)
    534   {}
     544  {
     545      action (words, project->m_use, file_name, line_number);   
     546  }
    535547};
    536548
     
    549561                  const cmt_string& file_name,
    550562                  int line_number)
    551   {}
     563  {
     564      action (words, project->m_use, file_name, line_number);
     565  }
    552566};
    553567
     
    566580                  const cmt_string& file_name,
    567581                  int line_number)
    568   {}
     582  {
     583      action (words, project->m_use, file_name, line_number);
     584  }
    569585};
    570586
     
    583599                  const cmt_string& file_name,
    584600                  int line_number)
    585   {}
     601  {
     602      action (words, project->m_use, file_name, line_number);
     603  }
    586604};
    587605
     
    600618                  const cmt_string& file_name,
    601619                  int line_number)
    602   {}
     620  {
     621      action (words, project->m_use, file_name, line_number);
     622  }
    603623};
    604624
     
    957977
    958978    value = w;
    959 
    960     if (w == "config")
     979    Symbol::expand(value);
     980
     981    if (value == "config")
    961982      {
    962983        strategy = "SetupConfig";
    963984      }
    964     else if (w == "no_config")
     985    else if (value == "no_config")
    965986      {
    966987        strategy = "SetupConfig";
    967988      }
    968     else if (w == "root")
     989    else if (value == "root")
    969990      {
    970991        strategy = "SetupRoot";
    971992      }
    972     else if (w == "no_root")
     993    else if (value == "no_root")
    973994      {
    974995        strategy = "SetupRoot";
    975996      }
    976     else if (w == "cleanup")
     997    else if (value == "cleanup")
    977998      {
    978999        strategy = "SetupCleanup";
    9791000      }
    980     else if (w == "no_cleanup")
     1001    else if (value == "no_cleanup")
    9811002      {
    9821003        strategy = "SetupCleanup";
     
    10291050               int line_number)
    10301051  {
    1031     for (int i = 1; i < words.size (); i++)
     1052        for (int i = 1; i < words.size (); i++)
    10321053      {
    10331054        const cmt_string& w = words[i];
     
    10601081
    10611082    value = w;
    1062 
    1063     if (w == "with_version_directory")
     1083    Symbol::expand(value);
     1084
     1085   
     1086    if (value == "with_version_directory")
    10641087      {
    10651088        strategy = "VersionDirectory";
    10661089      }
    1067     else if (w == "without_version_directory")
     1090    else if (value == "without_version_directory")
    10681091      {
    10691092        strategy = "VersionDirectory";
     
    11161139               int line_number)
    11171140  {
    1118     for (int i = 1; i < words.size (); i++)
     1141      for (int i = 1; i < words.size (); i++)
    11191142      {
    11201143        const cmt_string& w = words[i];
     
    11531176                  const cmt_string& file_name,
    11541177                  int line_number)
    1155   {} 
     1178  {
     1179        action (words, project->m_use, file_name, line_number);   
     1180  } 
    11561181};
    11571182
     
    11701195                  const cmt_string& file_name,
    11711196                  int line_number)
    1172   {} 
     1197  {
     1198          action (words, project->m_use, file_name, line_number);
     1199  } 
    11731200};
    11741201
     
    12781305
    12791306      use->fill_standard_macros (buffer);
    1280 
    12811307      AccessMode saved_current_access = Cmt::get_current_access ();
    12821308      Cmt::set_current_access (UserMode);
    12831309      me.do_parse_text (buffer, "", package_context, use, 0);
    12841310      Cmt::set_current_access (saved_current_access);
     1311     
     1312      //
     1313      Project* p = use->get_project ();
     1314      if (p != 0)
     1315      {     
     1316           if (p->m_use !=0)
     1317           {
     1318               use->sub_uses.push_back (p->m_use);
     1319           }
     1320      }
    12851321    }
    12861322
     
    14361472  m_keywords.add ("version", new KwdVersion ());
    14371473
     1474  // Project
    14381475  m_project_keywords.add ("author", new KwdAuthor());
     1476  m_project_keywords.add ("apply_tag", new KwdApplyTag ());
    14391477  m_project_keywords.add ("build_strategy", new KwdBuildStrategy ());
    14401478  m_project_keywords.add ("container", new KwdContainer ());
     1479 
     1480  m_project_keywords.add ("macro", new KwdMacro ());
     1481  m_project_keywords.add ("macro+", new KwdMacroAppend ());
     1482  m_project_keywords.add ("macro_prepend", new KwdMacroPrepend ());
     1483  m_project_keywords.add ("macro_append", new KwdMacroAppend ());
     1484  m_project_keywords.add ("macro_remove", new KwdMacroRemove ());
     1485  m_project_keywords.add ("macro_remove_regexp", new KwdMacroRemoveRegexp ());
     1486  m_project_keywords.add ("macro_remove_all", new KwdMacroRemoveAll ());
     1487  m_project_keywords.add ("macro_remove_all_regexp", new KwdMacroRemoveAllRegexp ());
     1488
     1489  m_project_keywords.add ("tag", new KwdTag ());
     1490  m_project_keywords.add ("tag_exclude", new KwdTagExclude ());
     1491 
    14411492  m_project_keywords.add ("project", new KwdProject ());
    14421493  m_project_keywords.add ("setup_strategy", new KwdSetupStrategy ());
  • CMT/HEAD/source/cmt_use.cxx

    r290 r291  
    13731373               const cmt_string& new_path,
    13741374               const cmt_string& new_version_alias,
    1375                const cmt_string& new_path_alias)
     1375               const cmt_string& new_path_alias,
     1376               const cmt_string& native_version)
    13761377{
    13771378  clear ();
     
    13871388  specified_version = new_version;
    13881389  version           = new_version;
     1390  this->native_version    = native_version;
    13891391  path              = specified_path;
    13901392  Symbol::expand (path);
     
    15401542
    15411543      if (CmtSystem::test_file ("version.cmt"))
    1542         {
    1543           cmt_string v;
    1544 
    1545           v.read ("version.cmt");
    1546           int pos;
    1547           pos = v.find ('\n');
    1548           if (pos != cmt_string::npos) v.erase (pos);
    1549           pos = v.find ('\r');
    1550           if (pos != cmt_string::npos) v.erase (pos);
    1551 
    1552           CompareStatus s = compare_versions (version, v);
    1553 
    1554           if (Cmt::get_debug ())
    1555             {
    1556               cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl;
    1557             }
    1558 
    1559           switch (s)
    1560             {
    1561             case IdenticalIds:
    1562             case ExplicitOldMajorIdWinsAgainstWildarded:
    1563             case ExplicitOldMinorIdWinsAgainstWildarded:
    1564             case ExplicitOldPatchIdWinsAgainstWildarded:
    1565               break;
    1566             case ExplicitNewMajorIdWinsAgainstWildarded:
    1567             case ExplicitNewMinorIdWinsAgainstWildarded:
    1568             case NewMinorIdGreaterThanOld:
    1569             case ExplicitNewPatchIdWinsAgainstWildarded:
    1570             case NewPatchIdGreaterThanOld:
    1571               break;
    1572             case OldMajorIdGreaterThanNew:
    1573             case NewMajorIdGreaterThanOld:
    1574               break;
    1575             case IncompatibleMajorIds:
    1576               return (0);
    1577             }
    1578           version = v;
     1544        {
     1545              cmt_string v;
     1546
     1547              v.read ("version.cmt");
     1548              int pos;
     1549              pos = v.find ('\n');
     1550              if (pos != cmt_string::npos) v.erase (pos);
     1551              pos = v.find ('\r');
     1552              if (pos != cmt_string::npos) v.erase (pos);
     1553
     1554              CompareStatus s = compare_versions (version, v);
     1555
     1556              if (Cmt::get_debug ())
     1557                {
     1558                  cout << "Use::reach_package-6.1> version=" << version << " v=" << v << " s=" << s << endl;
     1559                }
     1560
     1561          switch (s)
     1562            {
     1563            case IdenticalIds:
     1564            case ExplicitOldMajorIdWinsAgainstWildarded:
     1565            case ExplicitOldMinorIdWinsAgainstWildarded:
     1566            case ExplicitOldPatchIdWinsAgainstWildarded:
     1567              break;
     1568            case ExplicitNewMajorIdWinsAgainstWildarded:
     1569            case ExplicitNewMinorIdWinsAgainstWildarded:
     1570            case NewMinorIdGreaterThanOld:
     1571            case ExplicitNewPatchIdWinsAgainstWildarded:
     1572            case NewPatchIdGreaterThanOld:
     1573              break;
     1574            case OldMajorIdGreaterThanNew:
     1575            case NewMajorIdGreaterThanOld:
     1576              break;
     1577            case IncompatibleMajorIds:
     1578              return (0);
     1579            }
     1580              version = v;
    15791581        }
    15801582      else if (version == "")
     
    16301632                          pos = nv.find ('\r');
    16311633                          if (pos != cmt_string::npos) nv.erase (pos);
    1632                      
     1634                                         
    16331635                          if (nv == n_version)
    16341636                          {
     
    23012303      if (registered != 0) *old_use = registered;
    23022304      else *old_use = found;
     2305
     2306      // Should check native_version !
     2307      if (native_version != "" && !do_need_new)
     2308      {
     2309
     2310          if ((*old_use)->native_version != native_version)
     2311          {
     2312              do_need_new = true;   
     2313              *old_use = 0;
     2314          }
     2315      }   
    23032316    }
    23042317
     
    23142327Use* Use::create (const cmt_string& path,
    23152328                  const cmt_string& package,
    2316                   const cmt_string& version,
     2329                  const cmt_string& version,                 
    23172330                  const cmt_string& version_alias,
     2331                  const cmt_string& native_version,                 
    23182332                  const cmt_string& path_alias)
    23192333{
     
    23392353  Use& use_object = instances.add ();
    23402354
    2341   use_object.set (package, version, path, version_alias, path_alias);
     2355  use_object.set (package, version, path, version_alias, path_alias, native_version);
    23422356
    23432357  return (&use_object);
     
    23632377
    23642378  Use* old_use = 0;
    2365   Use* use = 0;
     2379  Use* use     = 0;
    23662380
    23672381  do_need_new = need_new (path, package_name, version, native_version, &old_use, context_use);
    2368   //cout <<"native_version: "<<native_version<<" "<<version<<" "<<do_need_new<<endl;
    2369    
    23702382
    23712383  if (Cmt::get_debug ())
     
    23822394  if (do_need_new)
    23832395    {
    2384       use = create (path, package_name, version, version_alias, path_alias);
     2396      use = create (path, package_name, version, version_alias, native_version, path_alias);
    23852397      //cout <<"need_new native_version: "<<native_version<<" "<<version<<" "<<do_need_new<<endl;
    23862398    }
     
    34793491}
    34803492
     3493Project* Use::get_project () const
     3494{
     3495    Project* p;
     3496    cmt_string cmtpath = "";
     3497    cmt_string offset  = "";   
     3498    get_cmtpath_and_offset (cmtpath, offset);
     3499    p = Project::find_by_cmtpath (cmtpath);
     3500    return p;
     3501}
     3502
    34813503int Use::get_index () const
    34823504{
     
    42434265}
    42444266
    4245 
    4246 
    4247 
    4248 
    4249 
     4267/*---------------------------------------------------*/
    42504268Package* Package::find (const cmt_string& name)
    42514269{
     
    42594277}
    42604278
     4279/*---------------------------------------------------*/
    42614280Package* Package::add (const cmt_string& name)
    42624281{
     
    42934312}
    42944313
     4314/*---------------------------------------------------*/
    42954315Package::PackageVector& Package::packages ()
    42964316{
     
    43014321}
    43024322
     4323/*---------------------------------------------------*/
    43034324Package::PackageMap& Package::package_map ()
    43044325{
     
    43094330}
    43104331
     4332/*---------------------------------------------------*/
    43114333void Package::clear_all ()
    43124334{
     
    43184340}
    43194341
     4342/*---------------------------------------------------*/
    43204343Package::Package () : m_is_cmt (false)
    43214344{
     
    43264349}
    43274350
     4351/*---------------------------------------------------*/
    43284352Package::~Package ()
    43294353{
     
    43314355}
    43324356
     4357/*---------------------------------------------------*/
    43334358const cmt_string& Package::get_name () const
    43344359{
     
    43364361}
    43374362
     4363/*---------------------------------------------------*/
    43384364void Package::add_use (Use* use)
    43394365{
     
    43474373}
    43484374
     4375/*---------------------------------------------------*/
    43494376void Package::remove_use (Use* use)
    43504377{
     
    43724399}
    43734400
     4401/*---------------------------------------------------*/
    43744402Use::UsePtrVector& Package::get_uses ()
    43754403{
     
    43824410}
    43834411
     4412/*---------------------------------------------------*/
    43844413static void show_packages ()
    43854414{
     
    44184447  cout << endl;
    44194448}
    4420 
     4449/*---------------------------------------------------*/
  • CMT/HEAD/source/cmt_use.h

    r290 r291  
    6060  static void fill_macro_all (cmt_string& buffer, const cmt_string& suffix);
    6161
    62 // Private class methods
    63 private:
    6462  static Use* create (const cmt_string& path,
    6563                      const cmt_string& package,
    6664                      const cmt_string& version,
    6765                      const cmt_string& version_alias,
     66                      const cmt_string& native_version,
    6867                      const cmt_string& path_alias);
     68
     69
     70// Private class methods
     71private:
    6972
    7073// Public instance methods
     
    7982            const cmt_string& new_path,
    8083            const cmt_string& new_version_alias = "",
    81             const cmt_string& new_path_alias = "");
     84            const cmt_string& new_path_alias = "",
     85            const cmt_string& native_version = "");
    8286  void author_action (const CmtSystem::cmt_string_vector& words);
    8387  void manager_action (const CmtSystem::cmt_string_vector& words);
     
    116120  void set_package_name (const cmt_string& name);
    117121
     122  Project* get_project () const;
     123
    118124  int get_index () const;
    119125
     
    156162  IgnorePattern::IgnorePatternVector ignore_patterns;
    157163
     164
     165  UsePtrVector sub_uses;
    158166// Private methods
    159167private:
     
    191199  bool m_has_native_version;
    192200
    193   UsePtrVector sub_uses;
     201
    194202  cmt_vector<ScopeType> sub_use_scopes;
    195203  cmt_vector<State> sub_use_auto_imports;
Note: See TracChangeset for help on using the changeset viewer.