Changeset 568 for CMT/HEAD


Ignore:
Timestamp:
Apr 20, 2011, 4:28:57 PM (13 years ago)
Author:
rybkin
Message:

See C.L. 451

Location:
CMT/HEAD
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r567 r568  
     12011-04-20    <rybkin@lal.in2p3.fr> 451
     2
     3        * source/cmt_tag.h: In class Tag, in function mark, introduce mandatory
     4        argument (to pass context), introduce member m_act_context to hold context
     5        of tag activation, use package name, if available
     6        * source/cmt_tag.cxx: In function mark, implement use of introduced
     7        argument, make use of it in all function mark invocations, in functions
     8        unmark_all, restore_tree, mark, add, introduce or enhance debug messages.
     9        In function show_definition, print m_act_context with prefix "activated",
     10        if does not duplicate already printed information, to provide tag
     11        activation context in "cmt show tags" command output
     12        * source/cmt_syntax.cxx: In class SyntaxParser, in function
     13        parse_requirements, pass tag activation context to class Tag function mark
     14        via argument
     15        * source/cmt_commands.cxx: In class ArgParser, in functions do_do,
     16        option_tag, option_tag_add, option_tag_remove, idem
     17        * source/cmt_project.cxx: In class Project function order_all, in class
     18        Strategy function update, idem
     19        * source/cmt_parser.cxx: In class Cmt, in functions configure_config_tag,
     20        configure_hosttype_tag, configure_site_tag, restore_all_tags,
     21        configure_tags, configure_uname_tag, configure_devenv_tag,
     22        configure_version_tag, load, reach_current_package, use_extra_file, idem.
     23        In class Cmt, in function do_check_configuration, for standalone package,
     24        if current use is outside CMTPATH (and action is not action_setup) do not
     25        issue warning or set error
     26       
    1272011-04-18    <rybkin@lal.in2p3.fr> 450
    228
  • CMT/HEAD/source/cmt_commands.cxx

    r565 r568  
    10541054        Tag* tag;
    10551055        tag = Tag::add (tag_name, PriorityUserTag, "action", 0);                     
    1056         tag->mark ();
     1056        tag->mark ("action");
    10571057      }
    10581058
     
    20412041                         
    20422042              tag = Tag::add (a, PriorityArgument, "arguments", 0);
    2043               tag->mark ();
     2043              tag->mark ("arguments");
    20442044              cmt.m_extra_tags += a;
    20452045              cmt.m_extra_tags += ",";
     
    20792079          tag = Tag::add (a, PriorityUserTag, "arguments", 0);
    20802080                     
    2081           tag->mark ();
     2081          tag->mark ("arguments");
    20822082
    20832083          cmt.m_extra_tags += a;
     
    21712171                  //<< cmt.m_current_tag << endl;
    21722172
    2173                   tag = Tag::add (a, PriorityTag, "restore configuration", 0);
     2173                  tag = Tag::add (a, PriorityTag, "arguments", 0);
    21742174                }
    21752175              else
    21762176                {
    2177                   tag = Tag::add (a, PriorityUserTag, "restore configuration", 0);
     2177                  tag = Tag::add (a, PriorityUserTag, "arguments", 0);
    21782178                }
    21792179
    2180               tag->mark ();
     2180              tag->mark ("arguments");
    21812181          }
    21822182}
  • CMT/HEAD/source/cmt_parser.cxx

    r567 r568  
    613613
    614614      tag = Tag::add (Me.m_cmt_config, PriorityConfig, "CMTCONFIG", 0);
    615       tag->mark ();
     615      tag->mark ("CMTCONFIG");
    616616    }
    617617}
     
    12301230
    12311231      tag = Tag::add (hosttype, PriorityUname, "HOSTTYPE", 0);
    1232       tag->mark ();
     1232      tag->mark ("HOSTTYPE");
    12331233    }
    12341234}
     
    12511251    {
    12521252      cmt_string s = "CMTSITE";
     1253      cmt_string t = s;
    12531254
    12541255      if (use != 0)
    12551256        {
    1256           s += " in ";
     1257          //s += " in ";
     1258          t = use->get_package_name ();
    12571259        }
    12581260
     
    12601262
    12611263      tag = Tag::add (Me.m_cmt_site, PrioritySite, s, use);
    1262       tag->mark ();
     1264      tag->mark (t);
    12631265    }
    12641266}
     
    12781280    {
    12791281      cmt_string s = "CMTEXTRATAGS";
     1282      cmt_string t = s;
    12801283
    12811284      if (use != 0)
    12821285        {
    1283           s += " in ";
     1286          //s += " in ";
     1287          t = use->get_package_name ();
    12841288        }
    12851289
     
    13021306          tag = Tag::add (a, PriorityUserTag, s, use);
    13031307         
    1304           tag->mark ();
     1308          tag->mark (t);
    13051309        }
    13061310    }
     
    13531357
    13541358  cmt_string s = "CMTCONFIG";
     1359  cmt_string t = s;
    13551360
    13561361  if (use != 0)
    13571362    {
    1358       s += " in ";
    1359     }
    1360 
     1363      //s += " in ";
     1364      t = use->get_package_name ();
     1365    }
     1366 
    13611367  Tag* tag;
    13621368
    13631369  tag = Tag::add (config_tag, PriorityConfig, s, use);
    1364   tag->mark ();
     1370  tag->mark (t);
    13651371
    13661372  //Me.m_current_tag = config_tag;
     
    13791385
    13801386      tag = Tag::add (uname, PriorityUname, "uname", 0);
    1381       tag->mark ();
     1387      tag->mark ("uname");
    13821388    }
    13831389}
     
    14441450
    14451451      tag = Tag::add (devenv, PriorityUname, "devenv", 0);
    1446       tag->mark ();
     1452      tag->mark ("devenv");
    14471453    }
    14481454}
     
    14641470
    14651471  tag = Tag::add (temp, PriorityVersion, "CMTVERSION", 0);
    1466   tag->mark ();
     1472  tag->mark ("CMTVERSION");
    14671473
    14681474  sprintf (temp, "CMTr%d", r);
    14691475
    14701476  tag = Tag::add (temp, PriorityVersion, "CMTVERSION", 0);
    1471   tag->mark ();
     1477  tag->mark ("CMTVERSION");
    14721478
    14731479  sprintf (temp, "CMTp%d", p);
    14741480
    14751481  tag = Tag::add (temp, PriorityVersion, "CMTVERSION", 0);
    1476   tag->mark ();
     1482  tag->mark ("CMTVERSION");
    14771483
    14781484}
     
    27092715    {
    27102716      if (action_setup != get_action () &&
     2717          none_style != use.style &&
    27112718          0 == Project::find_in_cmt_paths (use.real_path).size ())
    27122719        {
     
    60136020
    60146021      tag = Tag::add (tag_name, PriorityTag, "load", 0);
    6015       tag->mark ();
     6022      tag->mark ("load");
    60166023    }
    60176024
     
    61776184
    61786185          tag = Tag::add (env, PriorityConfig, "load", 0);
    6179           tag->mark ();
     6186          tag->mark ("load");
    61806187          Me.m_current_tag = env;
    61816188
     
    78367843
    78377844          tag = Tag::add (env, PriorityConfig, "reach current package", 0);
    7838           tag->mark ();
     7845          tag->mark (use.get_package_name ());
    78397846          //Me.m_current_tag = env;
    78407847
     
    79747981
    79757982          tag = Tag::add (env, PriorityConfig, "reach current package", 0);
    7976           tag->mark ();
     7983          tag->mark (use.get_package_name ());
    79777984          //Me.m_current_tag = env;
    79787985
  • CMT/HEAD/source/cmt_project.cxx

    r565 r568  
    10291029         
    10301030          tag = Tag::add (p.get_name (), PriorityConfig, "PROJECT", 0);
    1031           tag->mark ();
     1031          tag->mark ("PROJECT");
    10321032        }
    10331033      else if (p.is_current ())
     
    33393339
    33403340  m_off_tag->unmark ();
    3341   m_on_tag->mark ();
     3341  m_on_tag->mark ("PROJECT");
    33423342}
    33433343
  • CMT/HEAD/source/cmt_syntax.cxx

    r561 r568  
    14711471            {
    14721472              cmt_string name ("container_package");
    1473               cmt_string context ("PROJECT " + p->get_name () + " ");
     1473              cmt_string context (p->get_name ());
    14741474              Tag* tag = Tag::find (name);
    14751475              if (tag == 0)
     
    14771477                  tag = Tag::add (name, PriorityUserTag, context, use);
    14781478                }
    1479               tag->mark ();
     1479              tag->mark (use->get_package_name());
    14801480            }
    14811481        }                 
  • CMT/HEAD/source/cmt_tag.cxx

    r549 r568  
    3636  m_selected = false;
    3737  m_def_use = 0;
     38  //m_act_context = "";
    3839}
    3940
     
    4445
    4546  int tag_number;
     47
     48  Log;
     49  log << "Unmarking all tags (" << vector.size () << ")" << log_endl;
    4650
    4751  for (tag_number = 0; tag_number < vector.size (); tag_number++)
     
    6266
    6367  int tag_number;
     68
     69  Log;
     70  log << "Restore tags tree (" << vector.size () << ")" << log_endl;
    6471
    6572  for (tag_number = 0; tag_number < vector.size (); tag_number++)
     
    7784                  Tag* ref = tag->m_tag_refs[number];
    7885                 
    79                   ref->mark ();
     86                  ref->mark ("");
    8087                }
    8188            }
     
    8592
    8693/*----------------------------------------------------------*/
    87 void Tag::mark ()
     94void Tag::mark (const cmt_string& context)
     95//void Tag::mark ()
    8896{
    8997  if (!is_primary ()) return;
     
    130138
    131139  m_selected = true;
    132 
    133   log << "Marking tag[" << this << "] " << m_name << " p=" << m_priority << log_endl;
     140  if (context.size () != 0)
     141    m_act_context = context;
     142
     143  log << "Marking tag[" << this << "] " << m_name << " p=" << m_priority
     144      << " context=" << context << log_endl;
    134145
    135146  if (m_tag_refs.size () > 0)
     
    141152          Tag* ref = m_tag_refs[number];
    142153
    143           ref->mark ();
     154          ref->mark (context);
    144155        }
    145156    }
     
    181192      if (tag->is_selected ())  // it was previously selected
    182193        {
    183           ref->mark ();
     194          ref->mark (use ? use->get_package_name () : "");
    184195        }
    185196    }
     
    219230        }
    220231
    221       tag->mark ();
     232      tag->mark (use ? use->get_package_name () : "");
    222233    }
    223234}
     
    434445        }
    435446
    436       log << "re-adding tag[" << tag << "] " << name << " p=" << priority << log_endl;
    437 
     447      log << "re-adding tag[" << tag << "] " << name << " p=" << priority
     448          << " context=" << context << (use != 0 ? " " + use->get_info () : "") << log_endl;
     449     
    438450      return (tag);
    439451    }
     
    444456  map.add (name, tag_object);
    445457
    446   log << "adding tag[" << tag << "] " << name << " p=" << priority << log_endl;
    447 
     458  log << "adding tag[" << tag << "] " << name << " p=" << priority
     459      << " context=" << context << (use != 0 ? " " + use->get_info () : "") << log_endl;
     460 
    448461  tag->clear ();
    449462
     
    601614  m_def_use (0),
    602615  m_set_use (0),
     616  m_act_context (""),
    603617  m_priority (0)
    604618{
     
    619633  m_def_use = other.m_def_use;
    620634  m_set_use = other.m_set_use;
     635  m_act_context = other.m_act_context;
    621636  m_ref_uses = other.m_ref_uses;
    622637  m_priority = other.m_priority;
     
    636651  m_def_use = other.m_def_use;
    637652  m_set_use = other.m_set_use;
     653  m_act_context = other.m_act_context;
    638654  m_ref_uses = other.m_ref_uses;
    639655  m_priority = other.m_priority;
     
    656672  m_def_use = 0;
    657673  m_set_use = 0;
     674  m_act_context = "";
    658675  m_ref_uses.clear ();
    659676  m_context = "";
     
    742759            {
    743760              out << " (from ";
    744               if (m_context != "use") out << m_context;
     761              if (m_context != "use") out << m_context + " in ";
    745762              out << "package " << m_def_use->get_package_name () << ")";
    746763            }
     
    806823          out << "]";
    807824        }
     825      if (m_act_context.size () != 0 &&
     826          (m_def_use != 0 &&
     827           m_act_context != m_context &&
     828           m_act_context != m_def_use->get_package_name () ||
     829           m_def_use == 0 &&
     830           m_act_context != m_context))
     831        out << " activated " << m_act_context;
    808832    }
    809833  out << endl;
  • CMT/HEAD/source/cmt_tag.h

    r549 r568  
    5151  void add_ref_use (Use* use);
    5252  void unmark ();
    53   void mark ();
     53  void mark (const cmt_string& context);
     54  //void mark ();
    5455  void show_definition (bool quiet, ostream& out = cout,
    5556                        const cmt_string& prefix = "") const;
     
    7475  Use* m_def_use;
    7576  Use* m_set_use;
     77  cmt_string m_act_context;
    7678  Use::UsePtrVector m_ref_uses;
    7779  int m_priority;
Note: See TracChangeset for help on using the changeset viewer.