Mailinglist Archive: zypp-commit (185 mails)

< Previous Next >
[zypp-commit] r10795 - in /trunk/zypper/src: Zypper.cc info.cc misc.cc solve-commit.cc update.cc utils/misc.cc
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Fri, 08 Aug 2008 08:45:39 -0000
  • Message-id: <20080808084539.85FE847085@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Fri Aug 8 10:45:39 2008
New Revision: 10795

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10795&view=rev
Log:
replace ResTraits>::kind by ResKind

Modified:
trunk/zypper/src/Zypper.cc
trunk/zypper/src/info.cc
trunk/zypper/src/misc.cc
trunk/zypper/src/solve-commit.cc
trunk/zypper/src/update.cc
trunk/zypper/src/utils/misc.cc

Modified: trunk/zypper/src/Zypper.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=10795&r1=10794&r2=10795&view=diff
==============================================================================
--- trunk/zypper/src/Zypper.cc (original)
+++ trunk/zypper/src/Zypper.cc Fri Aug 8 10:45:39 2008
@@ -3087,9 +3087,9 @@
}
}
else if (globalOpts().is_rug_compatible)
- kinds.insert(ResTraits<Package>::kind);
+ kinds.insert(ResKind::package);
else
- kinds.insert(ResTraits<Patch>::kind);
+ kinds.insert(ResKind::patch);

bool best_effort = copts.count( "best-effort" );

@@ -3257,13 +3257,13 @@
switch (command().toEnum())
{
case ZypperCommand::RUG_PATCH_INFO_e:
- kind = ResTraits<Patch>::kind;
+ kind = ResKind::patch;
break;
case ZypperCommand::RUG_PATTERN_INFO_e:
- kind = ResTraits<Pattern>::kind;
+ kind = ResKind::pattern;
break;
case ZypperCommand::RUG_PRODUCT_INFO_e:
- kind = ResTraits<Product>::kind;
+ kind = ResKind::product;
break;
default:
case ZypperCommand::INFO_e:

Modified: trunk/zypper/src/info.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/info.cc?rev=10795&r1=10794&r2=10795&view=diff
==============================================================================
--- trunk/zypper/src/info.cc (original)
+++ trunk/zypper/src/info.cc Fri Aug 8 10:45:39 2008
@@ -89,13 +89,13 @@

cout << endl << endl;

- if (kind == ResTraits<Package>::kind)
+ if (kind == ResKind::package)
printPkgInfo(zypper, *s);
- else if (kind == ResTraits<Patch>::kind)
+ else if (kind == ResKind::patch)
printPatchInfo(zypper, *s);
- else if (kind == ResTraits<Pattern>::kind)
+ else if (kind == ResKind::pattern)
printPatternInfo(zypper, *s);
- else if (kind == ResTraits<Product>::kind)
+ else if (kind == ResKind::product)
printProductInfo(zypper, *s);
else
// TranslatorExplanation %s = resolvable type (package, patch,
pattern, etc - untranslated).

Modified: trunk/zypper/src/misc.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/misc.cc?rev=10795&r1=10794&r2=10795&view=diff
==============================================================================
--- trunk/zypper/src/misc.cc (original)
+++ trunk/zypper/src/misc.cc Fri Aug 8 10:45:39 2008
@@ -38,15 +38,15 @@
ResObject::Kind empty;
string lskind = str::toLower (skind);
if (lskind == "package")
- return ResTraits<Package>::kind;
+ return ResKind::package;
if (lskind == "pattern")
- return ResTraits<Pattern>::kind;
+ return ResKind::pattern;
if (lskind == "product")
- return ResTraits<Product>::kind;
+ return ResKind::product;
if (lskind == "patch")
- return ResTraits<Patch>::kind;
+ return ResKind::patch;
if (lskind == "srcpackage")
- return ResTraits<SrcPackage>::kind;
+ return ResKind::srcpackage;
// not recognized
return empty;
}
@@ -278,7 +278,7 @@
God->resolver()->addRequire(*itc);
DBG << "added req: " << *itc << endl;
}*/
- God->resolver()->addRequire(Capability(srcpkg->name(), Rel::EQ,
srcpkg->edition(), ResTraits<SrcPackage>::kind));
+ God->resolver()->addRequire(Capability(srcpkg->name(), Rel::EQ,
srcpkg->edition(), ResKind::srcpackage));
//installer.item.status().setToBeInstalled( zypp::ResStatus::USER );
}
else

