Changeset 138


Ignore:
Timestamp:
Jan 31, 2006, 2:27:50 PM (18 years ago)
Author:
garonne
Message:

fixe problems with show clients

Location:
CMT/HEAD/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_awk.cxx

    r79 r138  
    611611  if (level > 10)
    612612    {
    613       //cout << "#PathScanner::scan_path> too deep search path=" << path << endl;
     613      cout << "#PathScanner::scan_path> too deep search path=" << path << endl;
    614614      return;
    615615    }
     
    618618  // Only do something if it is a directory.
    619619  //
    620 
    621620  if (!CmtSystem::test_directory (path)) return;
     621 
    622622
    623623  CmtSystem::cmt_string_vector list;
     
    645645      if (!CmtSystem::test_directory (here)) continue;
    646646
    647       name = "";
     647      name    = "";
    648648      version = "";
    649649
     
    663663      req += CmtSystem::file_separator ();
    664664      req += "requirements";
    665 
     665     
    666666      if (CmtSystem::test_file (req))
    667667        {
     
    673673          CmtSystem::basename (path, name);
    674674
    675           // cout << "#1" << endl;
     675          //cout << "#1" << endl;
    676676
    677677          a.run (name, version, where);
     
    718718              //cout << "#2" << endl;
    719719
    720               a.run (entry, version, path);
     720              a.run (entry, version, path, true);
    721721              has_package = true;
    722722             
     
    764764                  // The structure is with the version directory.
    765765                 
    766                   //cout << "#4" << endl;
     766                  // cout << "#4" << endl;
    767767
    768768                  a.run (name, version, where);
     
    788788          if (CmtSystem::is_version_directory (version))
    789789            {
    790               // cout << "#5" << endl;
     790              //cout << "#5" << endl;
    791791
    792792              a.run (entry, version, where);
     
    801801          where += entry;
    802802
    803           // cout << "#6" << endl;
     803          //cout << "#6" << endl;
    804804
    805805          a.run (name, "v1", where);
     
    828828          p += e;
    829829
    830             /*
    831           for (j = 1; j < _level; j++) cout << "  ";
     830           
     831          for (int j = 1; j < _level; j++) cout << "  ";
    832832          cout << "Restarting scan_path on p=" << p << endl;
    833             */
     833           
    834834
    835835          cout << "#PathScanner::scan_path> Restarting scan_path on p=" << p << endl;
  • CMT/HEAD/source/cmt_awk.h

    r11 r138  
    111111    virtual void run (const cmt_string& package,
    112112                      const cmt_string& version,
    113                       const cmt_string& path)
     113                      const cmt_string& path,
     114                      const bool without_version_directory=false)
    114115    {
    115116    }
  • CMT/HEAD/source/cmt_parser.cxx

    r137 r138  
    111111  void run (const cmt_string& package,
    112112            const cmt_string& version,
    113             const cmt_string& path);
     113            const cmt_string& path,
     114            const bool without_version_directory=false);
    114115};
    115116
     
    125126  void run (const cmt_string& package,
    126127            const cmt_string& version,
    127             const cmt_string& path);
     128            const cmt_string& path,
     129            const bool without_version_directory=false);
    128130private:
    129131  CmtSystem::cmt_string_vector& m_uses;
     
    143145  void run (const cmt_string& package,
    144146            const cmt_string& version,
    145             const cmt_string& path);
     147            const cmt_string& path,
     148            const bool without_version_directory=false);
    146149  int count ();
    147150
     
    155158void PackageViewer::run (const cmt_string& package,
    156159                         const cmt_string& version,
    157                          const cmt_string& path)
     160                         const cmt_string& path,
     161                         const bool without_version_directory)
    158162{
    159163  cout << package << " " << version << " " << path << endl;
     
    168172void PackageSelector::run (const cmt_string& package,
    169173                           const cmt_string& version,
    170                            const cmt_string& path)
     174                           const cmt_string& path,
     175                           const bool without_version_directory)
    171176{
    172177  //
     
    235240void ClientCollector::run (const cmt_string& package,
    236241                           const cmt_string& version,
    237                            const cmt_string& path)
     242                           const cmt_string& path,
     243                           const bool without_version_directory)
    238244{
    239245  cmt_string dir = path;
    240246  dir += CmtSystem::file_separator ();
    241247  dir += package;
    242   dir += CmtSystem::file_separator ();
    243   if (version != "")
     248  dir += CmtSystem::file_separator ();     
     249  if (version != "" && ! without_version_directory)
    244250    {
    245251      dir += version;
     
    248254
    249255  cmt_string req;
    250 
    251   req = dir;
     256 
     257  req  = dir;
    252258  req += "cmt";
    253259  req += CmtSystem::file_separator ();
     
    318324          CmtSystem::split (line, " \t", words);
    319325
    320           if ((words.size () > 2) && (words[0] == "use"))
     326          if ((words.size () >= 2) && (words[0] == "use"))
    321327            {
    322328              if ((words[1] == m_package) &&
    323                   ((words[2] == m_version) || (m_version == "")))
     329                  ( (m_version == "") || (words[2] == m_version)))
    324330                {
    325331                  cout << "# " << package << " " << version << " " << path;
    326                   if (m_version == "")
     332                  if (m_version == "" && words.size () > 2)
    327333                    {
    328334                      cout << " (use version " << words[2] << ")";
     
    32883294void Cmt::do_show_clients (const ArgParser& ap)
    32893295{
    3290   cmt_string package;
    3291   cmt_string version;
    3292   cmt_string path_name;
    3293 
    3294   if (ap.arguments.size () >= 1) package = ap.arguments[0];
    3295   if (ap.arguments.size () >= 2) version = ap.arguments[1];
     3296  cmt_string package   = "";
     3297  cmt_string version   = "";
     3298  cmt_string path_name = "";
     3299
     3300  if (ap.arguments.size () >= 1) package  = ap.arguments[0];
     3301  if (ap.arguments.size () >= 2) version  = ap.arguments[1];
    32963302  if (ap.arguments.size () >= 3) path_name = ap.arguments[2];
    32973303
     
    32993305  ClientCollector collector (package, version);
    33003306
    3301   clear ();
     3307  clear     ();
    33023308  configure ();
    33033309
     
    35543560  if (ap.arguments.size () > 0) path_name = ap.arguments[0];
    35553561
    3556   PathScanner scanner;
     3562  PathScanner   scanner;
    35573563  PackageViewer viewer;
    35583564
  • CMT/HEAD/source/cmt_project.cxx

    r136 r138  
    204204  sep = CmtSystem::path_separator ();
    205205
    206   cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH");
     206  cmt_string cmtprojectpath = Symbol::get_env_value ("CMTPROJECTPATH"); 
    207207  CmtSystem::cmt_string_vector items;
    208208  CmtSystem::split (cmtprojectpath, sep, items);
     
    978978  for (i = 0; i < Projects.size (); i++)
    979979    {
    980       Project& p = Projects[i];
     980      Project& p  = Projects[i];
    981981      p.m_visited = false;
    982982    }
     
    985985    {
    986986      const Project& project = Projects[i];
    987 
     987       
    988988      const cmt_string& p = project.m_cmtpath;
    989989      scanner.scan_path (p, a);
Note: See TracChangeset for help on using the changeset viewer.