← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2261: 1. Fix bibliography path in generated docs

 

------------------------------------------------------------
revno: 2261
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-05-28 22:57:41 +0200
message:
  1. Fix bibliography path in generated docs
  2. Fix bug #582679 hopefully (compile error with clean builds) 
  3. Add import gts to gts related function in yade.pack, to make the error message more informative
  4. Rewrite scripts/debian-prep in python instead of shell
  5. Add qglviewer to some versions in debian/control-template
modified:
  debian/control-template
  doc/sphinx/yadeSphinx.py
  gui/SConscript
  lib/base/openmp-accu.hpp
  py/pack/pack.py
  scripts/debian-prep


--
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 'debian/control-template'
--- debian/control-template	2010-05-04 21:57:09 +0000
+++ debian/control-template	2010-05-28 20:57:41 +0000
@@ -2,7 +2,7 @@
 Section: x11
 Priority: optional
 Maintainer: Václav Šmilauer <eudoxos@xxxxxxxx>
-Build-Depends: debhelper (>= 5), scons, libqt3-mt-dev, qt3-dev-tools, freeglut3-dev, libboost-dev (>=1.34), libboost-date-time-dev (>=1.34), libboost-filesystem-dev (>=1.34), libboost-thread-dev (>=1.34), libboost-regex-dev (>=1.34), libboost-python-dev (>=1.34), libboost-iostreams-dev (>=1.34), libboost-program-options-dev, libboost-serialization-dev, liblog4cxx9-dev | liblog4cxx10-dev, docbook-to-man, ipython, libsqlite3-dev, libgts-dev, python-numpy, g++(>4.0), libvtk5-dev, libgl1-mesa-swx11-dev, gdb, ipython, python-matplotlib, python-tk, libeigen2-dev
+Build-Depends: debhelper (>= 5), scons, libqt3-mt-dev, qt3-dev-tools, freeglut3-dev, libboost-dev (>=1.34), libboost-date-time-dev (>=1.34), libboost-filesystem-dev (>=1.34), libboost-thread-dev (>=1.34), libboost-regex-dev (>=1.34), libboost-python-dev (>=1.34), libboost-iostreams-dev (>=1.34), libboost-program-options-dev, libboost-serialization-dev, liblog4cxx9-dev | liblog4cxx10-dev, docbook-to-man, ipython, libsqlite3-dev, libgts-dev, python-numpy, g++(>4.0), libvtk5-dev, libgl1-mesa-dev, gdb, ipython, python-matplotlib, python-tk, libeigen2-dev @', libqglviewer-qt3-dev' if DISTRIBUTION!='hardy' else ''@ @', binutils-gold' if DISTRIBUTION not in ('hardy','intrepid','jaunty','lenny') else ''@
 Standards-Version: 3.7.2
 
 Package: yade@_VERSION@

=== modified file 'doc/sphinx/yadeSphinx.py'
--- doc/sphinx/yadeSphinx.py	2010-05-17 08:51:45 +0000
+++ doc/sphinx/yadeSphinx.py	2010-05-28 20:57:41 +0000
@@ -173,9 +173,9 @@
 	import sys
 	sys.path.append('.')
 	import bib2rst # our module
-	f=open('../references.rst','w')
+	f=open('references.rst','w')
 	f.write('References\n'+40*'='+'\n\n\n')
-	f.write(bib2rst.bib2rst('references.bib'))
+	f.write(bib2rst.bib2rst('../references.bib'))
 	f.close()
 
 

=== modified file 'gui/SConscript'
--- gui/SConscript	2010-05-19 07:45:06 +0000
+++ gui/SConscript	2010-05-28 20:57:41 +0000
@@ -40,6 +40,8 @@
 	# Not clear why scons is not picking up the dependency automatically
 	# Do not remove.
 	#
