From b00b48ea217b8c17451b968ee86e50fcd31d7d5d Mon Sep 17 00:00:00 2001 From: Claudio-Daniel Freire Date: Wed, 4 May 2011 18:39:40 +0200 Subject: [PATCH] Do not rebuild ns3 if it's already built. Normally, make and friends already do this natively, but waf seems to get confused because we do ./waf clean --- src/nepi/testbeds/planetlab/application.py | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/nepi/testbeds/planetlab/application.py b/src/nepi/testbeds/planetlab/application.py index 371d2e8f..d22e3a36 100644 --- a/src/nepi/testbeds/planetlab/application.py +++ b/src/nepi/testbeds/planetlab/application.py @@ -498,7 +498,15 @@ class NS3Dependency(Dependency): pybindgen_source_url = "http://pybindgen.googlecode.com/files/pybindgen-0.15.0.zip" pygccxml_source_url = "http://leaseweb.dl.sourceforge.net/project/pygccxml/pygccxml/pygccxml-1.0/pygccxml-1.0.0.zip" ns3_source_url = "http://yans.pl.sophia.inria.fr/code/hgwebdir.cgi/ns-3-dev/archive/tip.tar.gz" - self.build =("wget -q -c -O pybindgen-src.zip %(pybindgen_source_url)s && " # continue, to exploit the case when it has already been dl'ed + self.build =( + " ( " + " cd .. && " + " python -c 'import pygccxml, pybindgen' && " + " test -f lib/_ns3.so && " + " test -f lib/libns3.so " + " ) || ( " + # Not working, rebuild + "wget -q -c -O pybindgen-src.zip %(pybindgen_source_url)s && " # continue, to exploit the case when it has already been dl'ed "wget -q -c -O pygccxml-1.0.0.zip %(pygccxml_source_url)s && " "wget -q -c -O ns3-src.tar.gz %(ns3_source_url)s && " "unzip -n pybindgen-src.zip && " # Do not overwrite files, to exploit the case when it has already been built @@ -525,6 +533,7 @@ class NS3Dependency(Dependency): "./waf &&" "./waf install && " "./waf clean" + " )" % dict( pybindgen_source_url = server.shell_escape(pybindgen_source_url), pygccxml_source_url = server.shell_escape(pygccxml_source_url), @@ -533,8 +542,16 @@ class NS3Dependency(Dependency): # Just move ${BUILD}/target self.install = ( - "( for i in ${BUILD}/target/* ; do rm -rf ${SOURCES}/${i##*/} ; done ) && " # mv doesn't like unclean targets - "mv -f ${BUILD}/target/* ${SOURCES}" + " ( " + " cd .. && " + " python -c 'import pygccxml, pybindgen' && " + " test -f lib/_ns3.so && " + " test -f lib/libns3.so " + " ) || ( " + # Not working, reinstall + "( for i in ${BUILD}/target/* ; do rm -rf ${SOURCES}/${i##*/} ; done ) && " # mv doesn't like unclean targets + "mv -f ${BUILD}/target/* ${SOURCES}" + " )" ) # Set extra environment paths -- 2.47.0