From 19b8436da08754e2c3de452aa1668c6151e8a4d9 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 15 Feb 2011 13:15:24 +0000 Subject: [PATCH] * /CMakeLists.txt: - Change: For the setup_sysconfdir() boostrap/cmake macro uses the CMAKE_INSTALL_PREFIX to guess where we are being installed. Should be more reliable than any *_TOP environment variable. * ./bootstrap: - Change: In builCoriolis.py, detect not only when the X_TOP is not sets but also when it's sets to an empty value. In either case gives priority of the X_USER_TOP over the X_TOP. --- bootstrap/CMakeLists.txt | 2 +- bootstrap/buildCoriolis.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bootstrap/CMakeLists.txt b/bootstrap/CMakeLists.txt index 7c5be6a8..df208c73 100644 --- a/bootstrap/CMakeLists.txt +++ b/bootstrap/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(Bootstrap REQUIRED) print_cmake_module_path() - setup_sysconfdir("$ENV{BOOTSTRAP_TOP}") + setup_sysconfdir("${CMAKE_INSTALL_PREFIX}") install(FILES coriolisEnv.py coriolis2.sh DESTINATION ${SYS_CONF_DIR}/coriolis2 diff --git a/bootstrap/buildCoriolis.py b/bootstrap/buildCoriolis.py index a787f9dc..3046b4c1 100755 --- a/bootstrap/buildCoriolis.py +++ b/bootstrap/buildCoriolis.py @@ -381,14 +381,19 @@ class ProjectBuilder: def _setEnvironment ( self, systemVariable, userVariable ): - if not self._environment.has_key(systemVariable): - self._environment[ systemVariable ] = self._installDir - #if not self._environment.has_key(userVariable): - # self._environment[ userVariable ] = self._installDir + if not self._environment.has_key(systemVariable) or self._environment[systemVariable] == "": + if not self._environment.has_key(userVariable) or self._environment[userVariable] == "" : + self._environment[ systemVariable ] = self._installDir + print "[WARNING] Neither <%s> nor <%s> environment variables are sets." \ + % (systemVariable,userVariable) + print " Setting <%s> to <%s>." % (systemVariable,self._installDir) + else: + self._environment[ systemVariable ] = self._environment[ userVariable ] + if not self._quiet: - print "Setting %s = \"%s\"." % (systemVariable ,self._environment[systemVariable]) + print "Setting <%s> to <%s>." % (systemVariable,self._environment[systemVariable]) if self._environment.has_key(userVariable): - print "Transmitting %s = \"%s\"." % (userVariable,self._environment[userVariable]) + print "Transmitting <%s> as <%s>." % (userVariable,self._environment[userVariable]) return