Skip to content

Commit

Permalink
Return valid repository signature flag (bsc#1009127)
Browse files Browse the repository at this point in the history
to check the metadata status
  • Loading branch information
lslezak committed Feb 7, 2017
1 parent 4403d42 commit 5f3aef4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Source_Get.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <zypp/Product.h>
#include <zypp/Repository.h>
#include <zypp/media/CredentialManager.h>
#include <zypp/TriBool.h>

#include <ycp/YCPBoolean.h>
#include <ycp/YCPMap.h>
Expand Down Expand Up @@ -115,6 +116,7 @@ PkgFunctions::SourceGetCurrent (const YCPBoolean& enabled)
* "service" : YCPString, (service to which the repo belongs, empty if there is no service assigned)
* "keeppackages" : YCPBoolean,
* "is_update_repo" : YCPBoolean, (true if this is an update repo - this requires loaded objects in pool otherwise the flag is not returned! The value is stored in repo metadata, not in .repo file!)
* "valid_repo_signature" : YCPBoolean or YCPVoid (boolean: whether the repo metadata are signed and valid, nil: unsigned metadata)
* ];
*
* </code>
Expand Down Expand Up @@ -163,6 +165,12 @@ PkgFunctions::SourceGeneralData (const YCPInteger& id)

data->add( YCPString("keeppackages"), YCPBoolean(repo->repoInfo().keepPackages()));

// handle tribool, return nil for the indeterminate state
if (zypp::indeterminate(repo->repoInfo().validRepoSignature()))
data->add(YCPString("valid_repo_signature"), YCPVoid());
else
data->add(YCPString("valid_repo_signature"), (YCPBoolean(repo->repoInfo().validRepoSignature())));

// add Repository data
zypp::Repository repository(zypp::ResPool::instance().reposFind(repo->repoInfo().alias()));

Expand Down

0 comments on commit 5f3aef4

Please sign in to comment.