Skip to content

Commit

Permalink
do not hide libzypp exceptions in Pkg::ResolvableProperties() (bnc#89…
Browse files Browse the repository at this point in the history
…5418)

it makes debugging more difficult, return nil in that case

- 3.1.18
  • Loading branch information
lslezak committed Sep 9, 2014
1 parent 95a3ec2 commit 2c4843e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package/yast2-pkg-bindings-devel-doc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-pkg-bindings-devel-doc
Version: 3.1.17
Version: 3.1.18
Release: 0
License: GPL-2.0
Group: Documentation/HTML
Expand Down
8 changes: 8 additions & 0 deletions package/yast2-pkg-bindings.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Sep 9 11:08:56 UTC 2014 - lslezak@suse.cz

- do not hide libzypp exceptions in Pkg::ResolvableProperties()
call, it makes debugging more difficult, return nil in that case
(bnc#895418)
- 3.1.18

-------------------------------------------------------------------
Tue Aug 19 07:39:01 UTC 2014 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-pkg-bindings.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-pkg-bindings
Version: 3.1.17
Version: 3.1.18
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
67 changes: 40 additions & 27 deletions src/Resolvable_Properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -659,36 +659,49 @@ PkgFunctions::ResolvablePropertiesEx(const YCPString& name, const YCPSymbol& kin

if (nm.empty() || nm == s->name())
{
if (!s->installedEmpty())
{
// iterate over all installed packages
for_(inst_it, s->installedBegin(), s->installedEnd())
{
// check version if required
if (vers.empty() || vers == inst_it->resolvable()->edition().asString())
{
ret->add(Resolvable2YCPMap(*inst_it, req_kind, dependencies));
}
}
}

if (!s->availableEmpty())
{
// iterate over all available packages
for_(avail_it, s->availableBegin(), s->availableEnd())
{
// check version if required
if (vers.empty() || vers == avail_it->resolvable()->edition().asString())
{
ret->add(Resolvable2YCPMap(*avail_it, req_kind, dependencies));
}
}
}
}
try
{
if (!s->installedEmpty())
{
// iterate over all installed packages
for_(inst_it, s->installedBegin(), s->installedEnd())
{
// check version if required
if (vers.empty() || vers == inst_it->resolvable()->edition().asString())
{
ret->add(Resolvable2YCPMap(*inst_it, req_kind, dependencies));
}
}
}

if (!s->availableEmpty())
{
// iterate over all available packages
for_(avail_it, s->availableBegin(), s->availableEnd())
{
// check version if required
if (vers.empty() || vers == avail_it->resolvable()->edition().asString())
{
ret->add(Resolvable2YCPMap(*avail_it, req_kind, dependencies));
}
}
}
}
catch(const zypp::Exception &expt)
{
y2error("ResolvableProperties for \"%s\" failed: %s",
s->name().c_str(), expt.asString().c_str());
_last_error.setLastError(ExceptionAsString(expt));
return YCPVoid();
}
}
}
}
catch (...)
catch(const zypp::Exception &expt)
{
y2error("ResolvableProperties failed: %s", expt.asString().c_str());
_last_error.setLastError(ExceptionAsString(expt));
return YCPVoid();
}

return ret;
Expand Down

0 comments on commit 2c4843e

Please sign in to comment.