Update of /cvsroot/cppunit/cppunit2/devtools
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26100/devtools
Added Files:
syncwithjsoncpp.py
Log Message:
- synchronized with lastest jsoncpp.
--- NEW FILE: syncwithjsoncpp.py ---
# synchronize cppunit2 directory with jsoncpp directory.
# should be executed from script directory.
import os
import os.path
import glob
import shutil
import sys
source_dirs = {
"src/lib_json" : "src/cpptl",
"src/jsontestrunner" : "src/jsontestrunner",
"src/jsontestrunner/sconscript" : "src/jsontestrunner/SConscript",
"include/json" : "include/json",
"scons-tools" : "scons-tools"
}
jsoncpp_dir = '../../jsoncpp'
cppunit2_dir = '..'
if not os.path.exists( os.path.join( cppunit2_dir, 'devtools', 'syncwithjsoncpp.py' ) ):
print 'You must executed this script from the cppunit2/devtools directory.'
sys.Exit(1)
else:
for source_dir, target_dir in source_dirs.items():
source_dir = os.path.join( jsoncpp_dir, source_dir )
target_dir = os.path.join( cppunit2_dir, target_dir )
if os.path.isdir( source_dir ):
print 'Analysing', source_dir
for ext in 'cpp h py'.split():
ext = '*.' + ext
source_files = glob.glob(os.path.join(source_dir, ext))
for source in source_files:
dest_path = os.path.join( target_dir, os.path.split(source)[1] )
print ' => Copying %s to %s' % (source,dest_path)
os.unlink( dest_path )
shutil.copyfile( source, dest_path )
else:
print 'Direct file copy %s to %s' % (source_dir,target_dir)
os.unlink( target_dir )
shutil.copyfile( source_dir, target_dir )
|