Changeset 541 for CMT


Ignore:
Timestamp:
Apr 2, 2010, 5:37:35 PM (14 years ago)
Author:
rybkin
Message:

See C.L. 428

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r540 r541  
     12010-04-02    <rybkin@lal.in2p3.fr> 428
     2
     3        * mgr/requirements: Introduce cmt_parallel_bins tag to enable locking
     4        mechanism which allows for simultaneous/parallel builds for multiple binary
     5        tags (not activated by default)
     6        * source/cmt_commands.cxx: Introduce optional arguments [<path>]... for
     7        "cmt show container" command
     8        * source/cmt_parser.cxx: Implement introduced additional functionality of
     9        "cmt show container" command
     10        * source/cmt_project.h: idem
     11        * source/cmt_project.cxx: idem
     12       
    1132010-03-31    <rybkin@lal.in2p3.fr> 427
    214
  • CMT/HEAD/mgr/requirements

    r524 r541  
    464464
    465465macro lock_command "" \
    466       Linux        "lockfile " \
    467       Darwin       "lockfile " \
    468       VisualC      "%CMTROOT%\mgr\cmt_lockfile.bat "
     466      cmt_parallel_bins&Linux        "lockfile " \
     467      cmt_parallel_bins&Darwin       "lockfile " \
     468      cmt_parallel_bins&VisualC      "%CMTROOT%\mgr\cmt_lockfile.bat "
    469469
    470470macro unlock_command "rm -rf " \   
  • CMT/HEAD/source/cmt_commands.cxx

    r537 r541  
    13141314      else if (arg == "container")
    13151315        {
     1316          if (argc > 0)
     1317            {
     1318              fill_arguments ();
     1319            }
    13161320          cmt.m_action = action_show_container;
    13171321        }
     
    22862290  help_texts.add () =  "show  constituent_names :  constituent names";
    22872291  help_texts.add () =  "show  constituents      :  constituent definitions";
    2288   help_texts.add () =  "show  container         :  container package of current project";
     2292  help_texts.add () =  "show  container [<path>]... :  container package of current project [or <path>s projects]";
    22892293  help_texts.add () =  "show  cycles            :  cycles in the use graph";
    22902294  help_texts.add () =  "show  fragment <name>   :  one fragment definition";
  • CMT/HEAD/source/cmt_parser.cxx

    r537 r541  
    40204020
    40214021//----------------------------------------------------------
    4022 void Cmt::do_show_container (const ArgParser& /*ap*/)
    4023 {
    4024   Project::show_container ();
     4022void Cmt::do_show_container (const ArgParser& ap)
     4023{
     4024  if (ap.arguments.size () == 0)
     4025    {
     4026      Project::show_container ();
     4027    }
     4028  else
     4029    {
     4030      for (int i = 0; i < ap.arguments.size (); i++)
     4031        {
     4032          const cmt_string& path_name = ap.arguments[i];
     4033          if (CmtSystem::test_directory (path_name))
     4034            {
     4035              Project::show_container (path_name);
     4036            }
     4037          else
     4038            {
     4039              CmtMessage::warning ("No such directory: " + path_name);
     4040              CmtError::set (CmtError::path_not_found, path_name);
     4041            }
     4042        }
     4043    }
    40254044}
    40264045
  • CMT/HEAD/source/cmt_project.cxx

    r540 r541  
    12811281
    12821282/*----------------------------------------------------------*/
    1283 void Project::show_container ()
    1284 {
    1285   Project* p = get_current ();
    1286 
    1287   if (p == 0) return;
     1283void Project::show_container (const cmt_string& path)
     1284//void Project::show_container ()
     1285{
     1286  Project* p (0);
     1287  if (path == "")
     1288    {
     1289      p = get_current ();
     1290    }
     1291  else
     1292    {
     1293      p = find_by_cmtpath (find_in_cmt_paths (path));
     1294    }
     1295
     1296  if (p == 0)
     1297    {
     1298      cmt_string msg ("No project found for path "
     1299                      + (path != "" ? path : (Use::current()).real_path)
     1300                      );
     1301      CmtMessage::warning (msg);
     1302      CmtError::set (CmtError::warning, msg);
     1303      return;
     1304    }
    12881305  Use* use = &(p->m_container);
    1289   if (use->get_package_name () == "") return;
    1290 
    1291           if (!use->located ())
    1292             {
    1293               CmtMessage::warning ("container " + use->get_package_name ()
    1294                                    + " " + use->version + " " + use->path
    1295                                    + " not found");
    1296               /*
    1297               if (!Cmt::get_quiet ())
    1298                 {
    1299                   cout << "# package " << use->get_package_name () <<
    1300                     " " << use->version << " " << use->path <<
    1301                     " not found" <<
    1302                     endl;
    1303                 }
    1304               */
    1305               CmtError::set (CmtError::package_not_found, use->get_package_name ());
    1306             }
    1307           else
    1308             {
    1309               static const cmt_string empty;
    1310               cmt_string p = use->real_path;
    1311               if (use->path != "")
    1312                 {
    1313                   int pos = p.find_last_of (use->path);
    1314                   if (pos != cmt_string::npos)
    1315                     {
    1316                       p.erase (pos);
    1317                     }
    1318                 }
    1319              
    1320               cout << "container " << use->get_package_name ()
    1321                    << " " << use->version;
    1322 
    1323               if (CmtSystem::absolute_path (use->path))
    1324                 {
    1325                   if (!Cmt::get_quiet ())
    1326                     {
    1327                       cout << " (" << use->path << ")";
    1328                     }
    1329                 }
    1330               else
    1331                 {
    1332                   cout << " " << use->path;
    1333                 }
    1334 
    1335               if (!Cmt::get_quiet ())
    1336                 {
    1337                   if (p != "") cout << " (" << p << ")";
    1338                   if (use->auto_imports == Off) cout << " (no_auto_imports)";
    1339                 }
    1340 
    1341               cout << endl;
    1342             }
    1343 }
     1306  if (use->get_package_name () == "")
     1307    {
     1308      cmt_string msg ("No container specified for project " + p->get_name ()
     1309                      + " (" + p->get_cmtpath () + ")");
     1310      CmtMessage::warning (msg);
     1311      CmtError::set (CmtError::warning, msg);
     1312      return;
     1313    }
     1314 
     1315  if (!use->located ())
     1316    {
     1317      CmtMessage::warning ("container " + use->get_info ()
     1318                           + " not found");
     1319      CmtError::set (CmtError::package_not_found, use->get_package_name ());
     1320    }
     1321  else
     1322    {
     1323      static const cmt_string empty;
     1324      cmt_string p = use->real_path;
     1325      if (use->path != "")
     1326        {
     1327          int pos = p.find_last_of (use->path);
     1328          if (pos != cmt_string::npos)
     1329            {
     1330              p.erase (pos);
     1331            }
     1332        }
     1333     
     1334      cout << "container " << use->get_package_name ()
     1335           << " " << use->version;
     1336     
     1337      if (CmtSystem::absolute_path (use->path))
     1338        {
     1339          if (!Cmt::get_quiet ())
     1340            {
     1341              cout << " (" << use->path << ")";
     1342            }
     1343        }
     1344      else
     1345        {
     1346          cout << " " << use->path;
     1347        }
     1348     
     1349      if (!Cmt::get_quiet ())
     1350        {
     1351          if (p != "") cout << " (" << p << ")";
     1352          if (use->auto_imports == Off) cout << " (no_auto_imports)";
     1353        }
     1354     
     1355      cout << endl;
     1356    }
     1357}
     1358
    13441359/*----------------------------------------------------------*/
    13451360void Project::show_specified_strategies_for_all ()
  • CMT/HEAD/source/cmt_project.h

    r535 r541  
    113113  static void clear_all ();
    114114  static void show_all ();
    115   static void show_container ();
     115  static void show_container (const cmt_string& path = "");
    116116  static void show_specified_strategies_for_all ();
    117117  static void show_paths (const CmtSystem::cmt_string_vector& arguments);
Note: See TracChangeset for help on using the changeset viewer.