def modify_control_file():
    log("Modyfing debian control file")
    control_file = DEBIAN+"/control"

    # Read contents
    with open(control_file, "r") as f:
        contents = f.read()

    # Set architecture to i386 or amd64
    contents = contents.replace("Architecture: all",
            "Architecture: %s" % ARCHITECTURE)

    # Extend the Package section, remove the two ending new lines
    contents = re.sub("[\r\n]+$", "", contents)
    contents += "\n"

    # Extend description
    description = DESCRIPTION_EXTENDED
    description = re.sub("[\r\n]+", "\n", description)
    description = re.sub("\n$", "", description)
    contents += "%s\n" % description

    # Other fields
    contents += "Version: %s-1\n" % VERSION
    contents += "Maintainer: %s\n" % MAINTAINER
    contents += "Homepage: %s\n" % HOMEPAGE

    # Control file should end with two new lines
    contents += "\n"
    with open(control_file, "w") as f:
        f.write(contents)
dataset/ETHPy150Open cztomczak/cefpython/cefpython/cef3/linux/installer/make-deb.py/modify_control_file/original