From 23a332304b94a6b1839ebd2a6e89cc46f43a3967 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Wed, 8 Jul 2009 16:23:17 +0200 Subject: [PATCH] Remove obsolete UpgradeStatistics class from libzypp. --- VERSION.cmake | 4 +- devel/devel.ma/DumpSolv.cc | 3 +- devel/devel.ma/Iorder.cc | 3 +- devel/devel.ma/MaTest.cc | 3 +- devel/devel.ma/Main.cc | 98 ++++++------------ devel/devel.ma/NewPool.cc | 3 +- doc/autoinclude/Notes.doc | 6 ++ package/libzypp.changes | 6 ++ zypp/CMakeLists.txt | 2 - zypp/Resolver.h | 4 - zypp/UpgradeStatistics.cc | 110 -------------------- zypp/UpgradeStatistics.h | 248 --------------------------------------------- 12 files changed, 49 insertions(+), 441 deletions(-) delete mode 100644 zypp/UpgradeStatistics.cc delete mode 100644 zypp/UpgradeStatistics.h diff --git a/VERSION.cmake b/VERSION.cmake index 4593ed8..22ed556 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "6") SET(LIBZYPP_COMPATMINOR "10") SET(LIBZYPP_MINOR "10") -SET(LIBZYPP_PATCH "0") +SET(LIBZYPP_PATCH "1") # -# LAST RELEASED: 6.10.0 (10) +# LAST RELEASED: 6.10.1 (10) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/devel/devel.ma/DumpSolv.cc b/devel/devel.ma/DumpSolv.cc index 9d71bc3..86c3329 100644 --- a/devel/devel.ma/DumpSolv.cc +++ b/devel/devel.ma/DumpSolv.cc @@ -40,8 +40,7 @@ bool upgrade() bool rres = false; { zypp::base::LogControl::TmpLineWriter shutUp; - UpgradeStatistics u; - rres = getZYpp()->resolver()->doUpgrade( u ); + rres = getZYpp()->resolver()->doUpgrade(); } if ( ! rres ) { diff --git a/devel/devel.ma/Iorder.cc b/devel/devel.ma/Iorder.cc index 69ed9c3..f3eb14f 100644 --- a/devel/devel.ma/Iorder.cc +++ b/devel/devel.ma/Iorder.cc @@ -251,8 +251,7 @@ bool upgrade() bool rres = false; { zypp::base::LogControl::TmpLineWriter shutUp; - UpgradeStatistics u; - rres = getZYpp()->resolver()->doUpgrade( u ); + rres = getZYpp()->resolver()->doUpgrade(); } if ( ! rres ) { diff --git a/devel/devel.ma/MaTest.cc b/devel/devel.ma/MaTest.cc index 960a91c..fc2ac75 100644 --- a/devel/devel.ma/MaTest.cc +++ b/devel/devel.ma/MaTest.cc @@ -531,8 +531,7 @@ try { if ( 0 ) { Measure x( "Upgrade" ); - UpgradeStatistics u; - getZYpp()->resolver()->doUpgrade( u ); + getZYpp()->resolver()->doUpgrade(); } /////////////////////////////////////////////////////////////////// diff --git a/devel/devel.ma/Main.cc b/devel/devel.ma/Main.cc index 8201ed3..55c0f42 100644 --- a/devel/devel.ma/Main.cc +++ b/devel/devel.ma/Main.cc @@ -1,26 +1,11 @@ #include "Tools.h" -#include "zypp/base/Easy.h" -#include "zypp/base/LogTools.h" -#include "zypp/base/InputStream.h" -#include "zypp/base/ReferenceCounted.h" -#include "zypp/base/NonCopyable.h" -#include "zypp/base/PtrTypes.h" - -#include "zypp/TmpPath.h" - -#include "zypp/RepoManager.h" -#include "zypp/RepoInfo.h" -#include "zypp/repo/PackageProvider.h" - -#include "zypp/ResPoolProxy.h" - -using std::endl; -using namespace zypp; +#include /////////////////////////////////////////////////////////////////// -static const Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" ); +//static const Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" ); +static const Pathname sysRoot( "/tmp/Local/ma/DNL-test" ); /////////////////////////////////////////////////////////////////// @@ -29,7 +14,7 @@ bool solve() bool rres = false; { //zypp::base::LogControl::TmpLineWriter shutUp; - rres = getZYpp()->resolver()->resolvePool(); + //rres = test.resolver().resolvePool(); } if ( ! rres ) { @@ -40,60 +25,39 @@ bool solve() return true; } -ManagedFile providePkg( const PoolItem & pi ) -{ - Package::constPtr p = asKind( pi.resolvable() ); - if ( ! pi ) - return ManagedFile(); - - repo::RepoMediaAccess access; - std::list repos; - repo::DeltaCandidates deltas( repos ); - repo::PackageProvider pkgProvider( access, p, deltas ); - - return pkgProvider.providePackage(); -} - -/****************************************************************** -** -** FUNCTION NAME : main -** FUNCTION TYPE : int -*/ int main( int argc, char * argv[] ) -{ +try { + --argc; + ++argv; + zypp::base::LogControl::instance().logToStdErr(); INT << "===[START]==========================================" << endl; - - RepoManager repoManager( makeRepoManager( sysRoot ) ); - ResPool pool( ResPool::instance() ); - sat::Pool satpool( sat::Pool::instance() ); - -// mksrc( "file:///schnell/CD-ARCHIVE/SLES10/SLE-10-SP1/SLES-10-SP1-GM/ia64/DVD1", "SLE" ); -// mksrc( "file:///mounts/dist/install/SLP/SLES-10-SP2-AS-LATEST/i386/CD1", "factorytest" ); -// mksrc( "iso:///?iso=openSUSE-10.3-GM-DVD9-BiArch-DVD1.iso&url=file:///schnell/CD-ARCHIVE/10.3/iso", "10.3.iso", repoManager ); - mksrc( "file:///Local/SRC/test/", "test", repoManager ); - + ZConfig::instance(); + TestSetup::LoadSystemAt( sysRoot ); + /////////////////////////////////////////////////////////////////// + ResPool pool( ResPool::instance() ); + sat::Pool satpool( sat::Pool::instance() ); + /////////////////////////////////////////////////////////////////// + dumpRange( USR, satpool.reposBegin(), satpool.reposEnd() ) << endl; USR << "pool: " << pool << endl; - PoolItem pi ( getPi("BitTorrent-curses", Edition("4.0.3-115"), Arch_i586 ) ); - MIL << pi << endl; - if ( pi ) - { - providePkg( pi ); - } + /////////////////////////////////////////////////////////////////// - //getSel( "basesystem" )->setStatus( ui::S_Install ); - //getSel( "slesas-ofed-base" )->setStatus( ui::S_Install ); - if ( 0 ) - { - vdumpPoolStats( USR << "Transacting:"<< endl, - make_filter_begin(pool), - make_filter_end(pool) ) << endl; - solve(); - vdumpPoolStats( USR << "Transacting:"<< endl, - make_filter_begin(pool), - make_filter_end(pool) ) << endl; - } + getZYpp()->resolver()->addRequire( Capability("xteddy") ); + solve(); + vdumpPoolStats( USR << "Transacting:"<< endl, + make_filter_begin(pool), + make_filter_end(pool) ) << endl; + + /////////////////////////////////////////////////////////////////// INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); return 0; } +catch ( const Exception & exp ) +{ + INT << exp << endl << exp.historyAsString(); +} +catch (...) +{} + diff --git a/devel/devel.ma/NewPool.cc b/devel/devel.ma/NewPool.cc index 3ebf937..260195b 100644 --- a/devel/devel.ma/NewPool.cc +++ b/devel/devel.ma/NewPool.cc @@ -592,8 +592,7 @@ try { if ( 0 ) { Measure x( "Upgrade" ); - UpgradeStatistics u; - getZYpp()->resolver()->doUpgrade( u ); + getZYpp()->resolver()->doUpgrade(); } /////////////////////////////////////////////////////////////////// diff --git a/doc/autoinclude/Notes.doc b/doc/autoinclude/Notes.doc index 42fbe40..f05be9d 100644 --- a/doc/autoinclude/Notes.doc +++ b/doc/autoinclude/Notes.doc @@ -19,5 +19,11 @@ namespace zypp \li \c MediaManager::attachDesiredMedia renamed to MediaManager::attach
+\section V_6_10_0 6.10.0 - Removed zypp::UpgradeStatistics +Since \c Code-11 the distribution upgrade is computed by the satsolver and no longer by +libzypp itself. For some reason zypp::UpgradeStatistics were still present in the interfaces, +but actually no longer used. Neither as input nor as result struct. Now they are removed. +
+ */ } diff --git a/package/libzypp.changes b/package/libzypp.changes index 10e2568..6bf9df4 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Jul 8 16:19:31 CEST 2009 - ma@suse.de + +- Remove obsolete UpgradeStatistics class from libzypp. +- version 6.10.1 (10) + +------------------------------------------------------------------- Tue Jul 7 17:45:47 CEST 2009 - ma@suse.de - Fix HistoryLog to initialize on demand. diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt index f14a629..b61ef9c 100644 --- a/zypp/CMakeLists.txt +++ b/zypp/CMakeLists.txt @@ -66,7 +66,6 @@ SET( zypp_SRCS SysContent.cc Target.cc TmpPath.cc - UpgradeStatistics.cc Url.cc VendorAttr.cc VendorSupportOptions.cc @@ -163,7 +162,6 @@ SET( zypp_HEADERS Target.h TmpPath.h TriBool.h - UpgradeStatistics.h Url.h VendorAttr.h VendorSupportOptions.h diff --git a/zypp/Resolver.h b/zypp/Resolver.h index 24ca3cd..4ebbdd4 100644 --- a/zypp/Resolver.h +++ b/zypp/Resolver.h @@ -19,7 +19,6 @@ #include "zypp/base/PtrTypes.h" #include "zypp/ResPool.h" -#include "zypp/UpgradeStatistics.h" #include "zypp/solver/detail/Resolver.h" #include "zypp/solver/detail/SolverQueueItem.h" #include "zypp/ProblemTypes.h" @@ -118,9 +117,6 @@ namespace zypp * etc. **/ bool doUpgrade(); - /** \deprecated The UpgradeStatistics argument is a meanwhile useless relict of pre-satsolver days. */ - ZYPP_DEPRECATED bool doUpgrade( UpgradeStatistics & ) - { return doUpgrade(); } /** * Update to newest package diff --git a/zypp/UpgradeStatistics.cc b/zypp/UpgradeStatistics.cc deleted file mode 100644 index 7ed1a73..0000000 --- a/zypp/UpgradeStatistics.cc +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/* UpgradeStatistics.cc - * - * Copyright (C) 2005 SUSE Linux Products GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - * 02111-1307, USA. - */ - -/* - stolen from PMPackageManager_update.cc - original author Michael Andres - zypp port by Klaus Kaempf - -/-*/ - -#include -#include "zypp/base/Logger.h" -#include "zypp/UpgradeStatistics.h" - -///////////////////////////////////////////////////////////////////////// -namespace zypp -{ /////////////////////////////////////////////////////////////////////// - -using namespace std; - -UpgradeStatistics::~UpgradeStatistics() -{} - -/****************************************************************** -** -** -** FUNCTION NAME : operator<< -** FUNCTION TYPE : std::ostream & -** -** DESCRIPTION : -*/ -std::ostream & -UpgradeStatistics::dumpOn( std::ostream & str ) const -{ - str << "===[initial]========================================" << endl; - str << "pre_todel " << pre_todel << endl; - str << "pre_nocand " << pre_nocand << endl; - str << "pre_avcand " << pre_avcand << endl; - str << "===[checks]=========================================" << endl; - str << "chk_installed_total " << chk_installed_total << endl; - str << endl; - str << "chk_already_todel " << chk_already_todel << endl; - str << "chk_is_taboo " << chk_is_taboo << endl; - str << endl; - str << "chk_already_toins " << chk_already_toins << endl; - str << "chk_to_update " << chk_to_update << endl; - str << "chk_to_downgrade " << chk_to_downgrade << endl; - str << "chk_to_keep_downgrade" << chk_to_keep_downgrade << endl; - str << "chk_to_keep_installed" << chk_to_keep_installed << endl; - str << "--------------------------" << endl; - str << "avcand " - << ( chk_already_toins + chk_to_update + chk_to_downgrade + chk_to_keep_downgrade + chk_to_keep_installed ) - << endl; - str << endl; - str << "chk_keep_foreign " << chk_keep_foreign << endl; - str << "chk_dropped " << chk_dropped << endl; - str << "chk_replaced " << chk_replaced << endl; - str << "chk_replaced_guessed " << chk_replaced_guessed << endl; - str << "chk_add_split " << chk_add_split << endl; - str << "--------------------------" << endl; - str << "nocand " - << ( chk_keep_foreign + chk_dropped + chk_replaced + chk_replaced_guessed + chk_add_split ) - << endl; - str << "===[sum]============================================" << endl; - str << "Packages checked " << chk_installed_total << endl; - str << endl; - str << "totalToInstall " << totalToInstall() << endl; - str << "totalToDelete " << totalToDelete() << endl; - str << "totalToKeep " << totalToKeep() << endl; - str << "--------------------------" << endl; - str << "sum " - << ( totalToInstall() + totalToDelete() + totalToKeep() ) - << endl; - str << "====================================================" << endl; - str << "====================================================" << endl; - - return str; -} - - - /////////////////////////////////////////////////////////////////////// -};// namespace zypp -///////////////////////////////////////////////////////////////////////// - - diff --git a/zypp/UpgradeStatistics.h b/zypp/UpgradeStatistics.h deleted file mode 100644 index 9996c3f..0000000 --- a/zypp/UpgradeStatistics.h +++ /dev/null @@ -1,248 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* ResolverUpgrade.h - * - * Copyright (C) 2005 SUSE Linux Products GmbH - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - * 02111-1307, USA. - */ - -/* - stolen from PMPackageManager_update.cc - original author Michael Andres - zypp port by Klaus Kaempf - -/-*/ - -#ifndef ZYPP_UPGRADESTATISTICS_H -#define ZYPP_UPGRADESTATISTICS_H -#warning This include and the classes declared inside are depreceated. - -#include -#include -#include - -#include "zypp/base/Deprecated.h" - -///////////////////////////////////////////////////////////////////////// -namespace zypp -{ /////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -// -// CLASS NAME : UpgradeOptions -/** - * @short Struct for update options - **/ -class ZYPP_DEPRECATED UpgradeOptions { - - public: - - /////////////////////////////////////////////////////////////////// - // OPTIONS - /////////////////////////////////////////////////////////////////// - - /** - * If true, version downgrades are silently performed. Assuming the - * installation media contains a consistent sytem, and we target - * this well defined state. - **/ - bool silent_downgrades; - - public: - - UpgradeOptions() - : silent_downgrades ( false ) - {} - - ~UpgradeOptions() {} -}; - -/////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////// -// -// CLASS NAME : UpgradeStatistics -/** - * @short Struct for update options, statistics, and result lists. - * - * \deprecated - **/ -class ZYPP_DEPRECATED UpgradeStatistics : public UpgradeOptions { - - virtual std::ostream & dumpOn( std::ostream & str ) const; - friend std::ostream & operator<<( std::ostream & str, const UpgradeStatistics & obj ) - { return obj.dumpOn (str); } - - public: - - /////////////////////////////////////////////////////////////////// - // STATISTICS - /////////////////////////////////////////////////////////////////// - - /** - * initial status: packages already tagged to delete - **/ - unsigned pre_todel; - /** - * initial status: packages without candidate (foreign, replaced or dropped) - **/ - unsigned pre_nocand; - /** - * initial status: packages with candidate (available for update) - **/ - unsigned pre_avcand; - - - /** - * update checks: total number of packages checked (should be number of installed packages) - **/ - unsigned chk_installed_total; - - /** - * update checks: packages already tagged to delete (should be pre_todel) - **/ - unsigned chk_already_todel; - - /** - * update checks: packages skipped due to taboo (foreign) - **/ - unsigned chk_is_taboo; - - /** - * update checks: with candidate: packages already tagged to install - **/ - unsigned chk_already_toins; - - /** - * update checks: with candidate: packages updated to new version - **/ - unsigned chk_to_update; - - /** - * update checks: with candidate: packages downgraded - * - * Installed and candidate package have vendor SuSE and candidates buildtime - * is newer. - **/ - unsigned chk_to_downgrade; - - /** - * update checks: with candidate: packages untouched (foreign package downgrade) - **/ - unsigned chk_to_keep_downgrade; - - /** - * update checks: with candidate: packages untouched (uptodate) - **/ - unsigned chk_to_keep_installed; - - /** - * update checks: without candidate: installed package has not vendor SuSE - * - * Remains untouched. - **/ - unsigned chk_keep_foreign; - - /** - * update checks: without candidate: packages dropped (or SuSE internal) - * - * There's no available candidate providing it. - **/ - unsigned chk_dropped; - - /** - * update checks: without candidate: packages replaced - * - * There's exactly one available candidate providing it. - **/ - unsigned chk_replaced; - - /** - * update checks: without candidate: packages added by splitprovides - * - * Only packages not selected by one of the above checks are counted. - **/ - unsigned chk_add_split; - - /** - * update checks: without candidate: package replaced (but not uniqe, thus guessed) - * - * There are multiple available candidates providing it. If at the end - * at least one out of these candidates was set to install by one of the - * above checks, it's ok. Otherwise we have to guess one. - **/ - unsigned chk_replaced_guessed; - - public: - - UpgradeStatistics() { - // initial status - pre_todel = 0; - pre_nocand = 0; - pre_avcand = 0; - // update checks - chk_installed_total = 0; - chk_already_todel = 0; - chk_is_taboo = 0; - // packages with candidate - chk_already_toins = 0; - chk_to_update = 0; - chk_to_downgrade = 0; - chk_to_keep_downgrade = 0; - chk_to_keep_installed = 0; - // packages without candidate - chk_keep_foreign = 0; - chk_dropped = 0; - chk_replaced = 0; - chk_replaced_guessed = 0; - chk_add_split = 0; - } - virtual ~UpgradeStatistics(); - - /** - * total number of packages that will be installed - **/ - unsigned totalToInstall() const - { - return chk_already_toins - + chk_to_update + chk_to_downgrade - + chk_replaced + chk_replaced_guessed + chk_add_split; - } - - /** - * total number of packages that will be finally deleted - * (does not count the replaced packages) - **/ - unsigned totalToDelete() const - { - return chk_already_todel + chk_dropped; - } - - /** - * total number of packages that remain untouched - **/ - unsigned totalToKeep() const - { - return chk_is_taboo + chk_to_keep_downgrade + chk_to_keep_installed + chk_keep_foreign + chk_dropped; - } -}; - -/////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////// -};// namespace zypp -///////////////////////////////////////////////////////////////////////// - - -#endif // ZYPP_UPGRADESTATISTICS_H -- 2.7.4