Modified: trunk/zypper/src/solve-commit.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/solve-commit.cc?rev=10795&r1=10794&r2=10795&view=diff
==============================================================================
--- trunk/zypper/src/solve-commit.cc (original)
+++ trunk/zypper/src/solve-commit.cc Fri Aug 8 10:45:39 2008
@@ -548,7 +548,7 @@
ResObject::constPtr res = it->resolvable();
if ( it->status().isToBeInstalled() || it->status().isToBeUninstalled() )
{
- if (it->resolvable()->kind() == ResTraits<Patch>::kind)
+ if (it->resolvable()->kind() == ResKind::patch)
{
Patch::constPtr patch = asKind<Patch>(it->resolvable());

@@ -689,7 +689,7 @@

for (list<SrcPackage::constPtr>::const_iterator it =
zypper.runtimeData().srcpkgs_to_install.begin();
it != zypper.runtimeData().srcpkgs_to_install.end(); ++it)
- toinstall[ResTraits<SrcPackage>::kind].insert(*it);
+ toinstall[ResKind::srcpackage].insert(*it);

if (!toremove.empty() && (
zypper.command() == ZypperCommand::INSTALL ||

Modified: trunk/zypper/src/update.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/update.cc?rev=10795&r1=10794&r2=10795&view=diff
==============================================================================
--- trunk/zypper/src/update.cc (original)
+++ trunk/zypper/src/update.cc Fri Aug 8 10:45:39 2008
@@ -299,13 +299,13 @@

string i18n_kind_updates(const ResKind & kind)
{
- if (kind == ResTraits<Package>::kind)
+ if (kind == ResKind::package)
return _("Package updates");
- else if (kind == ResTraits<Patch>::kind)
+ else if (kind == ResKind::patch)
return _("Patches");
- else if (kind == ResTraits<Pattern>::kind)
+ else if (kind == ResKind::pattern)
return _("Pattern updates");
- else if (kind == ResTraits<Product>::kind)
+ else if (kind == ResKind::product)
return _("Product updates");

return boost::str(format("%s updates") % kind);

Modified: trunk/zypper/src/utils/misc.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/utils/misc.cc?rev=10795&r1=10794&r2=10795&view=diff
==============================================================================
--- trunk/zypper/src/utils/misc.cc (original)
+++ trunk/zypper/src/utils/misc.cc Fri Aug 8 10:45:39 2008
@@ -15,7 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/media/MediaManager.h"
-#include "zypp/parser/xml_escape_parser.hpp"
+#include "zypp/parser/xml/XmlEscape.h"
#include "zypp/Capability.h"

#include "main.h"
@@ -80,15 +80,15 @@

string kind_to_string_localized(const Resolvable::Kind & kind, unsigned long
count)
{
- if (kind == ResTraits<Package>::kind)
+ if (kind == ResKind::package)
return _PL("package", "packages", count);
- if (kind == ResTraits<Pattern>::kind)
+ if (kind == ResKind::pattern)
return _PL("pattern", "patterns", count);
- if (kind == ResTraits<Product>::kind)
+ if (kind == ResKind::product)
return _PL("product", "product", count);
- if (kind == ResTraits<Patch>::kind)
+ if (kind == ResKind::patch)
return _PL("patch", "patches", count);
- if (kind == ResTraits<SrcPackage>::kind)
+ if (kind == ResKind::srcpackage)
return _PL("srcpackage", "srcpackages", count);
// default
return _PL("resolvable", "resolvables", count);
@@ -245,8 +245,7 @@

string xml_encode(const string & text)
{
- iobind::parser::xml_escape_parser parser;
- return parser.escape(text);
+ return zypp::xml::escape(text);
}

std::string & indent(std::string & text, int columns)

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages