Author: lslezak Date: Mon Mar 30 16:32:58 2009 New Revision: 56467
URL: http://svn.opensuse.org/viewcvs/yast?rev=56467&view=rev Log: - return "is_update_repo" flag in Pkg::SourceGeneralData() call (requires loaded pool) (bnc#459527)
Modified: trunk/pkg-bindings/src/Source_Get.cc
Modified: trunk/pkg-bindings/src/Source_Get.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Source_Get.cc?re... ============================================================================== --- trunk/pkg-bindings/src/Source_Get.cc (original) +++ trunk/pkg-bindings/src/Source_Get.cc Mon Mar 30 16:32:58 2009 @@ -30,6 +30,7 @@ #include "ycpTools.h"
#include <zypp/Product.h> +#include <zypp/Repository.h> #include <zypp/media/CredentialManager.h>
#include <ycp/YCPBoolean.h> @@ -112,6 +113,7 @@ * "name" : YCPString, * "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!) * ]; * * </code> @@ -159,6 +161,15 @@
data->add( YCPString("keeppackages"), YCPBoolean(repo->repoInfo().keepPackages()));
+ // add Repository data + zypp::Repository repository(zypp::ResPool::instance().reposFind(repo->repoInfo().alias())); + + if (repository != zypp::Repository::noRepository) + { + y2debug("adding zypp::Repository info"); + data->add( YCPString("is_update_repo"), YCPBoolean(repository.isUpdateRepo())); + } + return data; }
yast-commit@lists.opensuse.org