Skip to content

Commit

Permalink
Merge pull request #355 from broadinstitute/dp-fix-tool-patch
Browse files Browse the repository at this point in the history
fix Tool._patch
  • Loading branch information
dpark01 authored Jun 18, 2016
2 parents 21cd253 + 5975539 commit 2da1faf
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,8 @@ def executable_path(self):
return os.path.join(self.bin_path, self.executable)

def apply_patches(self):
result = None
for path, patch in self.patches:
result = self._patch(path, patch)
if result.returncode != 0:
return result
return result
self._patch(path, patch)


def _patch(self, path, patch):
Expand All @@ -340,7 +336,7 @@ def _patch(self, path, patch):
file_path = os.path.join(self.env_path, path)
patch_path = os.path.join(
util.file.get_project_path(), 'tools', 'patches', patch)
return subprocess.check_call(['patch', file_path, patch_path])
subprocess.check_call(['patch', file_path, patch_path])

@property
def _package_installed(self):
Expand Down Expand Up @@ -533,10 +529,7 @@ def install_package(self):

if data["success"] == True:
_log.debug("Package installed.")
result = self.apply_patches()
if result and result.returncode != 0:
_log.error("Failed to apply patches.")
return
self.apply_patches()

else:
if "success" in data.keys() and data["success"]:
Expand Down

0 comments on commit 2da1faf

Please sign in to comment.