Пример #1
0
def _get_repo_version_str(beta):
  """See above for description of this string."""
  if beta is not None:
    date_str = datetime.date.today().strftime('%Y%m%d')
    return 'GOOG;noto-emoji:%s;BETA %s' % (date_str, beta)

  p = tool_utils.resolve_path('[emoji]')
  commit, date, _ = tool_utils.git_head_commit(p)
  if not tool_utils.git_check_remote_commit(p, commit):
    raise Exception('emoji not on upstream master branch')
  date_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})')
  m = date_re.match(date)
  if not m:
    raise Exception('could not match "%s" with "%s"' % (date, date_re.pattern))
  ymd = ''.join(m.groups())
  return 'GOOG;noto-emoji:%s:%s' % (ymd, commit[:12])
Пример #2
0
def _get_repo_version_str(beta):
  """See above for description of this string."""
  if beta is not None:
    date_str = datetime.date.today().strftime('%Y%m%d')
    return 'GOOG;noto-emoji:%s;BETA %s' % (date_str, beta)

  p = tool_utils.resolve_path('[emoji]')
  commit, date, _ = tool_utils.git_head_commit(p)
  if not tool_utils.git_check_remote_commit(p, commit):
    raise Exception('emoji not on upstream master branch')
  date_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})')
  m = date_re.match(date)
  if not m:
    raise Exception('could not match "%s" with "%s"' % (date, date_re.pattern))
  ymd = ''.join(m.groups())
  return 'GOOG;noto-emoji:%s:%s' % (ymd, commit[:12])
Пример #3
0
def _get_fonts_repo_version_info():
  prefix = tool_utils.resolve_path('[fonts]')

  commit, date, commit_msg = tool_utils.git_head_commit(prefix)

  # check that commit is on the upstream master
  if not tool_utils.git_check_remote_commit(prefix, commit):
    raise Exception(
        'commit %s (%s) not on upstream master branch' % (
            commit[:12], commit_msg.splitlines()[0].strip()))

  date_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})')
  m = date_re.match(date)
  if not m:
    raise Exception('could not match "%s" with "%s"' % (date, date_re.pattern))
  ymd = ''.join(m.groups())
  return 'GOOG;noto-fonts:%s:%s' % (ymd, commit[:12])
Пример #4
0
def _get_fonts_repo_version_info(repo_tag):
  prefix = tool_utils.resolve_path(repo_tag)

  commit, date, commit_msg = tool_utils.git_head_commit(prefix)

  # check that commit is on the upstream master
  if not tool_utils.git_check_remote_commit(prefix, commit):
    raise Exception(
        'commit %s (%s) not on upstream master branch' % (
            commit[:12], commit_msg.splitlines()[0].strip()))

  date_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})')
  m = date_re.match(date)
  if not m:
    raise Exception('could not match "%s" with "%s"' % (date, date_re.pattern))
  ymd = ''.join(m.groups())

  # hack tag to get the formal repo name.  strip enclosing brackets...
  repo_name = 'noto-' + repo_tag[1:-1].replace('_', '-')
  return 'GOOG;%s:%s:%s' % (repo_name, ymd, commit[:12])
Пример #5
0
def _get_fonts_repo_version_info(repo_tag):
  prefix = tool_utils.resolve_path(repo_tag)

  commit, date, commit_msg = tool_utils.git_head_commit(prefix)

  # check that commit is on the upstream master
  if not tool_utils.git_check_remote_commit(prefix, commit):
    raise Exception(
        'commit %s (%s) not on upstream master branch' % (
            commit[:12], commit_msg.splitlines()[0].strip()))

  date_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})')
  m = date_re.match(date)
  if not m:
    raise Exception('could not match "%s" with "%s"' % (date, date_re.pattern))
  ymd = ''.join(m.groups())

  # hack tag to get the formal repo name.  strip enclosing brackets...
  repo_name = 'noto-' + repo_tag[1:-1].replace('_', '-')
  return 'GOOG;%s:%s:%s' % (repo_name, ymd, commit[:12])