Changeset 536 for CMT/HEAD


Ignore:
Timestamp:
Mar 26, 2010, 5:36:41 PM (14 years ago)
Author:
rybkin
Message:

See C.L. 423

Location:
CMT/HEAD
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r535 r536  
     12010-03-26    <rybkin@lal.in2p3.fr> 423
     2
     3        * source/cmt_use.h: In function move_to, introduce second parameter curdir
     4        with default value false to specify where to search for package: in current
     5        directory or in CMTPATH entries
     6        * source/cmt_use.cxx: Modify function move_to accordingly
     7        * source/cmt_project.cxx: In function container_action, make use of move_to
     8        to search for container in current directory only
     9        * source/cmt_parser.cxx: In function reach_current_package, search for
     10        package in current directory and in CMTPATH entries as it was
     11       
    1122010-03-26    <rybkin@lal.in2p3.fr> 422
    213
  • CMT/HEAD/source/cmt_parser.cxx

    r535 r536  
    71167116  else if (Me.m_current_package != "")
    71177117    {
    7118       if (!use.move_to ())
     7118      if (!use.move_to () && !use.move_to ("", true))
     7119        //      if (!use.move_to ())
    71197120        {
    71207121          CmtError::set (CmtError::package_not_found,
  • CMT/HEAD/source/cmt_project.cxx

    r535 r536  
    22432243      use->get_package ()->remove_use (use);
    22442244      CmtSystem::cd (m_cmtpath_pwd);
    2245       if (use->move_to ())
    2246         {
    2247           cmt_string use_real;
    2248           bool ok (false);
    2249           if (!CmtSystem::absolute_path (use->path))
    2250             {
    2251               ok = CmtSystem::realpath_ (use->real_path, use_real);
    2252             }
    2253           else
    2254             {
    2255               ok = CmtSystem::realpath_ (use->path, use_real);
    2256             }
    2257           if (ok && use_real.find (m_cmtpath_real) != 0)
    2258             {
    2259               use->~Use ();
    2260             }
    2261           else if (!CmtSystem::absolute_path (use->real_path))
    2262             {
    2263               use->change_path (m_cmtpath_pwd);
    2264             }
     2245      if (use->move_to ("", true) &&
     2246          !CmtSystem::absolute_path (use->real_path))
     2247        {
     2248          use->change_path (m_cmtpath_pwd);
    22652249        }
    22662250      CmtSystem::cd (m_cmtpath_pwd + CmtSystem::file_separator () + "cmt");
    22672251    }
    2268   //  cerr << CmtSystem::pwd () << endl;
    22692252
    22702253  set_container_name (name);
  • CMT/HEAD/source/cmt_use.cxx

    r535 r536  
    19031903
    19041904//----------------------------------------------------------
    1905 bool Use::move_to (const cmt_string& native_version)
     1905bool Use::move_to (const cmt_string& native_version, bool curdir)
     1906//bool Use::move_to (const cmt_string& native_version)
    19061907{
    19071908  if (m_located)
     
    19241925  cmt_string expanded_path = path;
    19251926
     1927  if (curdir)
     1928    {
    19261929  //
    19271930  // Try here.
    19281931  //
    1929   if (expanded_path == "")
    1930     {
    1931       if (reach_package ("", native_version))
     1932//   if (expanded_path == "")
     1933//     {
     1934//       if (reach_package ("", native_version))
     1935      cmt_string here = CmtSystem::pwd ();
     1936      if (reach_package (here,  native_version))
    19321937        {
    19331938          if (Cmt::get_debug ())
     
    19361941            }
    19371942
    1938           change_path (expanded_path);
     1943          change_path (here);
    19391944
    19401945          return (true);
     
    19521957            }
    19531958        }
    1954     }
    1955      
     1959//     }
     1960    } // end of curdir     
     1961
    19561962  //
    19571963  // If the path specified in this use is a true absolute path,
     
    19841990        }
    19851991    }
     1992  if (curdir) return (false);
    19861993     
    19871994  //
  • CMT/HEAD/source/cmt_use.h

    r535 r536  
    8989  void author_action (const CmtSystem::cmt_string_vector& words);
    9090  void manager_action (const CmtSystem::cmt_string_vector& words);
    91   bool move_to (const cmt_string& native_version="");
     91  bool move_to (const cmt_string& native_version="", bool curdir = false);
     92  //  bool move_to (const cmt_string& native_version="");
    9293  void discard ();
    9394  void undiscard ();
Note: See TracChangeset for help on using the changeset viewer.