def contents_entry(entry):
    """Replace a manifest_entry source path with its file content.

    Used to implement the --content option. In a nutshell, an entry
    that looks like '<target>=<source>' will be rewritten to
    '<target>=<content of source file>', preserving other fields
    in the entry.
    """
    with open(entry.source) as file:
        [line] = file.read().splitlines()
        return entry._replace(source=line)