=== modified file 'cmdline/apt-get.cc' --- cmdline/apt-get.cc 2009-04-14 12:17:40 +0000 +++ cmdline/apt-get.cc 2009-05-16 19:31:33 +0000 @@ -2556,21 +2556,62 @@ return true; } /*}}}*/ - // DoMoo - Never Ask, Never Tell /*{{{*/ // --------------------------------------------------------------------- /* */ bool DoMoo(CommandLine &CmdL) { - cout << - " (__) \n" - " (oo) \n" - " /------\\/ \n" - " / | || \n" - " * /\\---/\\ \n" - " ~~ ~~ \n" - "....\"Have you mooed today?\"...\n"; - + signed short SuperCow = 1; + if (CmdL.FileSize() != 0) + for (const char **Moo = CmdL.FileList + 1; *Moo != 0; Moo++) + if (strcasecmp(*Moo, "moo") == 0) + SuperCow++; + + stringstream ConfigLine; + ConfigLine << "APT::Get::SuperCow::" << SuperCow << "::"; + string SuperCowConfig = ConfigLine.str(); + + bool DefaultCows = false; + if (_config->Find(SuperCowConfig+"1","") == "") + { + SuperCow = SuperCow>2 ? 1 : SuperCow; + DefaultCows = true; + } + + if (SuperCow == 1 && DefaultCows == true) + cout << + " (__) \n" + " (oo) \n" + " /------\\/ \n" + " / | || \n" + " * /\\---/\\ \n" + " ~~ ~~ \n" + "...\"Have you mooed today?\"...\n"; + else if (SuperCow == 2 && DefaultCows == true) + // by Fernando Ribeiro in lp:56125 + cout << + " (__) \n" + " _______~(..)~ \n" + " ,----\\(oo) \n" + " /|____|,' \n" + " * /\"\\ /\\ \n" + " ~ ~ ~ ~ \n" + "...\"Have you mooed today?\"...\n"; + else + { + unsigned long i=1; + while (true) + { + stringstream CurrentCowLine; + CurrentCowLine << SuperCowConfig << i; + string line = _config->Find(CurrentCowLine.str(),""); + if (line == "") + break; + i++; + cout << line << endl; + } + } + return true; } /*}}}*/