def UpdateDpkgChangelogFile(self):
    """Updates the dpkg changelog file.

    Returns:
      A boolean indicating the dpkg changelog file was updated. This function
      will return True if the dpkg changelog file does not exists.
    """
    project_name = self.GetName()
    project_version = self.GetVersion()

    dpkg_changelog_path = os.path.join(u'config', u'dpkg', u'changelog')
    if not os.path.exists(dpkg_changelog_path):
      return True

    dpkg_maintainter = u'Log2Timeline <log2timeline-dev@googlegroups.com>'
    dpkg_date = time.strftime(u'%a, %d %b %Y %H:%M:%S %z')
    dpkg_changelog_content = u'\n'.join([
        u'{0:s} ({1:s}-1) unstable; urgency=low'.format(
            project_name, project_version),
        u'',
        u'  * Auto-generated',
        u'',
        u' -- {0:s}  {1:s}'.format(dpkg_maintainter, dpkg_date)])

    try:
      dpkg_changelog_content = dpkg_changelog_content.encode(u'utf-8')
    except UnicodeEncodeError as exception:
      logging.error(
          u'Unable to write dpkg changelog file with error: {0:s}'.format(
              exception))
      return False

    try:
      with open(dpkg_changelog_path, u'wb') as file_object:
        file_object.write(dpkg_changelog_content)
    except __HOLE__ as exception:
      logging.error(
          u'Unable to write dpkg changelog file with error: {0:s}'.format(
              exception))
      return False

    return True
dataset/ETHPy150Open log2timeline/dfvfs/utils/review.py/ProjectHelper.UpdateDpkgChangelogFile