Skip to content

Commit a3dd17f

Browse files
konturaj-mracek
authored andcommitted
Keep isAdvisoryApplicable to preserve API
Its not actually used anywhere in libdnf.
1 parent f9dd8a5 commit a3dd17f

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

libdnf/utils/utils.cpp

+4-15
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,12 @@ namespace libdnf {
2424

2525
bool isAdvisoryApplicable(libdnf::Advisory & advisory, DnfSack * sack)
2626
{
27-
auto moduleContainer = dnf_sack_get_module_container(sack);
28-
if (!moduleContainer) {
29-
return true;
30-
}
31-
auto moduleAdvisories = advisory.getModules();
32-
if (moduleAdvisories.empty()) {
33-
return true;
34-
}
35-
for (auto & moduleAdvisory: moduleAdvisories) {
36-
if (const char * name = moduleAdvisory.getName()) {
37-
if (const char * stream = moduleAdvisory.getStream()) {
38-
if (moduleContainer->isEnabled(name, stream)) {
39-
return true;
40-
}
41-
}
27+
for (auto & advisoryModule: advisory.getModules()) {
28+
if (advisoryModule.isApplicable()) {
29+
return true;
4230
}
4331
}
32+
4433
return false;
4534
}
4635

libdnf/utils/utils.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define REPOID_CHARS ASCII_LETTERS DIGITS "-_.:"
99

1010
#include "libdnf/sack/advisory.hpp"
11+
#include "libdnf/dnf-utils.h"
1112

1213
#include <functional>
1314
#include <string>
@@ -36,6 +37,7 @@ class Finalizer {
3637
std::function<void()> func;
3738
};
3839

40+
DEPRECATED("advisory now provides getApplicablePackages and each AdvisoryModule provides isApplicable.")
3941
bool isAdvisoryApplicable(Advisory & advisory, DnfSack * sack);
4042

4143
namespace string {

0 commit comments

Comments
 (0)