- Timestamp:
- Feb 2, 2008, 7:39:21 AM (16 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r436 r437 1 2008-02-02 <rybkin@lal.in2p3.fr> 342 2 3 * source/cmt_project.h: Optimise the use of realpath_ 4 * source/cmt_project.cxx: idem 5 * source/cmt_use.cxx: idem 6 1 7 2008-01-31 <rybkin@lal.in2p3.fr> 341 2 8 -
CMT/HEAD/source/cmt_project.cxx
r435 r437 272 272 // In case there are symlinks 273 273 cmt_string here_real, pwd_real; 274 //cerr << "realpath_: create_project" << endl; 274 275 if (CmtSystem::realpath_ (here, here_real) && CmtSystem::realpath_ (pwd, pwd_real)) 275 276 { … … 560 561 561 562 project->set_cmtpath (compressed_path); 563 project->set_cmtpath_real (pwd_real); 562 564 project->set_cmtpath_pwd (pwd); 563 565 project->set_cmtpath_source (source); … … 778 780 779 781 if (p.m_cmtpath == compressed_path) return (&p); 782 if (p.m_cmtpath_real == compressed_path) return (&p); 780 783 if (p.m_cmtpath_pwd == compressed_path) return (&p); 781 784 } … … 801 804 Project& p = Projects[i]; 802 805 803 if (here.find (p.m_cmtpath_pwd) == 0) 804 { 805 result = &p; 806 } 807 808 // In case there are symlinks 809 // if (here.find (p.m_cmtpath) == 0) 810 cmt_string p_real; 811 CmtSystem::realpath_ (p.m_cmtpath, p_real); 812 if (here_real.find (p_real) == 0) 806 // if (here.find (p.m_cmtpath_pwd) == 0) 807 // { 808 // result = &p; 809 // } 810 811 // if (here.find (p.m_cmtpath) == 0) 812 if (here_real.find (p.m_cmtpath_real) == 0) 813 813 { 814 814 result = &p; … … 1072 1072 const cmt_string pwd = CmtSystem::pwd (); 1073 1073 1074 // In case there are symlinks 1075 cmt_string path_real; 1076 //cerr << "realpath_: find_in_cmt_paths" << endl; 1077 CmtSystem::realpath_ (path, path_real); 1078 1074 1079 static ProjectVector& Projects = projects (); 1075 1080 … … 1079 1084 1080 1085 const cmt_string& p = project.m_cmtpath; 1086 const cmt_string& p_real = project.m_cmtpath_real; 1081 1087 const cmt_string& w = project.m_cmtpath_pwd; 1082 1088 const cmt_string& s = project.m_cmtpath_source; … … 1091 1097 // } 1092 1098 1093 // In case there are symlinks 1094 cmt_string p_real, path_real; 1095 if (CmtSystem::realpath_ (p, p_real) && CmtSystem::realpath_ (path, path_real)) 1096 { 1097 if (path_real.find (p_real) != cmt_string::npos) return (p); 1099 if (path_real.find (p_real) != cmt_string::npos) 1100 { 1101 return (p); 1098 1102 } 1099 1103 … … 1268 1272 1269 1273 //---------------------------------------------------------- 1274 const cmt_string& Project::get_cmtpath_real () const 1275 { 1276 return (m_cmtpath_real); 1277 } 1278 1279 //---------------------------------------------------------- 1270 1280 const cmt_string& Project::get_cmtpath_pwd () const 1271 1281 { … … 1330 1340 1331 1341 //---------------------------------------------------------- 1342 void Project::set_cmtpath_real (const cmt_string& path) 1343 { 1344 m_cmtpath_real = path; 1345 } 1346 1347 //---------------------------------------------------------- 1332 1348 void Project::set_cmtpath_pwd (const cmt_string& path) 1333 1349 { … … 1347 1363 m_release = ""; 1348 1364 m_cmtpath = ""; 1365 m_cmtpath_real = ""; 1349 1366 m_cmtpath_pwd = ""; 1350 1367 m_cmtpath_source = ""; … … 1718 1735 m_name = other.m_name; 1719 1736 m_cmtpath = other.m_cmtpath; 1737 m_cmtpath_real = other.m_cmtpath_real; 1720 1738 m_cmtpath_pwd = other.m_cmtpath_pwd; 1721 1739 m_cmtpath_source = other.m_cmtpath_source; … … 1743 1761 bool is_current = false; 1744 1762 1745 cmt_string here = CmtSystem::pwd (); 1746 1747 if (here.find (m_cmtpath) == 0) 1763 // cmt_string here = CmtSystem::pwd (); 1764 // In case there are symlinks 1765 cmt_string here_real; 1766 CmtSystem::realpath_ (CmtSystem::pwd (), here_real); 1767 1768 // if (here.find (m_cmtpath) == 0) 1769 if (here_real.find (m_cmtpath_real) == 0) 1748 1770 { 1749 1771 if (m_cmtpath_source != "default path") -
CMT/HEAD/source/cmt_project.h
r330 r437 136 136 const cmt_string& get_container_version () const; 137 137 const cmt_string& get_cmtpath () const; 138 const cmt_string& get_cmtpath_real () const; 138 139 const cmt_string& get_cmtpath_pwd () const; 139 140 const cmt_string& get_cmtpath_source () const; … … 151 152 void set_container_version (const cmt_string& version); 152 153 void set_cmtpath (const cmt_string& path); 154 void set_cmtpath_real (const cmt_string& path); 153 155 void set_cmtpath_pwd (const cmt_string& path); 154 156 void set_cmtpath_source (const cmt_string& source); … … 210 212 211 213 cmt_string m_cmtpath; 214 cmt_string m_cmtpath_real; 212 215 cmt_string m_cmtpath_pwd; 213 216 cmt_string m_cmtpath_source; -
CMT/HEAD/source/cmt_use.cxx
r435 r437 2902 2902 2903 2903 cmtpath = Project::find_in_cmt_paths (real_path); 2904 2905 if (cmtpath != "") 2904 Project* p = Project::find_by_cmtpath (cmtpath); 2905 2906 // if (cmtpath != "") 2907 if (p != 0) 2906 2908 { 2907 2909 CmtSystem::compress_path (cmtpath); … … 2913 2915 // offset = real_path; 2914 2916 // offset.replace (cmtpath, empty_string); 2917 //cerr << "realpath_: get_cmtpath_and_offset" << endl; 2915 2918 CmtSystem::realpath_ (real_path, offset); 2916 cmt_string cmtpath_real; 2917 CmtSystem::realpath_ (cmtpath, cmtpath_real); 2918 offset.replace (cmtpath_real, empty_string); 2919 offset.replace (p->get_cmtpath_real (), empty_string); 2919 2920 2920 2921 /**
Note: See TracChangeset
for help on using the changeset viewer.