Changeset 22 for CMT


Ignore:
Timestamp:
Mar 30, 2005, 5:00:20 PM (20 years ago)
Author:
arnault
Message:

create project improvements - see CL261

Location:
CMT/v1r19
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CMT/v1r19/ChangeLog

    r21 r22  
    1 2005-03-30    <arnault@lal.in2p3.fr>
     12005-03-30  Christian Arnault  <arnault@lal.in2p3.fr> 261
    22
    33        * doc/table.html: Install link to the Trac bug reporting system. 
    44
    552005-03-30  Christian Arnault  <arnault@lal.in2p3.fr> 261
     6
     7        * source/cmt_project.cxx (create): The create function now creates
     8        the complete directory hierarchy for the project including the
     9        release level(s). Can accept a path.
     10        (create_project): Don't assume a release level.
     11
     12        * source/cmt_project.h (class Project): The create function now accepts a release and a path argument
     13
     14        * source/cmt_commands.cxx (show): Suppress debug printouts
     15        * source/cmt_parser.cxx (do_help): Suppress debug printouts
    616
    717        * source/cmt_system.cxx (is_version_directory): Accept HEAD/head as a valid version directory.
  • CMT/v1r19/source/cmt_commands.cxx

    r15 r22  
    19731973void CommandHelp::show (ActionType action)
    19741974{
    1975   cerr << "CommandHelp::show> action = " << action << endl;
     1975  //cerr << "CommandHelp::show> action = " << action << endl;
    19761976
    19771977  static HelpTexts& help_texts = get_help_texts ();
     
    20552055  help_texts.add () =  "config                  : generate setup and cleanup scripts";
    20562056  help_texts.add () =  "create <package> <version> [<path>] : create and configure a new package";
    2057   help_texts.add () =  "create_project <project> : create and configure a new project";
     2057  help_texts.add () =  "create_project <project> <name> [<path>] : create and configure a new project";
    20582058  help_texts.add () =  "cvsbranches <module>      : display the subdirectories for a module";
    20592059  help_texts.add () =  "cvssubpackagess <module>  : display the subpackages for a module";
  • CMT/v1r19/source/cmt_parser.cxx

    r19 r22  
    24442444
    24452445  const cmt_string& project = ap.arguments[0];
    2446 
    2447   Project::create (project);
     2446  const cmt_string& release = ap.arguments[1];
     2447  cmt_string path;
     2448
     2449  if (ap.arguments.size () >= 3)
     2450    {
     2451      path = ap.arguments[2];
     2452    }
     2453
     2454  Project::create (project, release, path);
    24482455}
    24492456
     
    25872594void Cmt::do_help (const ArgParser& ap)
    25882595{
    2589   cerr << "ap.help_action=" << ap.help_action << " Me.m_action=" << Me.m_action << endl;
     2596  //cerr << "ap.help_action=" << ap.help_action << " Me.m_action=" << Me.m_action << endl;
    25902597  if (Me.m_action == action_none)
    25912598    {
  • CMT/v1r19/source/cmt_project.cxx

    r18 r22  
    200200  cmt_string name;
    201201  cmt_string release;
    202   CmtSystem::basename (compressed_path, release);
    203202
    204203  //
     
    448447
    449448//----------------------------------------------------------
    450 void Project::create (const cmt_string& name)
     449void Project::create (const cmt_string& name,
     450                      const cmt_string& release,
     451                      const cmt_string& path)
    451452{
    452453  cout << "------------------------------------------" << endl;
    453   cout << "Configuring environment for project " << name << endl;
     454  cout << "Configuring environment for project " << name << " " << release;
     455
     456  if (path != "")
     457    {
     458      cout << " in " << path;
     459    }
     460
     461  cout << endl;
    454462  cout << "CMT version " << Cmt::get_cmt_version () << "." << endl;
    455463  cout << "------------------------------------------" << endl;
     464
     465  if (path != "")
     466    {
     467      if (!CmtSystem::mkdir (path))
     468        {
     469          cout << "Cannot create the " << path << " directory" << endl;
     470          return;
     471        }
     472
     473      if (!CmtSystem::cd (path))
     474        {
     475          cout << "Cannot access the " << path << " directory" << endl;
     476          return;
     477        }
     478    }
     479
     480  if (!CmtSystem::mkdir (name))
     481    {
     482      cout << "Cannot create the " << name << " directory" << endl;
     483      return;
     484    }
     485
     486  if (!CmtSystem::cd (name))
     487    {
     488      cout << "Cannot access the " << name << " directory" << endl;
     489      return;
     490    }
     491
     492  if (release != "")
     493    {
     494      if (!CmtSystem::mkdir (release))
     495        {
     496          cout << "Cannot create the " << release << " directory" << endl;
     497          return;
     498        }
     499     
     500      if (!CmtSystem::cd (release))
     501        {
     502          cout << "Cannot access the " << release << " directory" << endl;
     503          return;
     504        }
     505    }
    456506
    457507  if (!CmtSystem::test_directory ("cmt"))
     
    629679void Project::show_all ()
    630680{
    631   /*
    632   static ProjectVector& Projects = projects ();
    633 
    634   for (int i = 0; i < Projects.size (); i++)
    635     {
    636       const Project& project = Projects[i];
    637       project.show ();
    638     }
    639   */
    640 
    641681  static Project::ProjectVector& Projects = Project::projects ();
    642682 
     
    12591299  int i;
    12601300
     1301  /*
    12611302  for (i = 0; i < m_parents.size (); i++)
    12621303    {
     
    12721313      cout << " C=" << p->get_name ();
    12731314    }
     1315  */
    12741316
    12751317  cout << endl;
  • CMT/v1r19/source/cmt_project.h

    r18 r22  
    9595  typedef cmt_vector<Project*> ProjectPtrVector;
    9696
    97   static void create (const cmt_string& name);
     97  static void create (const cmt_string& name,
     98                      const cmt_string& release,
     99                      const cmt_string& path);
    98100
    99101  static Project* find_by_name (const cmt_string& name);
Note: See TracChangeset for help on using the changeset viewer.