Changeset 201


Ignore:
Timestamp:
Jun 6, 2006, 3:02:23 PM (18 years ago)
Author:
garonne
Message:

add the touch function during checkout operation

Location:
CMT/HEAD
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r189 r201  
     1
     22006-05-31 Vincent Garonne <garonne@lal.in2p3.fr> 308
     3
     4        * source/cmt_cvs: Add modification to deal with non working checkout by creating the cvs files manually ,e.g. cvs entries.
     5        * source/cmt_cvs: Add the "-f" option which supposes to force cvs to ignore the .cvsrc file during cvs command execution.
     6
    172006-05-20  Christian Arnault  <arnault@lal.in2p3.fr> 307
    28
  • CMT/HEAD/doc/CMTDoc.xml

    r113 r201  
    2222          version='&CMTVersion;'
    2323          author='Christian Arnault'
    24           email='arnault@lal.in2p3.fr'>
     24          email='arnault@lal.in2p3.fr'
     25>         
     26<!--
     27          updated by='Vincent Garonne'
     28          email='garonne@lal.in2p3.fr'
     29-->
     30         
    2531
    2632  <cmt:section title='Presentation'>
     
    46254631   load
    46264632   lock [&amp;lt;p&gt; &lt;v&gt; [&lt;path&gt;]] : lock a package
     4633   relocate                  : generate setup and cleanup scripts (without makefiles)
    46274634   remove &amp;lt;package&gt; &lt;version&gt; [&lt;path&gt;] : remove a package version
    46284635   remove library_links    : remove symbolic links towards all imported libraries
  • CMT/HEAD/mgr/fragments/make_header

    r198 r201  
    108108
    109109#-- end of make_header ------------------
     110
  • CMT/HEAD/source/cmt_cvs.cxx

    r200 r201  
    929929    if (structure_info == "project")
    930930    {
    931              need_version = true;             
     931             need_version = true;
     932             //CmtStructuringStyle style = Cmt::get_current_structuring_style ();
     933         //if (style == default_structuring_style)
     934             //{
     935             //   Use& current_use = Use::current ();
     936             //   if (current_use.get_strategy ("VersionDirectory"))
     937             //      need_version = true;
     938             //}
     939             //else if (style == with_version_directory)
     940             //    need_version = true;               
     941             // cout<<"need version"<<need_version<<endl;
    932942        }
    933943    else
     
    10521062    cout << "  # get project files into " << dir << endl;
    10531063
     1064
    10541065    cmt_string version_dir = version;
    1055 
    10561066    if (!mkdir (version_dir)) return (false);
    10571067
     
    10591069    dir += version_dir;
    10601070   
    1061     cmt_string command = "cvs -Q co -P ";
     1071    cmt_string command = "cvs -f -Q co -P ";
    10621072    if (!at_head)
    10631073      {
     
    10741084    command += CmtSystem::command_separator ();
    10751085
    1076     command += " cvs update -l .";
     1086    command += " cvs -f update -l .";
    10771087
    10781088    execute_and_retry (command, "Error getting project CMT contents");
     
    11921202        text.write (entries_file_name);
    11931203      }
    1194 
    11951204  }
    11961205
     
    12681277    if (branches == "")
    12691278      {
    1270         branches = branches_info;
     1279            branches = branches_info;
    12711280      }
    12721281   
     
    13131322        make_management_files (module, text);
    13141323
     1324        if (need_touch_files)
     1325        { 
     1326   
     1327            cout << "# --> udapte the file timestamps" << endl;                 
     1328            for (i = 0; i < branch_vector.size (); i++)
     1329            {   
     1330                    cmt_string& branch = branch_vector[i];   
     1331                CmtSystem::cmt_string_vector& list = CmtSystem::scan_dir (branch);
     1332                int j;
     1333                for (j = 0; j < list.size (); j++)
     1334                    if (CmtSystem::test_file(list[j]))               
     1335                        CmtSystem::touch_file (list[j]);
     1336            }
     1337        }       
    13151338        return (true);   
    13161339      }
     
    13391362    execute_and_retry (command, "Error getting package contents");
    13401363
     1364    if (need_touch_files)
     1365    { 
     1366   
     1367        cout << "# --> udapte the file timestamps" << endl;                 
     1368        for (i = 0; i < branch_vector.size (); i++)
     1369        {       
     1370                cmt_string& branch = branch_vector[i];   
     1371            CmtSystem::cmt_string_vector& list = CmtSystem::scan_dir (branch);
     1372            int j;
     1373            for (j = 0; j < list.size (); j++)
     1374                if (CmtSystem::test_file(list[j]))               
     1375                    CmtSystem::touch_file (list[j]);
     1376        }
     1377    }       
    13411378    return (true);
    13421379  }
     
    20592096    cout << "   -o offset Offset in the CVS repository" << endl;
    20602097    cout << "   -requirements <requirements file path>  Check out packages referenced in this requirements file" << endl;
     2098    cout << "   -t  Change file timestamps to the date of checkout" << endl;
    20612099    cout << "   -n        simulation mode on" << endl;
    20622100    cout << "   -v        verbose mode on" << endl;
     
    22282266    cmt_string module;
    22292267   
    2230     m_recursive = false;
     2268    m_recursive      = false;
     2269    need_touch_files = false;
    22312270   
    22322271    bool need_version_tag = false;
    22332272    cmt_string version_tag;
     2273   
    22342274   
    22352275    bool need_checkout_dir = false;
     
    22972337                m_recursive = true;
    22982338              }
     2339            else if (option == "-t")
     2340            {   
     2341               need_touch_files = true;
     2342            } 
    22992343            else if (option == "-l")
    23002344              {
     
    23512395
    23522396  bool m_recursive;
     2397  bool need_touch_files;
    23532398  bool m_head;
    23542399  bool m_verbose;
  • CMT/HEAD/source/cmt_system.cxx

    r195 r201  
    413413  return ((s1 == s2));
    414414}
     415
     416//--------------------------------------------------
     417//
     418// Function use to change file timestamps
     419//
     420//--------------------------------------------------
     421bool CmtSystem::touch_file (const cmt_string& name)
     422{
     423    if (CmtSystem::test_file(name))
     424       {
     425            FILE* f = fopen (name, "a+");
     426            if (f != NULL)
     427            {
     428                 cmt_string empty = " ";
     429                 empty.write(f);
     430                 fclose (f);
     431                 return true;
     432             }   
     433        }
     434    return false;
     435}
     436   
    415437
    416438//--------------------------------------------------
  • CMT/HEAD/source/cmt_system.h

    r197 r201  
    5959    /**
    6060     * Implementation of the "test -f" equivalent
    61      */
     61     */               
    6262  static bool test_file (const cmt_string& name);
     63    /**
     64     * Implementation of the "touch" function equivalent
     65     */               
     66  static bool touch_file (const cmt_string& name);   
    6367    /**
    6468     * Check if the file "name1" is identical to "name2"
Note: See TracChangeset for help on using the changeset viewer.