Changeset 200
- Timestamp:
- Jun 2, 2006, 10:43:50 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/source/cmt_cvs.cxx
r192 r200 2 2 // Copyright Christian Arnault LAL-Orsay CNRS 3 3 // arnault@lal.in2p3.fr 4 // Modified by: garonne@lal.in2p3.fr 4 5 // See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 //----------------------------------------------------------- … … 317 318 { 318 319 status = CmtSystem::execute (command, out); 319 } 320 320 321 } 322 323 //if (m_verbose || m_simulation) 324 // { 325 // cout << out << endl; 326 // } 321 327 return (status); 322 328 } … … 827 833 if (m_verbose) 828 834 { 829 cout << "#CMT> requesting cvs infos onto module " << module << endl;835 cout << "#CMT> requesting cvs infos onto module " << module << endl; 830 836 } 831 837 … … 919 925 bool do_need_version () 920 926 { 921 bool need_version = false;927 bool need_version = false; 922 928 923 929 if (structure_info == "project") 924 925 need_version = true; 926 930 { 931 need_version = true; 932 } 927 933 else 928 934 { 929 CmtStructuringStyle style = Cmt::get_current_structuring_style (); 930 931 if (style == default_structuring_style) 932 { 933 Use& current_use = Use::current (); 934 if (current_use.get_strategy ("VersionDirectory")) 935 { 936 need_version = true; 937 } 938 } 939 else if (style == with_version_directory) 940 { 941 need_version = true; 942 } 935 CmtStructuringStyle style = Cmt::get_current_structuring_style (); 936 if (style == default_structuring_style) 937 { 938 Use& current_use = Use::current (); 939 if (current_use.get_strategy ("VersionDirectory")) 940 need_version = true; 941 } 942 else if (style == with_version_directory) 943 need_version = true; 943 944 } 944 945 … … 1246 1247 if (need_version) 1247 1248 { 1248 if (!mkdir (version)) return (false); 1249 1250 dir += CmtSystem::file_separator (); 1251 dir += version; 1249 if (!mkdir (version)) return (false); 1250 dir += CmtSystem::file_separator (); 1251 dir += version; 1252 1252 } 1253 1253 else … … 1281 1281 if (!CmtSystem::test_directory ("CVS")) 1282 1282 { 1283 cout << "#CMT> CVS repository is missing !!" << endl;1284 1283 int i; 1285 1284 for (i = 0; i < branch_vector.size (); i++) … … 1419 1418 cmt_string find_matching_version (const cmt_string& expression) 1420 1419 { 1421 cmt_string result; 1422 1420 1421 cmt_string result; 1422 1423 1423 // 1424 1424 // Here expression takes the form … … 1541 1541 given by the structure info obtained from the most recent request to the CVS pluggin 1542 1542 */ 1543 bool check_structure (const cmt_string& dir )1543 bool check_structure (const cmt_string& dir, const cmt_string& version) 1544 1544 { 1545 1545 bool result = false; 1546 1547 1546 if (!CmtSystem::test_directory (dir)) 1548 1547 { 1549 return (false);1548 return (false); 1550 1549 } 1551 1550 1552 1551 if (structure_info == "package") 1553 1552 { 1554 // Check if it is a true CMT package. 1555 1553 // Check if it is a true CMT package. 1556 1554 cmt_string file_name; 1557 1555 … … 1563 1561 1564 1562 if (CmtSystem::test_file (file_name)) 1565 { 1566 result = true; 1563 { 1564 if (!do_need_version ()) 1565 { 1566 // open the version.cmt file and compare the version 1567 cmt_string current_version; 1568 cmt_string version_file = dir; 1569 version_file += CmtSystem::file_separator (); 1570 version_file += "CVS"; 1571 version_file += CmtSystem::file_separator (); 1572 version_file += "Tag"; 1573 current_version.read (version_file); 1574 //cout <<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl; 1575 return current_version=="N"+version+"\n"; 1576 } 1577 else 1578 result = true; 1567 1579 } 1568 1580 else 1569 1581 { 1582 1570 1583 file_name = dir; 1571 1584 file_name += CmtSystem::file_separator (); … … 1576 1589 if (CmtSystem::test_file (file_name)) 1577 1590 { 1578 result = true; 1591 if (!do_need_version ()) 1592 { 1593 // open the version.cmt file and compare the version 1594 cmt_string current_version; 1595 cmt_string version_file = dir; 1596 version_file += CmtSystem::file_separator (); 1597 version_file += "CVS"; 1598 version_file += CmtSystem::file_separator (); 1599 version_file += "Tag"; 1600 current_version.read (version_file); 1601 //cout <<version_file<<", "<<current_version<<", "<<"N"+version+"\n"<<endl; 1602 return current_version=="N"+version+"\n"; 1603 } 1604 else 1605 result = true; 1579 1606 } 1580 1607 } … … 1594 1621 result = true; 1595 1622 } 1596 1623 } 1597 1624 1598 1625 return (result); … … 1660 1687 bool recursive = m_recursive; 1661 1688 1662 cmt_string effective_version = find_matching_version (dir); 1663 1689 cmt_string effective_version = ""; 1690 if (do_need_version ()) 1691 { 1692 /* Important this part should be enhanced ASAP 1693 and deal with many other cases.... arghhhh !! 1694 */ 1695 effective_version = find_matching_version (dir); 1696 } 1697 1698 1699 1664 1700 cmt_string module; 1665 1701 get_module (full_offset, product, module); … … 1716 1752 // If tag was not specified, then the version directory has to match the CVS tag 1717 1753 // Otherwise the original version specification is kept for the directory. 1718 1719 1754 version = cvs_tag; 1720 1755 dir = build_version_directory (offset, product, version); … … 1722 1757 } 1723 1758 1724 1725 if (check_structure (dir)) 1726 { 1727 cout << "# ================= " << structure_info << " " << product 1728 << " version " << version << echo_ppath 1729 << " already installed." << endl; 1730 1731 recursive = false; 1759 if (check_structure (dir, version)) 1760 { 1761 cout << "# ================= " << structure_info << " " << product 1762 << " version " << version << echo_ppath 1763 << " already installed." << endl; 1764 recursive = false; 1732 1765 } 1733 1766 else
Note:
See TracChangeset
for help on using the changeset viewer.