2 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
5 * Easy-to use interface to the ZYPP dependency resolver
7 * Copyright (C) 2000-2002 Ximian, Inc.
8 * Copyright (C) 2005 SUSE Linux Products GmbH
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License,
12 * version 2, as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 #include "zypp/base/String.h"
28 #include "zypp/base/Gettext.h"
29 #include "zypp/solver/detail/ProblemSolutionUninstall.h"
30 #include "zypp/solver/detail/Helper.h"
34 /////////////////////////////////////////////////////////////////////////
36 { ///////////////////////////////////////////////////////////////////////
37 ///////////////////////////////////////////////////////////////////////
39 { /////////////////////////////////////////////////////////////////////
40 /////////////////////////////////////////////////////////////////////
42 { ///////////////////////////////////////////////////////////////////
44 IMPL_PTR_TYPE(ProblemSolutionUninstall);
46 //---------------------------------------------------------------------------
47 ProblemSolutionUninstall::ProblemSolutionUninstall( ResolverProblem_Ptr parent, PoolItem item,
48 const std::string & descr,
49 const std::string & detail)
50 : ProblemSolution (parent, descr, detail)
52 addAction ( new TransactionSolutionAction (item, REMOVE));
57 ProblemSolutionUninstall::ProblemSolutionUninstall( ResolverProblem_Ptr parent,
59 : ProblemSolution (parent, "", "")
61 ResStatus status = item.status();
62 if (status.isInstalled()) {
63 // TranslatorExplanation %s = name of package, patch, selection ...
64 _description = str::form (_("delete %s"), item->name().c_str() );
65 // TranslatorExplanation %s = name of package, patch, selection ...
66 _details = str::form (_("delete %s"), Helper::itemToString (item).c_str());
68 // TranslatorExplanation %s = name of package, patch, selection ...
69 _description = str::form (_("do not install %s"), item->name().c_str() );
70 // TranslatorExplanation %s = name of package, patch, selection ...
71 _details = str::form (_("do not install %s"), Helper::itemToString (item).c_str());
74 addAction ( new TransactionSolutionAction (item, REMOVE));
77 ProblemSolutionUninstall::ProblemSolutionUninstall( ResolverProblem_Ptr parent,
78 PoolItemList & itemlist)
79 : ProblemSolution (parent, "", "")
81 _description = _("Do not install or delete the resolvables concerned");
83 for (PoolItemList::iterator iter = itemlist.begin();
84 iter != itemlist.end(); iter++) {
85 PoolItem item = *iter;
86 addAction ( new TransactionSolutionAction (item, REMOVE));
89 ostringstream details;
91 _details = details.str();
94 ///////////////////////////////////////////////////////////////////
96 /////////////////////////////////////////////////////////////////////
97 /////////////////////////////////////////////////////////////////////
99 ///////////////////////////////////////////////////////////////////////
100 ///////////////////////////////////////////////////////////////////////
102 /////////////////////////////////////////////////////////////////////////