![](https://seccdn.libravatar.org/avatar/c3c40c0a8c67869856fd7e06cbcb4099.jpg?s=120&d=mm&r=g)
Author: lslezak Date: Mon Jul 16 16:57:57 2007 New Revision: 39444 URL: http://svn.opensuse.org/viewcvs/yast?rev=39444&view=rev Log: - reimplemented SourceMediaData() - dropped "media_id" and "media_vendor" tags from the result map, now it requires loaded resolvables in the pool to get number of the media - 2.15.30 Modified: trunk/pkg-bindings/VERSION trunk/pkg-bindings/package/yast2-pkg-bindings.changes trunk/pkg-bindings/src/Callbacks.cc trunk/pkg-bindings/src/Source.cc trunk/pkg-bindings/yast2-pkg-bindings.spec.in Modified: trunk/pkg-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/VERSION?rev=39444&r1=39443&r2=39444&view=diff ============================================================================== --- trunk/pkg-bindings/VERSION (original) +++ trunk/pkg-bindings/VERSION Mon Jul 16 16:57:57 2007 @@ -1 +1 @@ -2.15.29 +2.15.30 Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/package/yast2-pkg-bindings.changes?rev=39444&r1=39443&r2=39444&view=diff ============================================================================== --- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original) +++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Mon Jul 16 16:57:57 2007 @@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Mon Jul 16 15:02:38 CEST 2007 - lslezak@suse.cz + +- SourceMediaData() - report all base urls (key "base_urls" in the + result) +- report media number and source ID in the SourceChange() callback +- fixed crash in the Media Change callback (empty baseUrls) +- SourceDelete() - remove resolvables from the pool +- SourceSetEnabled() - load/remove resolvables from the pool +- PkgCommit() - release all sources +- SourceReleaseAll() - return success flag +- reimplemented SourceMediaData() - dropped "media_id" and + "media_vendor" tags from the result map, now it requires loaded + resolvables in the pool to get number of the media +- 2.15.30 + +------------------------------------------------------------------- Fri Jul 13 17:46:17 CEST 2007 - lslezak@suse.cz - convert source ID in source callbacks (pass PkgModuleFunctions Modified: trunk/pkg-bindings/src/Callbacks.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks.cc?rev=39444&r1=39443&r2=39444&view=diff ============================================================================== --- trunk/pkg-bindings/src/Callbacks.cc (original) +++ trunk/pkg-bindings/src/Callbacks.cc Mon Jul 16 16:57:57 2007 @@ -1078,6 +1078,7 @@ try { zypp::Url ret_url (ret); #warning FIXME: MediaChange callback - redirection is missing! + y2internal("Source redirection is not yet implemented in yast2-pkg-bindings"); //source.redirect( mediumNr, ret_url ); // remember the redirection Modified: trunk/pkg-bindings/src/Source.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Source.cc?rev=39444&r1=39443&r2=39444&view=diff ============================================================================== --- trunk/pkg-bindings/src/Source.cc (original) +++ trunk/pkg-bindings/src/Source.cc Mon Jul 16 16:57:57 2007 @@ -722,13 +722,37 @@ if (!repo) return YCPVoid (); -#warning FIXME SourceMediaData is NOT implemented!!! -/* data->add( YCPString("media_count"), YCPInteger(src.numberOfMedia())); - data->add( YCPString("media_id"), YCPString(src.unique_id())); - data->add( YCPString("media_vendor"), YCPString(src.vendor())); -*/ -#warning SourceMediaData returns URL without password + std::string alias = repo->repoInfo().alias(); + bool found_resolvable = false; + int max_medium = 1; + + for (zypp::ResPool::const_iterator it = zypp_ptr()->pool().begin() + ; it != zypp_ptr()->pool().end() + ; ++it) + { + if (it->resolvable()->repository().info().alias() == alias) + { + int medium = it->resolvable()->mediaNr(); + + if (medium > max_medium) + { + max_medium = medium; + } + } + } + + if (found_resolvable) + { + data->add( YCPString("media_count"), YCPInteger(max_medium)); + } + else + { + y2error("No resolvable from repository '%s' found, cannot get number of media (use Pkg::SourceLoad() to load the resolvables)", alias.c_str()); + } + + y2warning("Pkg::SourceMediaData() doesn't return \"media_id\" and \"media_vendor\" values anymore."); + // SourceMediaData returns URLs without password if (repo->repoInfo().baseUrlsBegin() != repo->repoInfo().baseUrlsEnd()) { data->add( YCPString("url"), YCPString(repo->repoInfo().baseUrlsBegin()->asString())); Modified: trunk/pkg-bindings/yast2-pkg-bindings.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/yast2-pkg-bindings.spec.in?rev=39444&r1=39443&r2=39444&view=diff ============================================================================== --- trunk/pkg-bindings/yast2-pkg-bindings.spec.in (original) +++ trunk/pkg-bindings/yast2-pkg-bindings.spec.in Mon Jul 16 16:57:57 2007 @@ -2,11 +2,11 @@ @HEADER@ BuildRequires: blocxx-devel docbook-xsl-stylesheets doxygen gcc-c++ libgcrypt-devel libxcrypt-devel libxslt perl-XML-Writer rpm-devel sgml-skel yast2-core-devel yast2-devtools boost boost-devel dbus-1-devel hal-devel -BuildRequires: libzypp-devel >= 2.14.3 -BuildRequires: libzypp >= 2.14.3 +BuildRequires: libzypp-devel >= 3.11.8 +BuildRequires: libzypp >= 3.11.8 -# new API (label of a source, script callbacks...) -Requires: libzypp >= 2.14.3 +# new API (RepoManager instead of SourceManager) +Requires: libzypp >= 3.11.8 Summary: - -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org