- Timestamp:
- Mar 29, 2010, 12:33:45 PM (14 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r536 r537 1 2010-03-29 <rybkin@lal.in2p3.fr> 424 2 3 * source/cmt_commands.cxx: In functions option_path, option_use of class 4 ArgParser, validate current use object reset from command line options, 5 reorder and/or create projects, if needed 6 * source/cmt_project.cxx: In function ProjectFactory::create_project, do 7 not specify current project (and its tag). In function Project::order_all, 8 specify current project (and its tag) based on current directory path or 9 current use object real path, if the latter is located 10 * source/cmt_parser.cxx: In function Cmt::guess_current_project, make use 11 of current use object real path, if it is located, or current directory 12 path otherwise. This allows for doing setup with setup scripts generated 13 by "cmt config" from any place (with a correct CMTPROJECTPATH), resolving 14 ticket #57 15 * source/cmt_use.cxx: In function move_to, search for package in absolute 16 path first, if it is specified 17 * source/cmt_pattern.cxx: In function ApplyPattern::action, print warning 18 pattern_not_found in DeveloperMode (i. e., in current package) only 19 1 20 2010-03-26 <rybkin@lal.in2p3.fr> 423 2 21 -
CMT/HEAD/source/cmt_commands.cxx
r528 r537 1736 1736 cmt.m_current_version, 1737 1737 cmt.m_current_path); 1738 1739 Use& use = Use::current(); 1740 if (use.get_package_name () == "cmt_standalone") 1741 { 1742 if (!CmtSystem::cd (use.path) || !CmtSystem::test_file ("requirements")) 1743 { 1744 CmtError::set (CmtError::package_not_found, use.get_info ()); 1745 return; 1746 } 1747 use.style = none_style; 1748 use.structuring_style = without_version_directory; 1749 use.change_path (CmtSystem::pwd ()); 1750 } 1751 else if (!use.move_to ("", true)) 1752 { 1753 CmtError::set (CmtError::package_not_found, use.get_info ()); 1754 return; 1755 } 1756 Project::order_all (); 1757 Cmt::guess_current_project (); 1738 1758 } 1739 1759 } … … 1803 1823 //IProjectFactory& factory = ProjectFactory::instance (); 1804 1824 //CmtSystem::add_cmt_path (cmt.m_current_path, "argument", factory); 1825 Use& use = Use::current(); 1826 if (use.get_package_name () == "cmt_standalone") 1827 { 1828 if (!CmtSystem::cd (use.path) || !CmtSystem::test_file ("requirements")) 1829 { 1830 CmtError::set (CmtError::package_not_found, use.get_info ()); 1831 return; 1832 } 1833 use.style = none_style; 1834 use.structuring_style = without_version_directory; 1835 use.change_path (CmtSystem::pwd ()); 1836 } 1837 else if (!use.move_to ("", true)) 1838 { 1839 CmtError::set (CmtError::package_not_found, use.get_info ()); 1840 return; 1841 } 1842 Project::order_all (); 1843 Cmt::guess_current_project (); 1805 1844 } 1806 1845 } -
CMT/HEAD/source/cmt_parser.cxx
r536 r537 4747 4747 cmt_string here = CmtSystem::pwd (); 4748 4748 4749 if (Project::find_in_cmt_paths (Me.m_current_dir) == "") 4750 { 4749 Use& use = Use::current(); 4750 cmt_string current_path (Me.m_current_dir); 4751 if (use.located ()) 4752 { 4753 current_path = use.real_path; 4754 CmtMessage::verbose ("Using current use real_path `" + current_path + "'"); 4755 } 4756 4757 if (Project::find_in_cmt_paths (current_path) == "") 4758 // if (Project::find_in_cmt_paths (Me.m_current_dir) == "") 4759 { 4760 if (!CmtSystem::cd (current_path)) 4761 { 4762 CmtError::set (CmtError::file_access_error, current_path); 4763 CmtError::print (); 4764 return; 4765 } 4751 4766 cmt_string project_file = "cmt"; 4752 4767 project_file += CmtSystem::file_separator (); … … 4790 4805 Project::fill_cmtpaths (buffer); 4791 4806 //cerr << "buffer = " << buffer << endl; 4792 Use& use = Use::current();4807 // Use& use = Use::current(); 4793 4808 4794 4809 bool save_quiet = Me.m_quiet; -
CMT/HEAD/source/cmt_pattern.cxx
r535 r537 844 844 if (p == 0) 845 845 { 846 if (Cmt::get_current_access () == DeveloperMode) 847 CmtMessage::warning (CmtError::get_error_name (CmtError::pattern_not_found) + 848 ": " + name + 849 " (applied by " + use->get_package_name () + ")" 850 ); 851 return; 852 /* 846 853 if (use->get_current_scope () != ScopeUnspecified && 847 854 use->get_current_scope () != ScopePublic) 848 855 return; 856 */ 849 857 /* 850 858 cmt_string use_info (use->get_package_name () + … … 854 862 ); 855 863 */ 856 CmtMessage::warning (CmtError::get_error_name (CmtError::pattern_not_found) +857 ": " + name +858 " (applied by " + use->get_package_name () + ")"859 );860 864 /* 861 865 CmtError::set (CmtError::pattern_not_found, name + … … 869 873 } 870 874 */ 871 return;872 875 } 873 876 -
CMT/HEAD/source/cmt_project.cxx
r536 r537 295 295 */ 296 296 cmt_string pwd_real; 297 if (CmtSystem::realpath_ (pwd, pwd_real)) 298 { 299 if (Cmt::get_current_dir_real ().find (pwd_real) == 0) is_current = true; 297 if (!CmtSystem::realpath_ (pwd, pwd_real)) 298 { 299 CmtError::set (CmtError::file_access_error, "Cannot compute real path `" + 300 pwd + "'"); 301 CmtError::print (); 302 return 0; 303 // if (Cmt::get_current_dir_real ().find (pwd_real) == 0) is_current = true; 300 304 } 301 305 … … 597 601 project->set_cmtpath_source (source); 598 602 599 project->set_is_current (is_current);600 603 // project->set_is_current (is_current); 604 /* 601 605 if (is_current) 602 606 { … … 611 615 tag->mark (); 612 616 } 613 617 */ 614 618 615 619 // Project::order_all (); … … 974 978 OrderedProjects.resize (size); 975 979 980 Use& use = Use::current(); 981 cmt_string current_path (Cmt::get_current_dir ()); 982 if (use.located ()) 983 { 984 current_path = use.real_path; 985 CmtMessage::verbose ("Using current use real_path `" + current_path + "'"); 986 } 987 988 cmt_string current_path_real; 989 if (!CmtSystem::realpath_ (current_path, current_path_real)) 990 { 991 CmtError::set (CmtError::file_access_error, "Cannot compute real path `" + 992 current_path + "'"); 993 CmtError::print (); 994 return; 995 //CmtMessage::error ("Cannot compute real path `" + Use::current().real_path + "'"); 996 } 997 998 Project* p_cur (0); 976 999 for (int i = 0; i < size; i++) 977 1000 { … … 982 1005 p.m_order = -2; 983 1006 p.m_visits = 0; 1007 // 1008 // The current project specification 1009 // 1010 if (current_path_real.find (p.get_cmtpath_real ()) == 0) 1011 { 1012 if (p.is_current ()) continue; 1013 p.set_is_current (true); 1014 // 1015 // The current project defines a tag with its name 1016 // 1017 1018 Tag* tag; 1019 1020 tag = Tag::add (p.get_name (), PriorityConfig, "PROJECT", 0); 1021 tag->mark (); 1022 1023 p_cur = &p; 1024 } 1025 else if (p.is_current ()) 1026 { 1027 // 1028 // Unset the tag with its name - TODO 1029 // 1030 p.set_is_current (false); 1031 } 984 1032 } 985 1033 … … 1015 1063 } 1016 1064 1017 Project* p = get_current (); 1065 Project* p (p_cur); 1066 // Project* p = get_current (); 1018 1067 1019 1068 // cerr << "get_current: " << p << " offset: " << offset << endl; -
CMT/HEAD/source/cmt_use.cxx
r536 r537 1925 1925 cmt_string expanded_path = path; 1926 1926 1927 cmt_string here; 1927 1928 if (curdir) 1928 { 1929 here = CmtSystem::pwd (); 1930 1931 // 1932 // If the path specified in this use is a true absolute path, 1933 // then we search the package from there first. 1934 // 1935 if (CmtSystem::absolute_path (expanded_path)) 1936 { 1937 if (reach_package (expanded_path, native_version)) 1938 { 1939 if (Cmt::get_debug ()) 1940 { 1941 cout << "move_to3> " << expanded_path << endl; 1942 } 1943 1944 change_path (expanded_path); 1945 1946 return (true); 1947 } 1948 else if (alternate_versions.size () > 0) 1949 { 1950 if (select_alternate ()) 1951 { 1952 if (Cmt::get_debug ()) 1953 { 1954 cout << "move_to5> " << real_path << endl; 1955 } 1956 1957 return (true); 1958 } 1959 } 1960 } 1961 1929 1962 // 1930 1963 // Try here. 1931 1964 // 1965 if (curdir) 1966 { 1932 1967 // if (expanded_path == "") 1933 1968 // { 1934 1969 // if (reach_package ("", native_version)) 1935 cmt_string here = CmtSystem::pwd ();1936 1970 if (reach_package (here, native_version)) 1937 1971 { … … 1957 1991 } 1958 1992 } 1993 return (false); 1959 1994 // } 1960 1995 } // end of curdir 1961 1962 //1963 // If the path specified in this use is a true absolute path,1964 // then we search the package from there first.1965 //1966 if (CmtSystem::absolute_path (expanded_path))1967 {1968 if (reach_package (expanded_path, native_version))1969 {1970 if (Cmt::get_debug ())1971 {1972 cout << "move_to3> " << expanded_path << endl;1973 }1974 1975 change_path (expanded_path);1976 1977 return (true);1978 }1979 else if (alternate_versions.size () > 0)1980 {1981 if (select_alternate ())1982 {1983 if (Cmt::get_debug ())1984 {1985 cout << "move_to5> " << real_path << endl;1986 }1987 1988 return (true);1989 }1990 }1991 }1992 if (curdir) return (false);1993 1996 1994 1997 //
Note: See TracChangeset
for help on using the changeset viewer.