-	gens=['$buildDir/gui/qt3/'+h for h in 'QtGeneratedSimulationController.h','QtGeneratedMessageDialog.h','YadeQtGeneratedMainWindow.h','QtFileGeneratorController.h']
-	env.Depends(['qt3/FileDialog.cpp','qt3/GLViewer.cpp','qt3/MessageDialog.cpp','qt3/QtFileGenerator.cpp','qt3/QtGUI.cpp','qt3/QtGUIPreferences.cpp','qt3/SimulationController.cpp','qt3/YadeQtMainWindow.cpp','qt3/YadeCamera.cpp'],gens)
+	srcs=['FileDialog','GLViewer','MessageDialog','QtFileGenerator','QtGUI','QtGUIPreferences','SimulationController','YadeQtMainWindow','YadeCamera']
+	uis=['QtGeneratedSimulationController','QtGeneratedMessageDialog','YadeQtGeneratedMainWindow',	'QtFileGeneratorController']
+	for ui in uis:
+		for s in srcs: env.AddPreAction('$buildDir/gui/qt3/%s.os'%s,'$QT_UIC -o $buildDir/gui/qt3/%s.h gui/qt3/%s.ui'%(ui,ui))
 

=== modified file 'lib/base/openmp-accu.hpp'
--- lib/base/openmp-accu.hpp	2010-03-29 15:48:04 +0000
+++ lib/base/openmp-accu.hpp	2010-05-28 20:57:41 +0000
@@ -1,4 +1,5 @@
 // 2010 © Václav Šmilauer <eudoxos@xxxxxxxx>
+#pragma once 
 
 #ifdef YADE_OPENMP
 #include"omp.h"

=== modified file 'py/pack/pack.py'
--- py/pack/pack.py	2010-05-26 17:49:15 +0000
+++ py/pack/pack.py	2010-05-28 20:57:41 +0000
@@ -107,6 +107,7 @@
 
 def gtsSurface2Facets(surf,**kw):
 	"""Construct facets from given GTS surface. **kw is passed to utils.facet."""
+	import gts
 	return [utils.facet([v.coords() for v in face.vertices()],**kw) for face in surf]
 
 def sweptPolylines2gtsSurface(pts,threshold=0,capStart=False,capEnd=False):
