def check_version(_):
    """Checks that all the versions in the library match."""
    changelog = changelog_version()
    player = player_version()
    git = shakaBuildHelpers.git_version()
    npm = shakaBuildHelpers.npm_version()

    print('git version: ' + git)
    print('npm version: ' + npm)
    print('player version: ' + player)
    print('changelog version: ' + changelog)

    ret = 0
    if 'dirty' in git:
        logging.error('Git version is dirty.')
        ret = 1
    elif 'unknown' in git:
        logging.error('Git version is not a tag.')
        ret = 1
    elif not re.match(r'^v[0-9]+\.[0-9]+\.[0-9]+(?:-[a-z0-9]+)?$', git):
        logging.error('Git version is a malformed release version.')
        logging.error('It should be a \'v\', followed by three numbers')
        logging.error('separated by dots, optionally followed by a hyphen')
        logging.error('and a pre-release identifier.  See http://semver.org/')
        ret = 1

    if 'v' + npm != git:
        logging.error('NPM version does not match git version.')
        ret = 1
    if player != git + '-uncompiled':
        logging.error('Player version does not match git version.')
        ret = 1
    if 'v' + changelog != git:
        logging.error('Changelog version does not match git version.')
        ret = 1

    return ret
示例#2
0
def check_version(_):
  """Checks that all the versions in the library match."""
  changelog = changelog_version()
  player = player_version()
  git = shakaBuildHelpers.git_version()
  npm = shakaBuildHelpers.npm_version()

  print 'git version:', git
  print 'npm version:', npm
  print 'player version:', player
  print 'changelog version:', changelog

  ret = 0
  if 'dirty' in git:
    print >> sys.stderr, 'Git version is dirty.'
    ret = 1
  elif 'unknown' in git:
    print >> sys.stderr, 'Git version is not a tag.'
    ret = 1
  elif not re.match(r'^v[0-9]+\.[0-9]+\.[0-9]+(?:-[a-z0-9]+)?$', git):
    print >> sys.stderr, 'Git version is a malformed release version.'
    print >> sys.stderr, 'It should be a \'v\', followed by three numbers'
    print >> sys.stderr, 'separated by dots, optionally followed by a hyphen'
    print >> sys.stderr, 'and a pre-release identifier.  See http://semver.org/'
    ret = 1

  if 'v' + npm != git:
    print >> sys.stderr, 'NPM version does not match git version.'
    ret = 1
  if player != git + '-debug':
    print >> sys.stderr, 'Player version does not match git version.'
    ret = 1
  if 'v' + changelog != git:
    print >> sys.stderr, 'Changelog version does not match git version.'
    ret = 1

  return ret
示例#3
0
def main(_):
  """Checks that all the versions in the library match."""
  changelog = changelog_version()
  player = player_version()
  git = shakaBuildHelpers.git_version()
  npm = shakaBuildHelpers.npm_version()

  print('git version: ' + git)
  print('npm version: ' + npm)
  print('player version: ' + player)
  print('changelog version: ' + changelog)

  ret = 0
  if 'dirty' in git:
    logging.error('Git version is dirty.')
    ret = 1
  elif 'unknown' in git:
    logging.error('Git version is not a tag.')
    ret = 1
  elif not re.match(r'^v[0-9]+\.[0-9]+\.[0-9]+(?:-[a-z0-9]+)?$', git):
    logging.error('Git version is a malformed release version.')
    logging.error('It should be a \'v\', followed by three numbers')
    logging.error('separated by dots, optionally followed by a hyphen')
    logging.error('and a pre-release identifier.  See http://semver.org/')
    ret = 1

  if 'v' + npm != git:
    logging.error('NPM version does not match git version.')
    ret = 1
  if player != git + '-uncompiled':
    logging.error('Player version does not match git version.')
    ret = 1
  if 'v' + changelog != git:
    logging.error('Changelog version does not match git version.')
    ret = 1

  return ret