Changeset 144 for CMT/HEAD


Ignore:
Timestamp:
Feb 7, 2006, 11:01:45 AM (18 years ago)
Author:
arnault
Message:

Various fixes and message cleanups see CL 294 and 295

Location:
CMT/HEAD
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r143 r144  
     12006-02-07  Christian Arnault  <arnault@lal.in2p3.fr> 295
     2
     3        * mgr/requirements: Protect cmtpath_patterns with strategies
     4        use $(CMTCONFIG) instead of $(tag) in cmtpath_patterns
     5
     6        * source/cmt_parser.cxx (configure_cmt_path): Suppress warnings for bad paths at this stage
     7        (do_check_configuration): Add set_standard_macros for do_check_configuration
     8
     9        * source/cmt_commands.cxx (do_check): Activate warnings for check configuration and for setup
     10
     11        * source/cmt_symbol.cxx (filter_path_value): Don't kill path item when they don't exist.
     12        (action): Reset all_sets_done at each symbol definition.
     13        (all_set): Protect against internal recursivity
     14        (all_print): Print path settings here.
     15        (check_all_paths): Add a new function to check all paths.
     16        (SetBuilder::build): suppress detetion of overridings from here (move to SymbolValueList::show)
     17        (PathBuilder::build): suppress detetion of overridings from here (move to SymbolValueList::show)
     18        (MacroBuilder::build): suppress detetion of overridings from here (move to SymbolValueList::show)
     19        (ActionBuilder::build): suppress detetion of overridings from here (move to SymbolValueList::show)
     20        (SymbolValueList::show): Keep reset to null actions
     21        Print overridings
     22
     23        * source/cmt_system.cxx: Add include cmt_map.h for putenv management
     24        (class CMTPathManager): Suppress generation of an error when the CMTPATH item does not exist
     25
     262006-02-06  Christian Arnault  <arnault@lal.in2p3.fr> 294
     27
     28        * source/cmt_cvs.cxx (class CvsImplementation): Uses the new CmtSystem::putenv API
     29
     30        * source/cmt_symbol.cxx (all_set): Uses the new CmtSystem::putenv API to fix setup problems
     31
     32        * source/cmt_system.h (class CmtSystem): Modifying the API of the internal putenv function
     33
     34        * source/cmt_system.cxx (putenv): Replacing the old putenv implementation with a new one using a static map
     35        of all used environment variables so as to ensure a stable string
     36
    1372006-01-31    <arnault@lal.in2p3.fr> 293
    238
  • CMT/HEAD/mgr/cmt_dependencies.make

    r79 r144  
    1010cmt_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
    1111cmt_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
     12cmt_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
    1313cmt_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
    1414cmt_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
  • CMT/HEAD/mgr/requirements

    r139 r144  
    656656
    657657cmtpath_pattern \
    658   macro cmt_installarea_paths "$(cmt_installarea_prefix)/$(tag)/bin" ; \
    659   macro_append cmt_installarea_paths " $(cmt_installarea_prefix)/$(tag)/lib" ; \
    660   macro_append cmt_installarea_paths " $(cmt_installarea_prefix)/share/lib" ; \
    661   macro_append cmt_installarea_paths " $(cmt_installarea_prefix)/share/bin" ; \
    662   macro_prepend use_linkopts   " $(cmt_installarea_linkopts) " ; \
    663   macro_append shlibbuilder    " $(cmt_installarea_linkopts) "
     658  macro cmt_installarea_paths "$(cmt_installarea_prefix)/$(CMTCONFIG)/bin"
     659
     660cmtpath_pattern \
     661  macro_append cmt_installarea_paths "" <project>_with_installarea " $(<project>_installarea_prefix)/$(CMTCONFIG)/lib" ; \
     662  macro_append cmt_installarea_paths "" <project>_with_installarea " $(<project>_installarea_prefix)/share/lib" ; \
     663  macro_append cmt_installarea_paths "" <project>_with_installarea " $(<project>_installarea_prefix)/share/bin" ; \
     664  macro_prepend use_linkopts         "" <project>_with_installarea " $(<project>_installarea_linkopts) " ; \
     665  macro_append shlibbuilder          "" <project>_with_installarea " $(<project>_installarea_linkopts) "
    664666
    665667macro CMT_PATH_remove_regexp "/[^/]*/" WIN32 "\\[^\\]*\\"
     
    675677  path_remove_regexp CLASSPATH "" <project>_with_installarea "$(<project>_installarea_prefix_remove)$(CMT_PATH_remove_share_regexp)bin$"
    676678
     679
    677680cmtpath_pattern \
    678681  path_prepend PATH "" \
    679                <project>_with_installarea&WIN32 "<path>/$(<project>_installarea_prefix)/${tag}/bin" \
    680                <project>_with_installarea&Unix "<path>/$(<project>_installarea_prefix)/${tag}/bin" ; \
     682               <project>_with_installarea&WIN32 "<path>/$(<project>_installarea_prefix)/${CMTCONFIG}/bin" \
     683               <project>_with_installarea&Unix "<path>/$(<project>_installarea_prefix)/${CMTCONFIG}/bin" ; \
    681684  path_prepend PATH "" \
    682                <project>_with_installarea&WIN32 "<path>/$(<project>_installarea_prefix)/${tag}/lib" \
    683                <project>_with_installarea&CYGWIN "<path>/$(<project>_installarea_prefix)/${tag}/lib" ; \
     685               <project>_with_installarea&WIN32 "<path>/$(<project>_installarea_prefix)/${CMTCONFIG}/lib" \
     686               <project>_with_installarea&CYGWIN "<path>/$(<project>_installarea_prefix)/${CMTCONFIG}/lib" ; \
    684687  path_prepend LD_LIBRARY_PATH "" \
    685                <project>_with_installarea&Unix "<path>/$(<project>_installarea_prefix)/${tag}/lib" ; \
     688               <project>_with_installarea&Unix "<path>/$(<project>_installarea_prefix)/${CMTCONFIG}/lib" ; \
    686689  path_prepend CLASSPATH "" <project>_with_installarea "<path>/$(<project>_installarea_prefix)/share/lib" ; \
    687690  path_prepend CLASSPATH "" <project>_with_installarea "<path>/$(<project>_installarea_prefix)/share/bin" ; \
    688691  macro_prepend cmt_installarea_linkopts "" \
    689692                <project>_without_installarea "" \
    690                 <project>_with_installarea&Unix " -L<path>/$(<project>_installarea_prefix)/$(tag)/lib " \
    691                 <project>_with_installarea&WIN32 " /LIBPATH:<path>\$(<project>_installarea_prefix)\$(tag)\lib "
     693                <project>_with_installarea&Unix " -L<path>/$(<project>_installarea_prefix)/$(CMTCONFIG)/lib " \
     694                <project>_with_installarea&WIN32 " /LIBPATH:<path>\$(<project>_installarea_prefix)\$(CMTCONFIG)\lib "
    692695
    693696set NEWCMTCONFIG "${cmt_hardware}-${cmt_system_version}-${cmt_compiler_version}"
  • CMT/HEAD/source/cmt_commands.cxx

    r109 r144  
    689689        {
    690690          cmt.m_action = action_check_configuration;
     691          cmt.m_warnings = true;
    691692        }
    692693      else if (arg == "files")
     
    11081109{
    11091110  cmt.m_action = action_setup;
     1111  cmt.m_warnings = true;
    11101112}
    11111113
  • CMT/HEAD/source/cmt_cvs.cxx

    r101 r144  
    10181018    static cmt_string CMTPATH;
    10191019
    1020     cmt_string cmtpath = CmtSystem::getenv ("CMTPATH");
     1020    cmt_string cmtpath = Symbol::get_env_value ("CMTPATH");
    10211021
    10221022    if (cmtpath.find (dir) == cmt_string::npos)
    10231023      {
    1024         CMTPATH = "CMTPATH=";
    1025         CMTPATH += dir;
     1024        CMTPATH = dir;
    10261025        CMTPATH += ":";
    10271026        CMTPATH += cmtpath;
    1028        
    1029         CmtSystem::putenv (CMTPATH);
     1027
     1028        CmtSystem::putenv ("CMTPATH", CMTPATH);
    10301029      }
    10311030
  • CMT/HEAD/source/cmt_parser.cxx

    r141 r144  
    565565  cmt_string s;
    566566
    567   /*
    568   Symbol* symbol = Symbol::find ("CMTPATH");
    569   if (symbol != 0)
    570     {
    571       bool show_set_hidden = false;
    572 
    573       if (Me.m_action == action_show_set)
    574         {
    575           show_set_hidden = true;
    576           Me.m_action = action_none;
    577         }
    578 
    579       s = symbol->build_macro_value ();
    580       Symbol::expand (s);
    581 
    582       if (show_set_hidden)
    583         {
    584           show_set_hidden = false;
    585           Me.m_action = action_show_set;
    586         }
    587     }
    588   else
    589     {
    590       s = CmtSystem::getenv ("CMTPATH");
    591     }
    592   */
    593 
    594567  s = Symbol::get_env_value ("CMTPATH");
    595568
    596569  {
    597570    bool q = Me.m_quiet;
    598     bool w = Me.m_warnings;
    599571    Me.m_quiet = true; 
    600     Me.m_warnings = true; 
    601572    Symbol::filter_path_value ("CMTPATH", s);
    602     Me.m_warnings = w; 
    603573    Me.m_quiet = q;
    604574  }
     
    19621932  Tag* tag;
    19631933
     1934  set_standard_macros ();
     1935
    19641936  static CmtSystem::cmt_string_vector tags;
    19651937
     
    19791951    }
    19801952
     1953  Symbol::check_all_paths ();
     1954
    19811955  env = CmtSystem::getenv ("CMTSITE");
    19821956  if (env == "")
     
    19951969      cerr << "#CMT> The CMTSITE value " << env << " is not used in any tag expression. Please check spelling" << endl;
    19961970    }
     1971
    19971972}
    19981973
     
    40123987              IProjectFactory& factory = ProjectFactory::instance ();
    40133988              factory.create_project ("", pwd, "CurrentProject", 0);
    4014 
    4015               /*
    4016               cmt_string temp = "path_prepend CMTPATH \"";
    4017               temp += pwd;
    4018               temp += "\"";
    4019              
    4020               Use& use = Use::current();
    4021 
    4022               SyntaxParser::parse_requirements_line (temp, &use);
    4023               */
    40243989
    40253990              break;
     
    51915156    case action_unlock :
    51925157      // case action_version :
    5193       reach_current_package ();
    5194       use_user_context_requirements ();
     5158      {
     5159        bool w = Me.m_warnings;
     5160        Me.m_warnings = false;
     5161        reach_current_package ();
     5162        use_user_context_requirements ();
     5163        Me.m_warnings = w;
     5164      }
    51955165      break;
    51965166    default:
     
    75367506
    75377507  Me.m_recursive = true;
    7538   Me.m_debug = false;
     7508  //Me.m_debug = false;
    75397509  use = Use::add (Me.m_default_path, "CMT", Me.m_cmt_version, "", "", 0);
    75407510  Me.m_recursive = recursive_copy;
  • CMT/HEAD/source/cmt_symbol.cxx

    r136 r144  
    876876          if (Cmt::get_warnings ())
    877877            {
    878               cerr << "#CMT> Warning: Wrong " << name << " item " << t << endl;
     878              cout << "#CMT> Warning: Wrong path item " << t << " in " << name << endl;
    879879            }
    880            
    881           t = "";
    882880        }
    883881    }
     
    975973      const cmt_string& default_value = words[2];
    976974
     975      Cmt::reset_all_sets_done ();
     976
    977977      if (Cmt::get_debug ())
    978978        {
     
    13011301  //cerr << "all_set" << endl;
    13021302
     1303  static bool running = false;
     1304
     1305
    13031306  if (Cmt::get_debug ())
    13041307    {
    1305       cout << "Symbol::all_set> done" << Cmt::get_all_sets_done () << endl;
     1308      cout << "\nSymbol::all_set> done=" << running << endl;
    13061309    }
    13071310
    13081311  if (Cmt::get_all_sets_done ()) return;
    13091312
     1313  if (running) return;
     1314
     1315  running = true;
    13101316  Cmt::set_all_sets_done ();
    13111317
     
    13131319  Use::UsePtrVector& Uses = Use::get_ordered_uses ();
    13141320
    1315   static CmtSystem::cmt_string_vector envs;
    1316 
    1317   envs.clear ();
    1318 
    13191321  int number;
    13201322
    13211323  if (Symbols.size () == 0)
    13221324    {
    1323         //running = false;
     1325      running = false;
    13241326      return;
    13251327    }
     
    13361338      if (value != "")
    13371339        {
    1338           cmt_string& temp = envs.add ();
    1339 
    1340           temp = symbol.name;
    1341           temp += '=';
    1342           temp += value;
     1340          Symbol::expand (value);
     1341
     1342          CmtSystem::putenv (symbol.name, value);
    13431343        }
    13441344    }
     
    13601360          if (use.get_strategy ("SetupConfig"))
    13611361            {
    1362               cmt_string& temp = envs.add ();
     1362              cmt_string temp;
    13631363
    13641364              temp = use.prefix;
    1365               temp += "CONFIG=";
    1366               temp += cmtconfig;
     1365              temp += "CONFIG";
     1366
     1367              CmtSystem::putenv (temp, cmtconfig);
    13671368            }
    13681369
    13691370          if (use.get_strategy ("SetupRoot"))
    13701371            {
    1371               cmt_string& temp = envs.add ();
     1372              cmt_string temp;
    13721373
    13731374              temp = use.prefix;
    1374               temp += "ROOT=";
    1375               temp += use.get_full_path ();
     1375              temp += "ROOT";
     1376
     1377              CmtSystem::putenv (temp, use.get_full_path ());
    13761378            }
    13771379        }
     
    13851387        if (use.get_strategy ("SetupConfig"))
    13861388          {
    1387             cmt_string& temp = envs.add ();
    1388            
     1389            cmt_string temp;
     1390
    13891391            temp = use.prefix;
    1390             temp += "CONFIG=";
    1391             temp += cmtconfig;
     1392            temp += "CONFIG";
     1393
     1394            CmtSystem::putenv (temp, cmtconfig);
    13921395          }
    13931396       
    13941397        if (use.get_strategy ("SetupRoot"))
    13951398          {
    1396             cmt_string& temp = envs.add ();
    1397            
     1399            cmt_string temp;
     1400
    13981401            temp = use.prefix;
    1399             temp += "ROOT=";
    1400             temp += use.get_full_path ();
     1402            temp += "ROOT";
     1403
     1404            CmtSystem::putenv (temp, use.get_full_path ());
    14011405          }
    14021406      }
     
    14151419          filter_path_value (symbol.name, value);
    14161420
    1417           cmt_string& temp = envs.add ();
    1418 
    1419           temp = symbol.name;
    1420           temp += '=';
    1421           temp += value;
     1421#ifdef WIN32
     1422          value.replace_all ("/", "\\");
     1423#endif
     1424
     1425          if (Cmt::get_debug ())
     1426            {
     1427              cerr << "Symbol::all_set-2> " << symbol.name << " = " << value << endl;
     1428            }
     1429
     1430          CmtSystem::putenv (symbol.name, value);
    14221431        }
    14231432    }
    14241433
    1425   for (number = 0; number < envs.size (); number++)
    1426     {
    1427       cmt_string& env = envs[number];
    1428       Symbol::expand (env);
    1429 
    1430 #ifdef WIN32
    1431       env.replace_all ("/", "\\");
    1432 #endif
    1433 
    1434       if (Cmt::get_debug ())
    1435         {
    1436           cout << "Symbol::all_set> " << env << endl;
    1437         }
    1438       CmtSystem::putenv (env);
    1439     }
    1440 
    1441     //running = false;
     1434  running = false;
    14421435}
    14431436
     
    14571450      if ((symbol.type == SymbolSet) ||
    14581451          (symbol.type == SymbolAlias) ||
    1459           (symbol.type == SymbolSetupScript))
     1452          (symbol.type == SymbolSetupScript) ||
     1453          (symbol.type == SymbolPath))
    14601454        {
    14611455          if (symbol.print (mode))
     
    14731467        }
    14741468    }
     1469}
     1470
     1471//-------------------------------------------------------------
     1472void Symbol::check_all_paths ()
     1473{
     1474  static SymbolVector& Symbols = symbols ();
     1475
     1476  int number;
     1477
     1478  if (Symbols.size () == 0) return;
    14751479
    14761480  for (number = 0; number < Symbol::symbol_number (); number++)
     
    14781482      Symbol& symbol = Symbol::symbol (number);
    14791483
    1480       if ((symbol.type != SymbolPath)) continue;
    1481 
    1482       if (symbol.print (mode))
    1483         {
    1484           if (mode == Bat)
    1485             {
    1486               cout << endl;
    1487             }
    1488           else
    1489             {
    1490               //cout << "; ";
    1491               cout << endl;
    1492             }
     1484      if (symbol.type == SymbolPath)
     1485        {
     1486          cmt_string temp;
     1487
     1488          temp = symbol.build_macro_value ();
     1489          expand (temp);
     1490
     1491          Symbol::filter_path_value (symbol.name, temp);
    14931492        }
    14941493    }
     
    19401939
    19411940  bool first_definition = true;
    1942   bool defined = false;
    19431941
    19441942  for (int i = 0; i < symbol.value_lists.size (); i++)
     
    19841982              {
    19851983                temp = CmtSystem::getenv (symbol.name);
    1986               }
    1987 
    1988             if (!defined)
    1989               {
    1990                 defined = true;
    1991               }
    1992             else
    1993               {
    1994                 if ((!Cmt::get_quiet ()) &&
    1995                     ((action == action_show_macro) ||
    1996                      (action == action_show_set) ||
    1997                      (action == action_show_action) ||
    1998                      (action == action_show_macros) ||
    1999                      (action == action_show_sets) ||
    2000                      (action == action_show_actions)))
    2001                   {
    2002                     cerr << "#CMT> Warning: Symbol " << symbol.name << " overridden";
    2003 
    2004                     if (value_list.use != 0)
    2005                       {
    2006                         cerr << " in package " << value_list.use->get_package_name ();
    2007                       }
    2008 
    2009                     cerr << endl;
    2010                   }
    20111984              }
    20121985
     
    21462119
    21472120  bool first_definition = true;
    2148   bool defined = false;
    21492121
    21502122  for (int i = 0; i < symbol.value_lists.size (); i++)
     
    21822154                resolve_value (new_value, symbol.name, temp);
    21832155                temp = new_value;
    2184 
    2185                 if (!defined)
    2186                   {
    2187                     defined = true;
    2188                   }
    2189                 else
    2190                   {
    2191                     if ((!Cmt::get_quiet ()) &&
    2192                         ((action == action_show_macro) ||
    2193                          (action == action_show_set) ||
    2194                          (action == action_show_action) ||
    2195                          (action == action_show_macros) ||
    2196                          (action == action_show_sets) ||
    2197                          (action == action_show_actions)))
    2198                       {
    2199                         cerr << "#CMT> Warning: Symbol " << symbol.name << " overridden";
    2200                        
    2201                         if (value_list.use != 0)
    2202                           {
    2203                             cerr << " in package " << value_list.use->get_package_name ();
    2204                           }
    2205                        
    2206                         cerr << endl;
    2207                       }
    2208                   }
    22092156              }
    22102157
     
    24952442
    24962443  bool first_definition = true;
    2497   bool defined = false;
    24982444
    24992445  for (i = 0; i < symbol.value_lists.size (); i++)
     
    25572503        {
    25582504          temp = value.text;
    2559 
    2560           if (!defined)
    2561             {
    2562               defined = true;
    2563             }
    2564           else
    2565             {
    2566               /*
    2567               if ((!Cmt::get_quiet ()) &&
    2568                   ((action == action_show_macro) ||
    2569                    (action == action_show_set) ||
    2570                    (action == action_show_action) ||
    2571                    (action == action_show_macros) ||
    2572                    (action == action_show_sets) ||
    2573                    (action == action_show_actions)))
    2574                 {
    2575                   cerr << "#CMT> Warning: Symbol " << symbol.name << " overridden";
    2576                  
    2577                   if (value_list.use != 0)
    2578                     {
    2579                       cerr << " in package " << value_list.use->get_package_name ();
    2580                     }
    2581 
    2582                   cerr << endl;
    2583                 }
    2584               */
    2585             }
    25862505        }
    25872506    }
     
    27392658
    27402659  bool first_definition = true;
    2741   bool defined = false;
    27422660
    27432661  temp = "";
     
    27712689        {
    27722690          temp = value.text;
    2773 
    2774           if (!defined)
    2775             {
    2776               defined = true;
    2777             }
    2778           else
    2779             {
    2780               if ((!Cmt::get_quiet ()) &&
    2781                   ((action == action_show_macro) ||
    2782                    (action == action_show_set) ||
    2783                    (action == action_show_action) ||
    2784                    (action == action_show_macros) ||
    2785                    (action == action_show_sets) ||
    2786                    (action == action_show_actions)))
    2787                 {
    2788                   cerr << "#CMT> Warning: Symbol " << symbol.name << " overridden";
    2789                  
    2790                   if (value_list.use != 0)
    2791                     {
    2792                       cerr << " in package " << value_list.use->get_package_name ();
    2793                     }
    2794 
    2795                   cerr << endl;
    2796                 }
    2797             }
    27982691        }
    27992692    }
     
    28922785  ActionType action = Cmt::get_action ();
    28932786
    2894   if (value.text == "") return;
     2787  switch (command_type)
     2788    {
     2789      //case CommandSet :
     2790      case CommandSetAppend :
     2791      case CommandSetPrepend :
     2792      case CommandSetRemove :
     2793      case CommandSetRemoveRegexp :
     2794        //case CommandAlias :
     2795        //case CommandPath :
     2796      case CommandPathAppend :
     2797      case CommandPathPrepend :
     2798      case CommandPathRemove :
     2799      case CommandPathRemoveRegexp :
     2800      case CommandMacroPrepend :
     2801        //case CommandMacro :
     2802      case CommandMacroAppend :
     2803      case CommandMacroRemove :
     2804      case CommandMacroRemoveRegexp :
     2805      case CommandMacroRemoveAll :
     2806      case CommandMacroRemoveAllRegexp :
     2807        //case CommandAction :
     2808        if (value.text == "") return;
     2809        break;
     2810    }
    28952811
    28962812  if (discarded) discarded_text = " (discarded by override)";
  • CMT/HEAD/source/cmt_symbol.h

    r136 r144  
    8989  static void all_print (PrintMode mode);
    9090  static void all_print_clean (PrintMode mode);
     91  static void check_all_paths ();
    9192
    9293  static int symbol_number ();
  • CMT/HEAD/source/cmt_system.cxx

    r141 r144  
    5757#include "cmt_system.h"
    5858#include "cmt_error.h"
     59#include "cmt_map.h"
    5960
    6061//--------------------------------------------------
     
    9495        {
    9596#ifdef USE_PWD
    96           new_dir = "PWD=";
    97           new_dir += dir;
     97          new_dir = dir;
    9898          new_dir += file_separator ();
    99           putenv (new_dir);
     99          putenv ("PWD", new_dir);
    100100#endif
    101101
     
    109109        {
    110110#ifdef USE_PWD
    111           new_dir = "PWD=";
    112           new_dir += dir;
    113           putenv (new_dir);
     111          putenv ("PWD", dir);
    114112#endif
    115113
     
    12221220}
    12231221
    1224 //----------------------------------------------------------
    1225 bool CmtSystem::putenv (const cmt_string& name_value)
    1226 {
    1227   int status = ::putenv ((char*) name_value.c_str ());
    1228 
    1229   if (status == 0) return (true);
    1230   else return (false);
     1222/**
     1223   Implementation based on a local static map of used environment
     1224variables to ensure a stable character string. The OS requires
     1225that the character string sent via a putenv is kept untouched forever
     1226 */
     1227bool CmtSystem::putenv (const cmt_string& name, const cmt_string& value)
     1228{
     1229  static cmt_map <cmt_string, cmt_string> envs;
     1230
     1231  if (!envs.has (name))
     1232    {
     1233      cmt_string& v = *(new cmt_string);
     1234      v = name;
     1235      v += "=";
     1236      v += value;
     1237      envs.add (name, v);
     1238    }
     1239  else
     1240    {
     1241      cmt_string& v = *(envs.find (name));
     1242      v = name;
     1243      v += "=";
     1244      v += value;
     1245    }
     1246
     1247  {
     1248    const cmt_string& v = *envs.find (name);
     1249    //cerr << "#CmtSystem::putenv> name=" << name << " &v=" << &v << endl;
     1250
     1251    int status = ::putenv ((char*) v.c_str ());
     1252
     1253    if (status == 0) return (true);
     1254    else return (false);
     1255  }
     1256
    12311257}
    12321258
     
    12961322      }
    12971323   
    1298     cerr << "adding npath=[" << npath << "]" << endl;
     1324    //cerr << "adding npath=[" << npath << "]" << endl;
    12991325   
    13001326    if (npath != "")
    13011327      {
    1302         if (!CmtSystem::test_directory (npath))
    1303           {
    1304             cerr << "#CMT> Warning: path " << npath << " doesn't exist" << endl;
    1305             CmtError::set (CmtError::path_not_found, npath);
    1306             return;
    1307           }
    1308 
    13091328        cmt_string project_name;
    13101329
  • CMT/HEAD/source/cmt_system.h

    r18 r144  
    110110  static bool testenv (const cmt_string& name);
    111111  static cmt_string getenv (const cmt_string& name);
    112   static bool putenv (const cmt_string& name_value);
     112  static bool putenv (const cmt_string& name, const cmt_string& value);
    113113  static void get_cmt_paths (IProjectFactory& factory,
    114114                             const cmt_string& init_text,
Note: See TracChangeset for help on using the changeset viewer.