sebastien / cuisine

Chef-like functionality for Fabric
Other
1.26k stars 157 forks source link

every apt-get command runs twice #173

Closed ostertag closed 10 years ago

ostertag commented 10 years ago

I see that every apt-get command runs twice. I'm thinking, that there is a mistake in original code and that something like this should fix it:

def apt_get(cmd):
    cmd    = CMD_APT_GET + cmd
    result = sudo(cmd)
    # If the installation process was interrupted, we might get the following message
    # E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
    if "sudo dpkg --configure -a" in result:
        sudo("DEBIAN_FRONTEND=noninteractive dpkg --configure -a")
        return sudo(cmd)
    else:
        return result

But, may be, I just do not take into account all possible circumstances.

sebastien commented 10 years ago

It is only run twice if we need to do a ´dpkg --configure -a´.