aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/utils.py
blob: f56b7d9d442129b7ed7d3d76b8f420d0f1f6e221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import hashlib
import os


def get_bundle_filename():
    root = os.path.join(os.path.dirname(__file__), '..')
    with open(os.path.join(root, 'cpanfile.snapshot')) as cpanfile:
        hash = hashlib.md5(cpanfile.read()).hexdigest()

    try:
        version = os.environ['TRAVIS_PERL_VERSION']
    except KeyError:
        # Not running on Travis, assume default Travis version
        version = '5.14'

    if version == '5.14':
        version = ''
    else:
        version = '-%s' % version

    filename = 'fixmystreet-local-%s%s.tgz' % (hash, version)
    return filename