Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Commit

Permalink
Fix updating issues, closes #97.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgjones committed Mar 5, 2013
1 parent 85ff0a5 commit fdfce5d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/snogoggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__(self, name, system, scons_dep, geant4_dep, clhep_dep, rat_dep, root
self._xercesc_dep = xercesc_dep
self._curl_dep = curl_dep
self._bzip_dep = bzip_dep
self._env_file = envfilebuilder.EnvFileBuilder("#snogoggles environment\n")
def get_dependencies(self):
""" Return the required dependencies."""
dependencies = ["python", "python-dev", self._scons_dep, self._geant_dep,
Expand Down Expand Up @@ -61,19 +60,16 @@ def _update(self):
""" Special updater for rat-dev, delete env file write a new then git pull and scons."""
self._remove()
self.write_env_file()
if self._system.get_os_type() == system.System.Mac:
command_text = "#!/bin/bash\nsource %s\ncd %s\ngit pull\nscons -c\nscons zdab=0" % \
(os.path.join(self._system.get_install_path(), "env_%s.sh" % self._name ), self.get_install_path())
else:
command_text = "#!/bin/bash\nsource %s\ncd %s\ngit pull\nscons -c\nscons" % \
(os.path.join(self._system.get_install_path(), "env_%s.sh" % self._name ), self.get_install_path())
command_text = "#!/bin/bash\nsource %s\ncd %s\ngit pull\nscons -c\nscons" % \
(os.path.join(self._system.get_install_path(), "env_%s.sh" % self._name ), self.get_install_path())
self._system.execute_complex_command(command_text, verbose=True)
def _remove(self):
""" Delete the env files as well."""
os.remove(os.path.join(self._system.get_install_path(), "env_%s.sh" % self._name))
os.remove(os.path.join(self._system.get_install_path(), "env_%s.csh" % self._name))
def write_env_file(self):
""" Adds general parts and then writes the env file."""
self._env_file = envfilebuilder.EnvFileBuilder("#snogoggles environment\n")
self._env_file.add_source(self._dependency_paths[self._geant_dep], "bin/geant4")
self._env_file.add_source(self._dependency_paths[self._rat_dep], "env")

Expand All @@ -90,7 +86,7 @@ def write_env_file(self):

if self._dependency_paths[self._curl_dep] is not None:
self._env_file.append_path(os.path.join(self._dependency_paths[self._curl_dep], "bin"))
self._env_file.append_library_path(os.path.join(self._dependence_paths[self._curl_dep], "lib"))
self._env_file.append_library_path(os.path.join(self._dependency_paths[self._curl_dep], "lib"))
self._env_file.append_path(os.path.join(self.get_install_path(), "bin"))
self._env_file.append_path(os.path.join(self._dependency_paths[self._root_dep], "bin"))
self._env_file.append_path(os.path.join(self._dependency_paths[self._clhep_dep], "bin"))
Expand Down

0 comments on commit fdfce5d

Please sign in to comment.