Changeset 102


Ignore:
Timestamp:
Oct 18, 2005, 9:36:54 AM (19 years ago)
Author:
arnault
Message:

Fixes see CL288

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r101 r102  
     12005-10-18    <arnault@lal.in2p3.fr> 288
     2
     3        * source/cmt_symbol.cxx (print): Filter path values before
     4        setting them externally
     5
     6        * source/cmt_symbol.cxx (all_set): Filter path values before
     7        setting them internally
     8
     9        * source/cmt_parser.cxx (configure_cmt_path): Filter out CMTPATH
     10        before creating or updating projects from the CMTPATH value
     11
     12        * source/cmt_symbol.h (class Symbol): Add a static function to
     13        filter out faulty items in a PATH symbol
     14
    1152005-10-17    <arnault@lal.in2p3.fr> 287
    216
    3         * source/cmt_cvs.cxx (class CvsImplementation): Protect agains
     17        * mgr/Makefile (cmtexe): Use -quiet option whenever using cmt
     18        within the Makefile of CMT
     19
     20        * source/cmt_cvs.cxx (class CvsImplementation): Protect against
    421        empty protocol level (for backward compatibility)
    522
  • CMT/HEAD/mgr/Makefile

    r92 r102  
    124124
    125125cmt_dependencies.make $(bin)/cmt_dependencies.make : $(cmtexe)
    126         $(cmtexe) build dependencies cmt -all_sources -no_stamps
     126        $(cmtexe) -quiet build dependencies cmt -all_sources -no_stamps
    127127        cp $(bin)/cmt_dependencies.make ../mgr
    128         $(cmtexe) build dependencies cmt -all_sources
     128        $(cmtexe) -quiet build dependencies cmt -all_sources
    129129
    130130#---------------------------------------------------------
     
    252252#----------------------------------------------------------
    253253rpm ::
    254         version=`$(cmtexe) version`; \
     254        version=`$(cmtexe) -quiet version`; \
    255255        tempdir=/tmp/CMT; \
    256256        rm -rf $${tempdir}; \
     
    302302        @echo "  Creating all $(demo_sequence) packages..."
    303303        cd $(demo_location); \
    304         version=`$(cmtexe) version`; \
    305         ($(cmtexe) run_sequence ${CMTROOT}/src/demo/$(demo_sequence).cmt | \
     304        version=`$(cmtexe) -quiet version`; \
     305        ($(cmtexe) -quiet run_sequence ${CMTROOT}/src/demo/$(demo_sequence).cmt | \
    306306          sed -e "s#$${CMTROOT}#"'$${CMTROOT}'"#" \
    307307              -e "s#$${version}#"'$${version}'"#" \
     
    329329        mkdir -p $${location}; \
    330330        cd $${location}; \
    331         version=`$(cmtexe) version`; \
     331        version=`$(cmtexe) -quiet version`; \
    332332        echo "  Creating all $${sequence} packages..."; \
    333         ($(cmtexe) run_sequence ${CMTROOT}/src/demo/$${sequence}.cmt | \
     333        ($(cmtexe) -quiet run_sequence ${CMTROOT}/src/demo/$${sequence}.cmt | \
    334334          sed -e "s#$${CMTROOT}#"'$${CMTROOT}'"#" \
    335335              -e "s#$${version}#"'$${version}'"#" \
  • CMT/HEAD/mgr/cmt.nmake

    r100 r102  
    33#  Application cmt
    44#
    5 #   Generated Sat Oct 15 11:22:36 2005  by ARNAULT
     5#   Generated Mon Oct 17 11:37:01 2005  by ARNAULT
    66#
    77#====================================
  • CMT/HEAD/source/cmt_parser.cxx

    r96 r102  
    582582      s = CmtSystem::getenv ("CMTPATH");
    583583    }
     584
     585  {
     586    bool q = Me.m_quiet;
     587    Me.m_quiet = true; 
     588    Symbol::filter_path_value ("CMTPATH", s);
     589    Me.m_quiet = q; 
     590  }
    584591
    585592  IProjectFactory& factory = ProjectFactory::instance ();
  • CMT/HEAD/source/cmt_symbol.cxx

    r81 r102  
    856856}
    857857
     858/**
     859   Filter out faulty items of a path-like symbol value
     860 */
     861void Symbol::filter_path_value (const cmt_string& name, cmt_string& text)
     862{
     863  CmtSystem::cmt_string_vector paths;
     864                 
     865  CmtSystem::split (text, CmtSystem::path_separator (), paths);
     866                 
     867  for (int j = 0; j < paths.size (); ++j)
     868    {
     869      cmt_string& t = paths[j];
     870
     871      if (!CmtSystem::test_directory (t))
     872        {
     873          if (!Cmt::get_quiet ())
     874            {
     875              cerr << "#CMT> Warning: Wrong " << name << " item " << t << endl;
     876            }
     877           
     878          t = "";
     879        }
     880    }
     881 
     882  Cmt::vector_to_string (paths, CmtSystem::path_separator (), text);
     883
     884  for (;;)
     885    {
     886      int sz = text.size ();
     887
     888      if (sz == 0) break;
     889
     890      if ((text[0] == ';') || (text[0] == ':'))
     891        {
     892          text.erase (0, 1);
     893        }
     894      else if ((text[sz-1] == ';') || (text[sz-1] == ':'))
     895        {
     896          text.erase (sz-1, 1);
     897        }
     898      else
     899        {
     900          break;
     901        }
     902    }
     903
     904  text.replace_all ("::", ":");
     905  text.replace_all (";;", ";");
     906}
     907
     908
    858909//-------------------------------------------------------------
    859910Symbol& Symbol::symbol (int index)
     
    13481399      if (value != "")
    13491400        {
     1401          filter_path_value (symbol.name, value);
     1402
    13501403          cmt_string& temp = envs.add ();
    13511404
     
    15651618
    15661619  bool empty = (temp.size () == 0) ? true : false;
     1620
     1621  if (type == SymbolPath)
     1622    {
     1623      expand (temp);
     1624      Symbol::filter_path_value (name, temp);
     1625    }
    15671626
    15681627  switch (type)
  • CMT/HEAD/source/cmt_symbol.h

    r11 r102  
    9797  static void expand (cmt_string& text);
    9898
     99  static void filter_path_value (const cmt_string& name, cmt_string& text);
     100
    99101  static bool check_tag_used (Tag* tag);
    100102
Note: See TracChangeset for help on using the changeset viewer.