Changeset 435
- Timestamp:
- Jan 25, 2008, 1:57:34 PM (16 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r434 r435 1 2008-01-25 <rybkin@lal.in2p3.fr> 340 2 3 * source/cmt_system.h: Improve the handling of symlinks in the paths 4 * source/cmt_system.cxx: idem 5 * source/cmt_use.cxx: idem 6 * source/cmt_project.cxx: idem 7 * source/cmt_parser.cxx: Comment out a duplicate piece of code 8 1 9 2008-01-18 <rybkin@lal.in2p3.fr> 339 2 10 -
CMT/HEAD/source/cmt_parser.cxx
r431 r435 923 923 if (structuring_style == with_version_directory) 924 924 { 925 cerr << "#CMT> warning: " << up_branch << " is not correct version syntax. Assuming it is package name" << endl;925 cerr << "#CMT> Warning: " << up_branch << " is not correct version syntax. Assuming it is package name" << endl; 926 926 } 927 927 // No version descriptor … … 7589 7589 cmt_string pwd = CmtSystem::pwd (); 7590 7590 7591 /** 7592 * This is already done in 7593 void Cmt::configure_current_package () 7594 7591 7595 if (CmtSystem::test_file ("../cmt/requirements")) Me.m_current_style = cmt_style; 7592 7596 else if (CmtSystem::test_file ("../mgr/requirements")) Me.m_current_style = mgr_style; … … 7602 7606 } 7603 7607 } 7608 */ 7604 7609 7605 7610 // Prepare computation of the best form for relative path from current directory -
CMT/HEAD/source/cmt_project.cxx
r411 r435 268 268 // Figure out if this is the current project 269 269 // 270 if (here.find (pwd) == 0) is_current = true; 270 // if (here.find (pwd) == 0) is_current = true; 271 272 // In case there are symlinks 273 cmt_string here_real, pwd_real; 274 if (CmtSystem::realpath_ (here, here_real) && CmtSystem::realpath_ (pwd, pwd_real)) 275 { 276 if (here_real.find (pwd_real) == 0) is_current = true; 277 } 271 278 272 279 cmt_string text; … … 782 789 cmt_string here = CmtSystem::pwd (); 783 790 791 // In case there are symlinks 792 cmt_string here_real; 793 CmtSystem::realpath_ (here, here_real); 794 784 795 static ProjectVector& Projects = projects (); 785 796 … … 795 806 } 796 807 797 if (here.find (p.m_cmtpath) == 0) 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) 798 813 { 799 814 result = &p; … … 1071 1086 if (CmtSystem::test_directory (p)) 1072 1087 { 1073 if (path.find (p) != cmt_string::npos) 1074 { 1075 return (p); 1088 // if (path.find (p) != cmt_string::npos) 1089 // { 1090 // return (p); 1091 // } 1092 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); 1076 1098 } 1077 1099 -
CMT/HEAD/source/cmt_system.cxx
r411 r435 252 252 CmtSystem::cd (path); 253 253 result = CmtSystem::pwd (); 254 CmtSystem::cd (here); 255 return true; 256 } 257 return false; 258 } 259 260 //-------------------------------------------------- 261 bool CmtSystem::realpath_ (const cmt_string& path, cmt_string& result) 262 { 263 if (test_directory(path)) 264 { 265 cmt_string here = CmtSystem::pwd (); 266 CmtSystem::cd (path); 267 // 268 char buffer[256] = ""; 269 char* ptr = 0; 270 ptr = getcwd (buffer, sizeof (buffer)); 271 const char* t = &buffer[0]; 272 result = t; 273 // cerr << "realpath_> path: " << path << " result: " << result << endl; 274 // 254 275 CmtSystem::cd (here); 255 276 return true; -
CMT/HEAD/source/cmt_system.h
r411 r435 40 40 // Resolve symbolic links in a path. 41 41 static bool realpath (const cmt_string& path, cmt_string& result); 42 // Currently the above does not resolve symbolic links in a path. 43 static bool realpath_ (const cmt_string& path, cmt_string& result); 42 44 43 45 static void dirname (const cmt_string& file_name, cmt_string& result); -
CMT/HEAD/source/cmt_use.cxx
r400 r435 2910 2910 static const cmt_string fs = CmtSystem::file_separator (); 2911 2911 2912 offset = real_path; 2913 offset.replace (cmtpath, empty_string); 2912 // In case there are symlinks 2913 // offset = real_path; 2914 // offset.replace (cmtpath, empty_string); 2915 CmtSystem::realpath_ (real_path, offset); 2916 cmt_string cmtpath_real; 2917 CmtSystem::realpath_ (cmtpath, cmtpath_real); 2918 offset.replace (cmtpath_real, empty_string); 2914 2919 2915 2920 /**
Note: See TracChangeset
for help on using the changeset viewer.