]> git.saurik.com Git - apt.git/commitdiff
move isatty() check into InitOutput()
authorMichael Vogt <mvo@debian.org>
Wed, 5 Feb 2014 16:35:33 +0000 (17:35 +0100)
committerMichael Vogt <mvo@debian.org>
Wed, 5 Feb 2014 16:35:33 +0000 (17:35 +0100)
apt-private/private-output.cc
cmdline/apt-get.cc
cmdline/apt.cc
test/integration/test-apt-cli-upgrade

index 2ae112af464e0b609a38084b1e0516c35f99e54f..420ca14d59b89ddc23f1f1587e42d603630b3496 100644 (file)
@@ -30,6 +30,9 @@ unsigned int ScreenWidth = 80 - 1; /* - 1 for the cursor */
 
 bool InitOutput()                                                      /*{{{*/
 {
+   if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
+      _config->Set("quiet","1");
+
    c0out.rdbuf(cout.rdbuf());
    c1out.rdbuf(cout.rdbuf());
    c2out.rdbuf(cout.rdbuf());
index 6bff6e7de5963d6097e976c2250f2a68b08aefb1..1019ff3250c55ff90cde11e9e862d3e86761a897 100644 (file)
@@ -1736,10 +1736,6 @@ int main(int argc,const char *argv[])                                    /*{{{*/
    // see if we are in simulate mode
    CheckSimulateMode(CmdL);
 
-   // Deal with stdout not being a tty
-   if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
-      _config->Set("quiet","1");
-
    // Setup the output streams
    InitOutput();
 
index 6fe25e3f39f0336fbae59df2dda88717eaf5dd45..6ad470faa42202d0ee45b1074a3e0789e6dd35cc 100644 (file)
@@ -156,8 +156,6 @@ int main(int argc, const char *argv[])                                      /*{{{*/
                 << std::endl
                 << std::endl;
    }
-   if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1)
-      _config->Set("quiet","1");
 
    // See if the help should be shown
    if (_config->FindB("help") == true ||
index 163a555765da55e8c13e41e62e782ed5a71f5eec..21ce6941339f2116d70abceac49bcf28de4fe9f0 100755 (executable)
@@ -16,8 +16,7 @@ setupaptarchive
 APTARCHIVE=$(readlink -f ./aptarchive)
 
 # default is to allow new dependencies
-testequal "Calculating upgrade... Done
-The following NEW packages will be installed:
+testequal "The following NEW packages will be installed:
   foo-new-dependency
 The following packages will be upgraded:
   foo
@@ -28,7 +27,6 @@ Conf foo-new-dependency (2.0 unstable [all])
 Conf foo (2.0 unstable [all])" apt upgrade -qq -s
 
 # ensure 
-testequal "Calculating upgrade... Done
-The following packages have been kept back:
+testequal "The following packages have been kept back:
   foo
 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." apt upgrade -qq -s --no-new-pkgs