sebastien/cuisine — pull request #140 by neotek (2013-03-23 20:15:55+00:00)
Title: Silence apt-get progress meter with -q (--quiet)

In normal usage, `apt-get` displays % progress meters on stdout. But these meters are intended for terminal output not logging output. They produce a newline every time there is any progress. For example, here is the output of `package_install('python')`:

```bash
$ fab master
[server] Executing task 'master'
[server] sudo: DEBIAN_FRONTEND=noninteractive apt-get -q --yes install python
[server] out:
[server] out: Reading package lists... 0%
[server] out:
[server] out: Reading package lists... 100%
[server] out:
[server] out: Reading package lists... Done
[server] out:
[server] out:
[server] out: Building dependency tree... 0%
[server] out:
[server] out: Building dependency tree... 0%
[server] out:
[server] out: Building dependency tree... 50%
[server] out:
[server] out: Building dependency tree... 50%
[server] out:
[server] out: Building dependency tree
[server] out:
[server] out:
[server] out: Reading state information... 0%
[server] out:
[server] out: Reading state information... 1%
[server] out:
[server] out: Reading state information... Done
[server] out:
[server] out: python is already the newest version.
[server] out: 0 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
[server] out:
```

This pull request adds the `-q` option to all the `package_*_apt()` functions that call `apt-get`. The output is the same as before but without the progress meters:

```bash
$ fab quiet
[server] Executing task 'quiet'
[server] sudo: DEBIAN_FRONTEND=noninteractive apt-get -q --yes install python
[server] out: Reading package lists...
[server] out: Building dependency tree...
[server] out: Reading state information...
[server] out: python is already the newest version.
[server] out: 0 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
[server] out:
```

The man page for `apt-get` states:

```
-q, --quiet
Quiet; produces output suitable for logging, omitting progress indicators.
More q's will produce more quiet up to a maximum of 2. You can also use -q=#
to set the quiet level, overriding the configuration file. Note that quiet
level 2 implies -y, you should never use -qq without a no-action modifier
such as -d, --print-uris or -s as APT may decided to do something you did
not expect. Configuration Item: quiet.
```