1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*---------------------------------------------------------------------\
4 | |__ / \ / / . \ . \ |
9 \---------------------------------------------------------------------*/
10 /* UpgradeStatistics.cc
12 * Copyright (C) 2005 SUSE Linux Products GmbH
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.
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.
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
30 stolen from PMPackageManager_update.cc
31 original author Michael Andres <ma@suse.de>
32 zypp port by Klaus Kaempf <kkaempf@suse.de>
37 #include "zypp/base/Logger.h"
38 #include "zypp/UpgradeStatistics.h"
40 /////////////////////////////////////////////////////////////////////////
42 { ///////////////////////////////////////////////////////////////////////
46 UpgradeStatistics::~UpgradeStatistics()
49 /******************************************************************
52 ** FUNCTION NAME : operator<<
53 ** FUNCTION TYPE : std::ostream &
58 UpgradeStatistics::dumpOn( std::ostream & str ) const
60 str << "===[options]========================================" << endl;
61 str << "delete_unmaintained? " << (delete_unmaintained?"Y":"N") << endl;
62 str << "===[initial]========================================" << endl;
63 str << "pre_todel " << pre_todel << endl;
64 str << "pre_nocand " << pre_nocand << endl;
65 str << "pre_avcand " << pre_avcand << endl;
66 str << "===[checks]=========================================" << endl;
67 str << "chk_installed_total " << chk_installed_total << endl;
69 str << "chk_already_todel " << chk_already_todel << endl;
70 str << "chk_is_taboo " << chk_is_taboo << endl;
72 str << "chk_already_toins " << chk_already_toins << endl;
73 str << "chk_to_update " << chk_to_update << endl;
74 str << "chk_to_downgrade " << chk_to_downgrade << endl;
75 str << "chk_to_keep_downgrade" << chk_to_keep_downgrade << endl;
76 str << "chk_to_keep_installed" << chk_to_keep_installed << endl;
77 str << "--------------------------" << endl;
79 << ( chk_already_toins + chk_to_update + chk_to_downgrade + chk_to_keep_downgrade + chk_to_keep_installed )
82 str << "chk_keep_foreign " << chk_keep_foreign << endl;
83 str << "chk_dropped " << chk_dropped << endl;
84 str << "chk_replaced " << chk_replaced << endl;
85 str << "chk_replaced_guessed " << chk_replaced_guessed << endl;
86 str << "chk_add_split " << chk_add_split << endl;
87 str << "--------------------------" << endl;
89 << ( chk_keep_foreign + chk_dropped + chk_replaced + chk_replaced_guessed + chk_add_split )
91 str << "===[sum]============================================" << endl;
92 str << "Packages checked " << chk_installed_total << endl;
94 str << "totalToInstall " << totalToInstall() << endl;
95 str << "totalToDelete " << totalToDelete() << endl;
96 str << "totalToKeep " << totalToKeep() << endl;
97 str << "--------------------------" << endl;
99 << ( totalToInstall() + totalToDelete() + totalToKeep() )
101 str << "====================================================" << endl;
102 str << "====================================================" << endl;
108 ///////////////////////////////////////////////////////////////////////
110 /////////////////////////////////////////////////////////////////////////