Changeset 39 for CMT/HEAD


Ignore:
Timestamp:
Apr 21, 2005, 1:14:29 AM (19 years ago)
Author:
arnault
Message:

Fix PATH symbols management with symlinks - See CL 268

Location:
CMT/HEAD
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r38 r39  
     12005-04-21  Christian Arnault  <arnault@lal.in2p3.fr> 268
     2
     3        * source/cmt_project.cxx (create_project): Check pwd for finding
     4        projects.
     5
     6        * source/cmt_symbol.cxx (find_path_entry): Look for existing PATH
     7        entries by comparing the real path rather than the logical
     8        path. Use pwd everywhere.
     9
    1102005-04-14  Christian Arnault  <arnault@lal.in2p3.fr> 267
    211
  • CMT/HEAD/source/cmt_project.cxx

    r38 r39  
    211211  CmtSystem::split (cmtprojectpath, sep, items);
    212212
     213  cmt_string here = CmtSystem::pwd ();
     214  if (!CmtSystem::cd (compressed_path)) return (0);
     215  cmt_string pwd = CmtSystem::pwd ();
     216
    213217  static Project::ProjectVector& Projects = Project::projects ();
    214218 
     
    218222     
    219223      if ((p.get_cmtpath () == compressed_path) ||
    220           (p.get_cmtpath_pwd () == compressed_path) ||
     224          (p.get_cmtpath_pwd () == pwd) ||
    221225          (specify_name && (p.get_name () == specified_name)))
    222226        {
     
    243247            }
    244248
     249          CmtSystem::cd (here);
    245250          return (&p);
    246251        }
     
    253258  bool is_current = false;
    254259 
    255   cmt_string here = CmtSystem::pwd ();
    256   if (!CmtSystem::cd (compressed_path)) return (0);
    257 
    258260  cmt_string name = specified_name;
    259261  cmt_string project_name;
     
    263265  // Figure out if this is the current project
    264266  //
    265   cmt_string pwd = CmtSystem::pwd ();
    266267  if (here.find (pwd) == 0) is_current = true;
    267268
     
    14191420  int i;
    14201421
    1421   /*
    14221422  for (i = 0; i < m_parents.size (); i++)
    14231423    {
     
    14331433      cout << " C=" << p->get_name ();
    14341434    }
    1435   */
    14361435
    14371436  cout << endl;
  • CMT/HEAD/source/cmt_symbol.cxx

    r11 r39  
    19391939{
    19401940  static const cmt_string path_separator = CmtSystem::path_separator ();
    1941   static const cmt_string double_path_separator = path_separator + path_separator;
    1942 
    1943   cmt_string complete_paths;
    1944 
    1945   complete_paths = path_separator;
    1946   complete_paths += paths;
    1947   complete_paths += path_separator;
    1948 
    1949   complete_paths.replace_all (double_path_separator, path_separator);
    1950 
    1951   cmt_string complete_value;
    1952   complete_value = path_separator;
    1953   complete_value += value;
    1954   complete_value += path_separator;
    1955 
    1956   if (complete_paths.find (complete_value) == cmt_string::npos) return (false);
    1957   else return (true);
     1941
     1942  cmt_string here = CmtSystem::pwd ();
     1943
     1944  CmtSystem::cd (value);
     1945  cmt_string rvalue = CmtSystem::pwd ();
     1946
     1947  CmtSystem::cmt_string_vector items;
     1948  CmtSystem::split (paths, path_separator, items);
     1949
     1950  bool found = false;
     1951
     1952  for (int i = 0; i < items.size (); i++)
     1953    {
     1954      const cmt_string& item = items[i];
     1955      CmtSystem::cd (item);
     1956      cmt_string ritem = CmtSystem::pwd ();
     1957      if (ritem == rvalue)
     1958        {
     1959          found = true;
     1960          break;
     1961        }
     1962    }
     1963
     1964  CmtSystem::cd (here);
     1965  return (found);
    19581966}
    19591967
Note: See TracChangeset for help on using the changeset viewer.