← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1856: 1. make realVersion to be bzr revision

 

------------------------------------------------------------
revno: 1856
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Sat 2009-12-05 11:45:14 +0100
message:
  1. make realVersion to be bzr revision
  2. Re-enable Controller at startup always
  3. Always rebuild python template files invisibly, since they wouldn't spot revision change otherwise (very fast)
modified:
  SConstruct
  core/SConscript
  core/main/main.py.in
  py/SConscript
  scripts/scanreplace.py
  yadeSCons.py


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'SConstruct'
--- SConstruct	2009-12-04 23:07:34 +0000
+++ SConstruct	2009-12-05 10:45:14 +0000
@@ -198,14 +198,11 @@
 ###########################################
 import yadeSCons
 ## ALL generated stuff should go here - therefore we must determine it very early!!
-if not env.has_key('version'):
-	env['realVersion']=yadeSCons.getRealVersion()
-	if not env['realVersion']: env['realVersion']='unknown'
-	env['version']=env['realVersion']
-if not env.has_key('realVersion') or not env['realVersion']: env['realVersion']=env['version']
+env['realVersion']=yadeSCons.getRealVersion() or 'unknown' # unknown if nothing returned
+if not env.has_key('version'): env['version']=env['realVersion']
 
 env['SUFFIX']='-'+env['version']+env['variant']
-print "Yade version is `%s', installed files will be suffixed with `%s'."%(env['version'],env['SUFFIX'])
+print "Yade version is `%s' (%s), installed files will be suffixed with `%s'."%(env['version'],env['realVersion'],env['SUFFIX'])
 # make buildDir absolute, saves hassles later
 buildDir=os.path.abspath(env.subst('$buildPrefix/build$SUFFIX'))
 print "All intermediary files will be in `%s'."%env.subst(buildDir)
@@ -544,6 +541,7 @@
 	#env.InstallAs(env['PREFIX']+'/include/yade-'+env['version']+'/boost/foreach.hpp',foreachTarget)
 	env.Default(env.Alias('install',['$PREFIX/bin','$PREFIX/lib'])) # build and install everything that should go to instDirs, which are $PREFIX/{bin,lib} (uses scons' Install)
 
+
 env.Export('env');
 
 ######

=== modified file 'core/SConscript'
--- core/SConscript	2009-12-04 23:07:34 +0000
+++ core/SConscript	2009-12-05 10:45:14 +0000
@@ -1,16 +1,17 @@
+# syntax: python
 Import('*')
 
 pyMain='$PREFIX/bin/yade$SUFFIX'
-env.InstallAs(pyMain,env.ScanReplace('main/main.py.in'))
-
-env.InstallAs(pyMain,env.File(env.ScanReplace('main/main.py.in'),''))
+target=env.ScanReplace('main/main.py.in')
+env.AlwaysBuild(target)
+env.InstallAs(pyMain,target)
 env.AddPostAction(pyMain,Chmod(pyMain,0755))
 
 env.Install('$PREFIX/lib/yade$SUFFIX/py/yade',[
 	env.SharedLibrary('boot',['main/pyboot.cpp'],SHLIBPREFIX='',LIBS=env['LIBS']+['yade-support','core'])
 ])
 
-env.InstallAs('$PREFIX/bin/yade$SUFFIX-cxx',env.Program('yade',['main/main.cpp'],LIBS=env['LIBS']+['yade-support','core'],CPPDEFINES=env['CPPDEFINES']+[('YADE_VERSION','\\"'+env['realVersion']+'\\"'),]))
+env.InstallAs('$PREFIX/bin/yade$SUFFIX-cxx',env.Program('yade',['main/main.cpp'],LIBS=env['LIBS']+['yade-support','core'],CPPDEFINES=env['CPPDEFINES']+[('YADE_VERSION','\\"'+env['version']+'\\"'),]))
 
 env.Install('$PREFIX/lib/yade$SUFFIX/lib',[
 	env.SharedLibrary('core',

=== modified file 'core/main/main.py.in'
--- core/main/main.py.in	2009-12-04 21:56:59 +0000
+++ core/main/main.py.in	2009-12-05 10:45:14 +0000
@@ -20,9 +20,11 @@
 	par.add_option('--no-gdb',help='Do not show backtrace when yade crashes.',dest='noGdb',action='store_true',)
 
 opts,args=par.parse_args()
-# c++-boot code checks for YADE_DEBUG at some places; debug verbosity is equivalent
+# c++ boot code checks for YADE_DEBUG at some places; debug verbosity is equivalent
 if opts.verbosity>1: os.environ['YADE_DEBUG']='1'
 
+print 'Welcome to Yade '+version
+
 # initialization and c++ plugins import
 import yade
 # other parts we will need soon
@@ -48,6 +50,7 @@
 try:
 	import yade.qt
 	qtEnabled=True
+	yade.qt.Controller()
 except ImportError: pass
 
 # prepare nice namespace for users

=== modified file 'py/SConscript'
--- py/SConscript	2009-12-04 23:07:34 +0000
+++ py/SConscript	2009-12-05 10:45:14 +0000
@@ -20,8 +20,8 @@
 		linkPlugins(['Shop','SpherePack']),
 		]),
 	env.SharedLibrary('_packObb',['_packObb.cpp'],SHLIBPREFIX=''),
-	env.ScanReplace('__init__.py.in'),
-	env.ScanReplace('config.py.in'),
+	env.AlwaysBuild(env.ScanReplace('__init__.py.in')),
+	env.AlwaysBuild(env.ScanReplace('config.py.in')),
 	env.File('utils.py'),
 	env.File('ymport.py'),
 	env.File('eudoxos.py'),

=== modified file 'scripts/scanreplace.py'
--- scripts/scanreplace.py	2009-12-01 22:24:00 +0000
+++ scripts/scanreplace.py	2009-12-05 10:45:14 +0000
@@ -8,7 +8,7 @@
     return 0
 
 def replace_string(target, source, env):
-    return "R %s %s" % (str(source[0]), str(target[0]))
+    return None #"T %s %s" % (str(source[0]), str(target[0]))
 
 def generate(env, **kw):
     action = env.Action(replace_action, replace_string)

=== modified file 'yadeSCons.py'
--- yadeSCons.py	2009-12-03 20:57:11 +0000
+++ yadeSCons.py	2009-12-05 10:45:14 +0000
@@ -5,9 +5,8 @@
 	if os.path.exists('RELEASE'):
 		return file('RELEASE').readline().strip()
 	if os.path.exists('.bzr'):
-		for l in os.popen("LC_ALL=C bzr version-info 2>/dev/null").readlines():
-			m=re.match(r'revno: ([0-9]+)',l)
-			if m: return 'bzr'+m.group(1)
+		for l in os.popen("LC_ALL=C bzr revno 2>/dev/null").readlines():
+			return 'bzr'+l[:-1]
 	return None