Fix failed package download due to unkown repository type (bnc #386386)
[platform/upstream/libzypp.git] / zypp / UpgradeStatistics.cc
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*---------------------------------------------------------------------\
3 |                          ____ _   __ __ ___                          |
4 |                         |__  / \ / / . \ . \                         |
5 |                           / / \ V /|  _/  _/                         |
6 |                          / /__ | | | | | |                           |
7 |                         /_____||_| |_| |_|                           |
8 |                                                                      |
9 \---------------------------------------------------------------------*/
10 /* UpgradeStatistics.cc
11  *
12  * Copyright (C) 2005 SUSE Linux Products GmbH
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License,
16  * version 2, as published by the Free Software Foundation.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26  * 02111-1307, USA.
27  */
28
29 /*
30   stolen from PMPackageManager_update.cc
31   original author Michael Andres <ma@suse.de>
32   zypp port by Klaus Kaempf <kkaempf@suse.de>
33
34 /-*/
35
36 #include <iostream>
37 #include "zypp/base/Logger.h"
38 #include "zypp/UpgradeStatistics.h"
39
40 /////////////////////////////////////////////////////////////////////////
41 namespace zypp
42 { ///////////////////////////////////////////////////////////////////////
43
44 using namespace std;
45
46 UpgradeStatistics::~UpgradeStatistics()
47 {}
48
49 /******************************************************************
50 **
51 **
52 **      FUNCTION NAME : operator<<
53 **      FUNCTION TYPE : std::ostream &
54 **
55 **      DESCRIPTION :
56 */
57 std::ostream &
58 UpgradeStatistics::dumpOn( std::ostream & str ) const
59 {
60   str << "===[initial]========================================" << endl;
61   str << "pre_todel            " << pre_todel << endl;
62   str << "pre_nocand           " << pre_nocand << endl;
63   str << "pre_avcand           " << pre_avcand << endl;
64   str << "===[checks]=========================================" << endl;
65   str << "chk_installed_total  " << chk_installed_total << endl;
66   str << endl;
67   str << "chk_already_todel    " << chk_already_todel << endl;
68   str << "chk_is_taboo         " << chk_is_taboo << endl;
69   str << endl;
70   str << "chk_already_toins    " << chk_already_toins << endl;
71   str << "chk_to_update        " << chk_to_update << endl;
72   str << "chk_to_downgrade     " << chk_to_downgrade << endl;
73   str << "chk_to_keep_downgrade" << chk_to_keep_downgrade << endl;
74   str << "chk_to_keep_installed" << chk_to_keep_installed << endl;
75   str << "--------------------------" << endl;
76   str << "avcand               "
77     <<  ( chk_already_toins + chk_to_update + chk_to_downgrade + chk_to_keep_downgrade + chk_to_keep_installed )
78       << endl;
79   str << endl;
80   str << "chk_keep_foreign     " << chk_keep_foreign << endl;
81   str << "chk_dropped          " << chk_dropped << endl;
82   str << "chk_replaced         " << chk_replaced << endl;
83   str << "chk_replaced_guessed " << chk_replaced_guessed << endl;
84   str << "chk_add_split        " << chk_add_split << endl;
85   str << "--------------------------" << endl;
86   str << "nocand               "
87     <<  ( chk_keep_foreign + chk_dropped + chk_replaced + chk_replaced_guessed + chk_add_split )
88       << endl;
89   str << "===[sum]============================================" << endl;
90   str << "Packages checked     " << chk_installed_total << endl;
91   str << endl;
92   str << "totalToInstall       " << totalToInstall() << endl;
93   str << "totalToDelete        " << totalToDelete() << endl;
94   str << "totalToKeep          " << totalToKeep() << endl;
95   str << "--------------------------" << endl;
96   str << "sum                  "
97     <<  ( totalToInstall() + totalToDelete() + totalToKeep() )
98       << endl;
99   str << "====================================================" << endl;
100   str << "====================================================" << endl;
101
102   return str;
103 }
104
105
106   ///////////////////////////////////////////////////////////////////////
107 };// namespace zypp
108 /////////////////////////////////////////////////////////////////////////
109
110