def update_file(filename, content):
    """Make sure that a file contains the content.

    Return True if the file changed and False if it didn't.
    """
    try:
        with open(filename, 'r') as f:
            # ignore the end
            old_content = f.read().split('\n***\n')[0].rstrip()
        if old_content == content:
            print("Has correct content:", filename)
            return False
    except FileNotFoundError:
        # the file doesn't exist yet, we'll create it
        pass

    print("Writing new content:", filename)
    with open(filename, 'w') as f:
        print(content, file=f)
    return True