ResolverUpgrade.cc

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /*---------------------------------------------------------------------\
00003 |                          ____ _   __ __ ___                          |
00004 |                         |__  / \ / / . \ . \                         |
00005 |                           / / \ V /|  _/  _/                         |
00006 |                          / /__ | | | | | |                           |
00007 |                         /_____||_| |_| |_|                           |
00008 |                                                                      |
00009 \---------------------------------------------------------------------*/
00010 /* ResolverUpgrade.cc
00011  *
00012  * Implements the distribution upgrade algorithm.
00013  *
00014  * Copyright (C) 2005 SUSE Linux Products GmbH
00015  *
00016  * This program is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU General Public License,
00018  * version 2, as published by the Free Software Foundation.
00019  *
00020  * This program is distributed in the hope that it will be useful, but
00021  * WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with this program; if not, write to the Free Software
00027  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00028  * 02111-1307, USA.
00029  */
00030 
00031 #include "zypp/base/LogTools.h"
00032 #include "zypp/base/Exception.h"
00033 #include "zypp/ResPool.h"
00034 #include "zypp/ZYppFactory.h"
00035 #include "zypp/solver/detail/Resolver.h"
00036 #include "zypp/solver/detail/Testcase.h"
00037 #include "zypp/solver/detail/SATResolver.h"
00038 #include "zypp/Target.h"
00039 
00041 namespace zypp
00042 { 
00043 
00044   namespace solver
00045   { 
00046 
00047     namespace detail
00048     { 
00049 
00050 using namespace std;
00051 using namespace zypp;
00052 
00053 //-----------------------------------------------------------------------------
00054 
00056 //
00057 //
00058 //      METHOD NAME : Resolver::doUpgrade
00059 //      METHOD TYPE : bool
00060 //
00061 //      DESCRIPTION : creates a testcase in /var/log/updateTestcase
00062 //                    and set the SAT solver in update mode
00063 //
00064 bool
00065 Resolver::doUpgrade()
00066 {
00067   Target_Ptr target( getZYpp()->getTarget() );
00068   if ( ! target )
00069   {
00070     WAR << "Huh, no target ?" << endl;
00071   }
00072 
00073   // Setting Resolver to upgrade mode. SAT solver will do the update
00074   _upgradeMode = true;
00075   return resolvePool();
00076 }
00077 
00078 
00080     };// namespace detail
00083   };// namespace solver
00086 };// namespace zypp
00088 
00089 

doxygen