@@ -121,6 +122,7 @@
 
 .. warning:: the algorithm connects points sequentially; if two polylines are mutually rotated or have inverse sense, the algorithm will not detect it and connect them regardless in their given order.
 	"""
+	import gts # will raise an exception in gts-less builds
 	if not len(set([len(pts1) for pts1 in pts]))==1: raise RuntimeError("Polylines must be all of the same length!")
 	vtxs=[[gts.Vertex(x,y,z) for x,y,z in pts1] for pts1 in pts]
 	sectEdges=[[gts.Edge(vtx[i],vtx[i+1]) for i in xrange(0,len(vtx)-1)] for vtx in vtxs]
@@ -159,6 +161,7 @@
 	"""Return (Vector3 center, Vector3 halfSize, Quaternion orientation) describing
 	best-fit oriented bounding box (OBB) for the given surface. See cloudBestFitOBB
 	for details."""
+	import gts
 	pts=[Vector3(v.x,v.y,v.z) for v in surf.vertices()]
 	return cloudBestFitOBB(tuple(pts))
 

=== modified file 'scripts/debian-prep'
--- scripts/debian-prep	2010-01-11 22:39:05 +0000
+++ scripts/debian-prep	2010-05-28 20:57:41 +0000
@@ -1,44 +1,48 @@
-#!/bin/sh
-# this script must be run from yade's top-level directory!
-#
-# if there is file RELEASE, it will be the version number ($VERSION) and SNAPSHOT will be empty.
-# Otherwise svn or bzr versioning information will be used. Errors out if RELEASE or .svn or .bzr don't exist.
-#
-# Takes one optional argument with the name of $DISTRIBUTION (default: unstable)
-#
-
-## DISTRIBUTION (first argument, otherwise the default "unstable")
-DISTRIBUTION=$1; [ -n "$DISTRIBUTION" ] || DISTRIBUTION="unstable"
-## create VERSION file (from RELEASE or svn or bzr)
-if [ -f RELEASE ]; then	VERSION=`cat RELEASE`; SNAPSHOT=""
-elif [ -d .svn ]; then VERSION="svn$( svn info | egrep '^Revision:' | cut -f2 -d' ')"; SNAPSHOT="-snapshot"
-elif [ -d .bzr ]; then VERSION="bzr$( bzr revno )"; SNAPSHOT="-snapshot"
-else echo 'Revision could not be determined (RELEASE or .svn or .bzr)' >2; exit 1;
-fi
-# compute version priority:
-# * releases get 10000*version (discarding anything not digit and dot)
-# * snapshots get their revision number (discarding anything not digit)
-# This way, releases have always higher number than snapshots and
-# both releases and snapshots are properly ordered
-if [ -f RELEASE ]; then PRIORITY=$( echo 10000\*`cat RELEASE | sed s'/[^0-9.]//g'` | bc | cut -d. -f1 )
-else PRIORITY=$( echo $VERSION | sed s'/[^0-9]//g' )
-fi
-_VERSION="-$VERSION"; echo $VERSION > VERSION
-echo PRIORITY $PRIORITY
-# process templates
-cp debian/yade.postinst-template debian/yade$_VERSION.postinst
-cp debian/yade-dbg.postinst-template debian/yade$_VERSION-dbg.postinst
-cp debian/yade.prerm-template debian/yade$_VERSION.prerm
-cp debian/yade-dbg.prerm-template debian/yade$_VERSION-dbg.prerm
-cp debian/control-template debian/control; perl -pi -e"s/\@VERSION\@/$VERSION/g; s/\@_VERSION\@/$_VERSION/g; s/\@SNAPSHOT\@/$SNAPSHOT/g; s/\@PRIORITY\@/$PRIORITY/g;" debian/control debian/yade$_VERSION.postinst debian/yade$_VERSION-dbg.postinst debian/yade$_VERSION.prerm debian/yade$_VERSION-dbg.prerm;
+#!/usr/bin/python
+# encoding: utf-8
+import sys,os.path,re,shutil,time
+DISTRIBUTION=sys.argv[1] if len(sys.argv)>1 else 'unstable'
+if os.path.exists('RELEASE'):
+	VERSION=file('RELEASE').readline().strip()
+	SNAPSHOT=''
+	PRIORITY=int(10000*float(re.sub('[^0-9.]','',VERSION)))
+	if re.match('^.*beta',VERSION): PRIORITY-=100
+	if re.match('^.*rc[0-9]$',VERSION): PRIORITY-=100
+elif os.path.exists('.bzr'):
+	VERSION='bzr'+os.popen("LC_ALL=C bzr revno 2>/dev/null").readlines()[0][:-1]
+	SNAPSHOT='-snapshot'
+	PRIORITY=int(re.sub('[^0-9]','',VERSION))
+else:
+	raise RuntimeError('Revision could not be determined (RELEASE or .bzr)')
+print 'version %s%s, priority %d'%(VERSION,SNAPSHOT,PRIORITY)
+open('VERSION','w').write(VERSION+'\n')
+_VERSION='-'+VERSION #used in templates
+
+# control files
+def copyReplace(f1,f2):
+	"Copy file f1 to f2, evaluating all occurences of @...@ with eval(); they should expand to a string and can contain arbitrary python expressions."
+	ff2=open(f2,'w')
+	for l in open(f1):
+		ff2.write(re.sub(r'@([^@]*)@',lambda m: str(eval(m.group(1))),l))
+for f1,f2 in [
+	('yade.postinst-template','yade-%s.postinst'%VERSION),
+	('yade-dbg.postinst-template','yade-%s-dbg.postinst'%VERSION),
+	('yade.prerm-template','yade-%s.prerm'%VERSION),
+	('yade-dbg.prerm-template','yade-%s-dbg.prerm'%VERSION),
+	('control-template','control')]:
+		copyReplace('debian/'+f1,'debian/'+f2)
+
 # write debian/changelog
-DEBDATE=`date -R`
-cat <<EOF > debian/changelog
-yade$_VERSION (1~$DISTRIBUTION) $DISTRIBUTION; urgency=low
-
-  * Automatic debian changelog entry for yade$_VERSION
-
- -- Václav Šmilauer <eudoxos@xxxxxxxx>  $DEBDATE
-EOF
-# remove generated files that shouldn't be in the orig.tar.gz
-rm -rf tags doc/doxygen doc/html doc/epydoc
+open('debian/changelog','w').write(
+'''yade-%s (1~%s) %s; urgency=low
+
+  * Automatic debian changelog entry for yade-%s
+
+ -- Václav Šmilauer <eudoxos@xxxxxxxx>  %s
+'''%(VERSION,DISTRIBUTION,DISTRIBUTION,VERSION,time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime())))
+
+# remove some generated files
+for p in ('doc/doxygen','doc/sphinx/_build','tags'):
+	if not os.path.exists(p): continue
+	if os.path.isdir(p): shutil.rmtree(p)
+	else: os.remove(p)


Follow ups