'Downloads the latest source tarball from github and installs it over the existing version.'

def update(self):

    tar_download_url = (((((u'http://github.com/' + sickbeard.GIT_ORG) + u'/') + sickbeard.GIT_REPO) + u'/tarball/') + self.branch)
    try:
        sr_update_dir = ek(os.path.join, sickbeard.PROG_DIR, u'sr-update')
        if ek(os.path.isdir, sr_update_dir):
            logger.log(((u'Clearing    out    update    folder    ' + sr_update_dir) + u'    before    extracting'))
            shutil.rmtree(sr_update_dir)
        logger.log(((u'Creating    update    folder    ' + sr_update_dir) + u'    before    extracting'))
        ek(os.makedirs, sr_update_dir)
        logger.log(u'Downloading    update    from    {url}'.format(url=tar_download_url))
        tar_download_path = ek(os.path.join, sr_update_dir, u'sr-update.tar')
        helpers.download_file(tar_download_url, tar_download_path, session=self.session)
        if (not ek(os.path.isfile, tar_download_path)):
            logger.log(((u'Unable    to    retrieve    new    version    from    ' + tar_download_url) + u",    can't    update"), logger.WARNING)
            return False
        if (not ek(tarfile.is_tarfile, tar_download_path)):
            logger.log(((u'Retrieved    version    from    ' + tar_download_url) + u"    is    corrupt,    can't    update"), logger.ERROR)
            return False
        logger.log((u'Extracting    file    ' + tar_download_path))
        tar = tarfile.open(tar_download_path)
        tar.extractall(sr_update_dir)
        tar.close()
        logger.log((u'Deleting    file    ' + tar_download_path))
        ek(os.remove, tar_download_path)
        update_dir_contents = [x for x in ek(os.listdir, sr_update_dir) if ek(os.path.isdir, ek(os.path.join, sr_update_dir, x))]
        if (len(update_dir_contents) != 1):
            logger.log((u'Invalid    update    data,    update    failed:    ' + str(update_dir_contents)), logger.ERROR)
            return False
        content_dir = ek(os.path.join, sr_update_dir, update_dir_contents[0])
        logger.log((((u'Moving    files    from    ' + content_dir) + u'    to    ') + sickbeard.PROG_DIR))
        for (dirname, stderr_, filenames) in ek(os.walk, content_dir):
            dirname = dirname[(len(content_dir) + 1):]
            for curfile in filenames:
                old_path = ek(os.path.join, content_dir, dirname, curfile)
                new_path = ek(os.path.join, sickbeard.PROG_DIR, dirname, curfile)
                if ek(os.path.isfile, new_path):
                    ek(os.remove, new_path)
                ek(os.renames, old_path, new_path)
        sickbeard.CUR_COMMIT_HASH = self._newest_commit_hash
        sickbeard.CUR_COMMIT_BRANCH = self.branch
    except Exception as e:
        logger.log((u'Error    while    trying    to    update:    ' + ex(e)), logger.ERROR)
        logger.log((u'Traceback:    ' + traceback.format_exc()), logger.DEBUG)
        return False
    notifiers.notify_git_update((sickbeard.CUR_COMMIT_HASH or u''))
    return True
