Skip to content

Commit

Permalink
Merge pull request riptano#158 from pcmanus/recompile
Browse files Browse the repository at this point in the history
  • Loading branch information
ptnapoleon committed Aug 28, 2014
2 parents 7fb6687 + 9b03bb8 commit 4730c2c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ccmlib/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ def clone_development(version, verbose=False):
# wipe out the directory if anything goes wrong. Otherwise we will assume it has been compiled the next time it runs.
try:
shutil.rmtree(target_dir)
except: pass
print_("Deleted %s due to error" % target_dir)
except:
raise CCMError("Building C* version %s failed. Attempted to delete %s but failed. This will need to be manually deleted" % (version, target_dir))
raise


def download_version(version, url=None, verbose=False, binary=False):
"""Download, extract, and build Cassandra tarball.
if binary == True, download precompiled tarball, otherwise build from source tarball.
"""
"""
if binary:
u = "%s/%s/apache-cassandra-%s-bin.tar.gz" % (ARCHIVE, version.split('-')[0], version) if url is None else url
else:
Expand Down Expand Up @@ -149,6 +151,14 @@ def download_version(version, url=None, verbose=False, binary=False):
raise ArgumentError(msg)
except tarfile.ReadError as e:
raise ArgumentError("Unable to uncompress downloaded file: %s" % str(e))
except CCMError as e:
# wipe out the directory if anything goes wrong. Otherwise we will assume it has been compiled the next time it runs.
try:
shutil.rmtree(target_dir)
print_("Deleted %s due to error" % target_dir)
except:
raise CCMError("Building C* version %s failed. Attempted to delete %s but failed. This will need to be manually deleted" % (version, target_dir))
raise e

def compile_version(version, target_dir, verbose=False):
# compiling cassandra and the stress tool
Expand Down Expand Up @@ -231,7 +241,7 @@ def get_tagged_version_numbers(series='stable'):

# Sort by semver:
releases.sort(reverse=True)

stable_major_version = LooseVersion(str(releases[0].version[0]) + "." + str(releases[0].version[1]))
stable_releases = [r for r in releases if r >= stable_major_version]
oldstable_releases = [r for r in releases if r not in stable_releases]
Expand Down

0 comments on commit 4730c2c

Please sign in to comment.