Changeset 411


Ignore:
Timestamp:
Apr 24, 2007, 11:44:34 PM (17 years ago)
Author:
arnault
Message:

Management of the -quiet option
Bug fixing in cmt_cvs.cxx
CL 329

Location:
CMT/HEAD
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r401 r411  
     12007-04-24    <arnault@lal.in2p3.fr> 329
     2
     3        * source/cmt_cvs.cxx (class CvsImplementation): Don't consider CVS branches when tag is not specified
     4
     5        * source/cmt_project.cxx: Protect warning messages with -quiet
     6
     7        * source/cmt_system.cxx: idem
     8        * source/cmt_system.h: Improvement of the FilePath class definition
     9
     10        * source/cmt_parser.cxx: Prepare using FilePath objet for current dir
     11        Better management of the -quiet option
     12       
     13        * source/cmt.h: Prepare using FilePath objet for current dir
     14
    1152007-04-23    <arnault@lal.in2p3.fr> 328
    216
  • CMT/HEAD/source/cmt.h

    r323 r411  
    3535 
    3636  cmt_string m_current_dir;
     37  FilePath   m_current_file_path;
    3738  cmt_string m_current_package;
    3839  cmt_string m_current_config;
  • CMT/HEAD/source/cmt_cvs.cxx

    r400 r411  
    19521952                           const cmt_string& version_tag)
    19531953  {
     1954    if (m_verbose)
     1955      {
     1956        cerr << "#CMT> checkout phase1 module=" << module
     1957             << " version_dir=" << version_dir << " version_tag=" << version_tag << endl;
     1958      }
     1959
    19541960    add_cmtpath (m_home_dir);
    19551961
     
    19881994    if (version_tag == "")
    19891995      {
    1990         Cut cut (0);
    1991        
    1992         if (tags_top_info != "") tag = tags_top_info;
    1993         else tag = tags_info;
    1994        
    1995         cut.run (tag);
    1996        
    1997         tag = cut.result ();
     1996        // No version tag is specified
     1997        // we need to discard all CVS branches
     1998        //
     1999        cmt_string versions = "";
     2000
     2001        if (cvsversions_top_info != "")
     2002          {
     2003            versions = cvsversions_top_info;
     2004            versions += " ";
     2005          }
     2006
     2007        versions += cvsversions_info;
     2008
     2009        static CmtSystem::cmt_string_vector words;
     2010
     2011        // Get all <tag>:<version> items
     2012
     2013        CmtSystem::split (versions, " \t", words);
     2014
     2015        for (int i = 0; i < words.size (); i++)
     2016          {
     2017            // split to get <tag> and <version> separately
     2018
     2019            static CmtSystem::cmt_string_vector vts;
     2020            CmtSystem::split (words[i], ":", vts);
     2021
     2022            cmt_string t = vts[0];
     2023            cmt_string v = vts[1];
     2024
     2025            // Split to count the number of items for the CVS version
     2026
     2027            static CmtSystem::cmt_string_vector ds;
     2028            CmtSystem::split (v, ".", ds);
     2029
     2030            if (ds.size () == 2)
     2031              {
     2032                tag = t;
     2033                break;
     2034              }
     2035          }
    19982036      }
    19992037    else
  • CMT/HEAD/source/cmt_parser.cxx

    r400 r411  
    6464  m_cmt_version    = "";
    6565  m_current_dir     = "";
     66  m_current_file_path = "";
    6667  m_current_package = "";
    6768  m_current_config  = "";
     
    7778  m_current_version  = "";
    7879  m_default_path     = "";
    79   m_quiet            = false;
     80
     81  //m_quiet            = false;
     82
    8083  m_disable_warnings = false;
    8184  m_warnings         = false;
     
    492495void Cmt::clear ()
    493496{
     497  Me.m_quiet = false;
    494498  Me.clear ();
    495499
     
    528532
    529533
     534  bool save_quiet = Me.m_quiet;
     535  Me.m_quiet = true;
     536
    530537  Me.m_autoconfigure_cmtpath = true;
    531538  configure_cmt_path (0);
    532539  Me.m_autoconfigure_cmtpath = false;
    533540
     541  Me.m_quiet = save_quiet;
    534542
    535543  configure_current_dir ();
     
    573581    bool q = Me.m_quiet;
    574582    Me.m_quiet = true; 
     583
    575584    Symbol::filter_path_value ("CMTPATH", s);
     585
    576586    Me.m_quiet = q;
    577587  }
     
    765775
    766776  Me.m_current_dir = mount_filter.get_current_dir ();
     777  Me.m_current_file_path = mount_filter.get_current_dir ();
     778
     779  cmt_string t = Me.m_current_file_path;
    767780}
    768781
     
    22742287
    22752288  Me.m_quiet = true;
    2276 
     2289   
    22772290  if (!reach_current_package ())
    22782291    {
     
    41164129  //cerr << "buffer = " << buffer << endl;
    41174130  Use& use = Use::current();
     4131
    41184132  bool save_quiet = Me.m_quiet;
    41194133  Me.m_quiet = true;
     4134
    41204135  SyntaxParser::parse_requirements_text (buffer, "", &use);
     4136
    41214137  Me.m_quiet = save_quiet;
    41224138
     
    49184934    }
    49194935
    4920 
    49214936  clear ();
     4937
    49224938  configure ();
    49234939
  • CMT/HEAD/source/cmt_project.cxx

    r400 r411  
    232232          if (r != p.get_release ())
    233233            {
    234               cerr << "#CMT> Project " << p.get_name ()
    235                    << " requested with conflicting releases " << p.get_release () << " and " << r << endl;
     234              if (!Cmt::get_quiet ())
     235                {
     236                  cerr << "#CMT> Project " << p.get_name ()
     237                       << " requested with conflicting releases " << p.get_release () << " and " << r << endl;
     238                }
    236239              CmtError::set (CmtError::project_release_conflict, p.get_name ());
    237240            }
  • CMT/HEAD/source/cmt_system.cxx

    r400 r411  
    24672467      if (l_name == "")
    24682468        {
     2469          // the logical name was not set => set it
    24692470          l_name = other;
    24702471        }
    24712472      else
    24722473        {
     2474          // add a new logical name
    24732475          cmt_string& n = alternates.add ();
    24742476          n = other;
     
    24922494}
    24932495
     2496//----------------------------------------------------------
     2497const cmt_string& FilePath::name () const
     2498{
     2499  if (l_name != "") return (l_name);
     2500  else return (p_name);
     2501}
     2502
     2503//----------------------------------------------------------
     2504FilePath::operator const cmt_string& () const
     2505{
     2506  if (l_name != "") return (l_name);
     2507  else return (p_name);
     2508}
     2509
     2510//----------------------------------------------------------
     2511bool FilePath::in (const FilePath& other) const
     2512{
     2513  const cmt_string& o = other.name ();
     2514
     2515  return (in (o));
     2516
     2517  return (false);
     2518}
     2519
     2520//----------------------------------------------------------
     2521bool FilePath::in (const cmt_string& other) const
     2522{
     2523  if (p_name.find (other) == 0) return (true);
     2524  if (l_name.find (other) == 0) return (true);
     2525
     2526  for (int i = 0; i < alternates.size (); i++)
     2527    {
     2528      const cmt_string& a = alternates[i];
     2529      if (a.find (other) == 0) return (true);
     2530    }
     2531
     2532  return (false);
     2533}
     2534
     2535//----------------------------------------------------------
     2536bool FilePath::in (const char* other) const
     2537{
     2538  const cmt_string o = other;
     2539
     2540  return (in (o));
     2541}
     2542
     2543
  • CMT/HEAD/source/cmt_system.h

    r400 r411  
    167167  bool operator != (const char* other) const;
    168168
     169  const cmt_string& name () const;
     170  operator const cmt_string& () const;
     171
     172  bool in (const FilePath& other) const;
     173  bool in (const cmt_string& other) const;
     174  bool in (const char* other) const;
     175
    169176  bool cd () const;
    170177
Note: See TracChangeset for help on using the changeset viewer.