Hello community,
here is the log from the commit of package yast2-pkg-bindings
checked in at Tue Aug 15 18:37:17 CEST 2006.
--------
--- yast2-pkg-bindings/yast2-pkg-bindings.changes 2006-08-03 09:14:03.000000000 +0200
+++ yast2-pkg-bindings/yast2-pkg-bindings.changes 2006-08-15 13:34:43.000000000 +0200
@@ -1,0 +2,57 @@
+Tue Aug 15 12:48:52 CEST 2006 - lslezak@suse.cz
+
+- 2.13.92
+
+-------------------------------------------------------------------
+Fri Aug 11 10:01:44 CEST 2006 - lslezak@suse.cz
+
+- new finish callbacks: Callback{Delta,Patch}Finish*()
+
+-------------------------------------------------------------------
+Thu Aug 10 13:58:56 CEST 2006 - lslezak@suse.cz
+
+- new callbacks: CallbackSourceCreate*() functions
+
+-------------------------------------------------------------------
+Wed Aug 9 14:53:24 CEST 2006 - jsrain@suse.cz
+
+- let TargetProducts return more data (#66046)
+
+-------------------------------------------------------------------
+Wed Aug 9 09:23:26 CEST 2006 - lslezak@suse.cz
+
+- built-in ResolvableInstallArch() has been changed to
+ ResolvableInstallArchVersion() - set architecture and version of
+ the installed resolvable (#186912)
+
+-------------------------------------------------------------------
+Tue Aug 8 14:03:16 CEST 2006 - lslezak@suse.cz
+
+- new callbacks: patch and delta file progress
+
+-------------------------------------------------------------------
+Tue Aug 8 12:40:00 CEST 2006 - jsrain@suse.cz
+
+- let PkgCommit return more data about remaining resolvables
+ (#186912)
+
+-------------------------------------------------------------------
+Mon Aug 7 18:09:34 CEST 2006 - dmacvicar@suse.de
+
+- use the new initializeTarget method for TargetInitialize
+- require zypp version 2.0.0
+
+-------------------------------------------------------------------
+Mon Aug 7 17:01:56 CEST 2006 - lslezak@suse.cz
+
+- new built-in ResolvableInstallArch() - select architecture of
+ the installed resolvable (#186912)
+
+-------------------------------------------------------------------
+Mon Aug 7 16:11:25 CEST 2006 - dmacvicar@suse.de
+
+- add TargetInitialize, TargetLoad, deprecate TargetInit.
+- port TargetProduct to new zypp api
+- 2.13.91
+
+-------------------------------------------------------------------
Old:
----
yast2-pkg-bindings-2.13.90.tar.bz2
New:
----
yast2-pkg-bindings-2.13.92.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.VOYRLZ/_old 2006-08-15 18:36:53.000000000 +0200
+++ /var/tmp/diff_new_pack.VOYRLZ/_new 2006-08-15 18:36:53.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pkg-bindings (Version 2.13.90)
+# spec file for package yast2-pkg-bindings (Version 2.13.92)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,14 +11,16 @@
# norootforbuild
Name: yast2-pkg-bindings
-Version: 2.13.90
+Version: 2.13.92
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-2.13.90.tar.bz2
+Source0: yast2-pkg-bindings-2.13.92.tar.bz2
prefix: /usr
-BuildRequires: blocxx-devel boost boost-devel dbus-1-devel docbook-xsl-stylesheets doxygen gcc-c++ hal-devel libgcrypt-devel libxcrypt-devel libxslt libzypp libzypp-devel perl-XML-Writer rpm-devel sgml-skel yast2-core-devel yast2-devtools
+BuildRequires: blocxx-devel boost boost-devel dbus-1-devel docbook-xsl-stylesheets doxygen gcc-c++ hal-devel libgcrypt-devel libxcrypt-devel libxslt perl-XML-Writer rpm-devel sgml-skel yast2-core-devel yast2-devtools
+BuildRequires: libzypp-devel >= 2.0.0
+BuildRequires: libzypp >= 2.0.0
Summary: YaST2 Package Manager Access
%description
@@ -36,7 +38,7 @@
Stanislav Visnovsky
%prep
-%setup -n yast2-pkg-bindings-2.13.90
+%setup -n yast2-pkg-bindings-2.13.92
%build
%{prefix}/bin/y2tool y2autoconf
@@ -67,6 +69,33 @@
%doc %{prefix}/share/doc/packages/yast2-pkg-bindings
%changelog -n yast2-pkg-bindings
+* Tue Aug 15 2006 - lslezak@suse.cz
+- 2.13.92
+* Fri Aug 11 2006 - lslezak@suse.cz
+- new finish callbacks: Callback{Delta,Patch}Finish*()
+* Thu Aug 10 2006 - lslezak@suse.cz
+- new callbacks: CallbackSourceCreate*() functions
+* Wed Aug 09 2006 - jsrain@suse.cz
+- let TargetProducts return more data (#66046)
+* Wed Aug 09 2006 - lslezak@suse.cz
+- built-in ResolvableInstallArch() has been changed to
+ ResolvableInstallArchVersion() - set architecture and version of
+ the installed resolvable (#186912)
+* Tue Aug 08 2006 - lslezak@suse.cz
+- new callbacks: patch and delta file progress
+* Tue Aug 08 2006 - jsrain@suse.cz
+- let PkgCommit return more data about remaining resolvables
+ (#186912)
+* Mon Aug 07 2006 - dmacvicar@suse.de
+- use the new initializeTarget method for TargetInitialize
+- require zypp version 2.0.0
+* Mon Aug 07 2006 - lslezak@suse.cz
+- new built-in ResolvableInstallArch() - select architecture of
+ the installed resolvable (#186912)
+* Mon Aug 07 2006 - dmacvicar@suse.de
+- add TargetInitialize, TargetLoad, deprecate TargetInit.
+- port TargetProduct to new zypp api
+- 2.13.91
* Thu Aug 03 2006 - mvidner@suse.cz
- Fixed makefiles for make 3.81
- 2.13.90
++++++ yast2-pkg-bindings-2.13.90.tar.bz2 -> yast2-pkg-bindings-2.13.92.tar.bz2 ++++++
++++ 15055 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/MAINTAINER new/yast2-pkg-bindings-2.13.92/MAINTAINER
--- old/yast2-pkg-bindings-2.13.90/MAINTAINER 2005-04-19 12:57:59.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/MAINTAINER 2006-08-07 09:36:29.000000000 +0200
@@ -1 +1 @@
-Michael Andres
+Ladislav Slezák
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/VERSION new/yast2-pkg-bindings-2.13.92/VERSION
--- old/yast2-pkg-bindings-2.13.90/VERSION 2006-08-03 09:13:40.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/VERSION 2006-08-15 13:30:03.000000000 +0200
@@ -1 +1 @@
-2.13.90
+2.13.92
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/configure.in new/yast2-pkg-bindings-2.13.92/configure.in
--- old/yast2-pkg-bindings-2.13.90/configure.in 2006-08-03 16:02:28.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/configure.in 2006-08-15 13:30:09.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.13.19 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-pkg-bindings, 2.13.90, http://bugs.opensuse.org/, yast2-pkg-bindings)
+AC_INIT(yast2-pkg-bindings, 2.13.92, http://bugs.opensuse.org/, yast2-pkg-bindings)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,9 +17,9 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.13.90"
+VERSION="2.13.92"
RPMNAME="yast2-pkg-bindings"
-MAINTAINER="Michael Andres "
+MAINTAINER="Ladislav Slezák "
dnl pkgconfig honors lib64
pkgconfigdir=\${libdir}/pkgconfig
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/Callbacks.YCP.h new/yast2-pkg-bindings-2.13.92/src/Callbacks.YCP.h
--- old/yast2-pkg-bindings-2.13.90/src/Callbacks.YCP.h 2006-06-07 09:43:41.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/Callbacks.YCP.h 2006-08-11 09:32:46.000000000 +0200
@@ -71,7 +71,13 @@
CB_StartProvide, CB_ProgressProvide, CB_DoneProvide,
CB_StartPackage, CB_ProgressPackage, CB_DonePackage,
CB_StartDownload, CB_ProgressDownload, CB_DoneDownload,
+ CB_SourceCreateStart, CB_SourceCreateStartProbe, CB_SourceCreateEndProbe,
+ CB_SourceCreateProgressData, CB_SourceCreateError, CB_SourceCreateEnd,
CB_StartSourceRefresh, CB_ErrorSourceRefresh, CB_DoneSourceRefresh, CB_ProgressSourceRefresh,
+ CB_StartDeltaDownload, CB_ProgressDeltaDownload, CB_ProblemDeltaDownload,
+ CB_StartDeltaApply, CB_ProgressDeltaApply, CB_ProblemDeltaApply,
+ CB_StartPatchDownload, CB_ProgressPatchDownload, CB_ProblemPatchDownload,
+ CB_FinishDeltaDownload, CB_FinishDeltaApply, CB_FinishPatchDownload,
CB_MediaChange,
CB_SourceChange,
CB_ResolvableReport,
@@ -117,10 +123,28 @@
ENUM_OUT( StartDownload );
ENUM_OUT( ProgressDownload );
ENUM_OUT( DoneDownload );
+ ENUM_OUT( SourceCreateStart );
+ ENUM_OUT( SourceCreateStartProbe );
+ ENUM_OUT( SourceCreateEndProbe );
+ ENUM_OUT( SourceCreateProgressData );
+ ENUM_OUT( SourceCreateError );
+ ENUM_OUT( SourceCreateEnd );
ENUM_OUT( StartSourceRefresh );
ENUM_OUT( ErrorSourceRefresh );
ENUM_OUT( DoneSourceRefresh );
ENUM_OUT( ProgressSourceRefresh );
+ ENUM_OUT( StartDeltaDownload );
+ ENUM_OUT( ProgressDeltaDownload );
+ ENUM_OUT( ProblemDeltaDownload );
+ ENUM_OUT( StartDeltaApply );
+ ENUM_OUT( ProgressDeltaApply );
+ ENUM_OUT( ProblemDeltaApply );
+ ENUM_OUT( StartPatchDownload );
+ ENUM_OUT( ProgressPatchDownload );
+ ENUM_OUT( ProblemPatchDownload );
+ ENUM_OUT( FinishDeltaDownload );
+ ENUM_OUT( FinishDeltaApply );
+ ENUM_OUT( FinishPatchDownload );
ENUM_OUT( MediaChange );
ENUM_OUT( SourceChange );
ENUM_OUT( YouProgress );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/Callbacks.cc new/yast2-pkg-bindings-2.13.92/src/Callbacks.cc
--- old/yast2-pkg-bindings-2.13.90/src/Callbacks.cc 2006-06-07 09:43:41.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/Callbacks.cc 2006-08-11 09:41:48.000000000 +0200
@@ -355,6 +355,9 @@
DownloadResolvableReceive( RecipientCtl & construct_r ) : Recipient( construct_r ) {}
int last_reported;
+ int last_reported_delta_download;
+ int last_reported_delta_apply;
+ int last_reported_patch_download;
virtual void reportbegin()
{
@@ -449,6 +452,164 @@
return zypp::source::DownloadResolvableReport::problem(resolvable_ptr, error, description);
}
+ // Download delta rpm:
+ // - path below url reported on start()
+ // - expected download size (0 if unknown)
+ // - download is interruptable
+ // - problems are just informative
+ virtual void startDeltaDownload( const zypp::Pathname & filename, const zypp::ByteCount & downloadsize )
+ {
+ // reset the counter
+ last_reported_delta_download = 0;
+
+ CB callback( ycpcb( YCPCallbacks::CB_StartDeltaDownload) );
+ if (callback._set) {
+ callback.addStr( filename.asString() );
+ callback.addInt( downloadsize );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual bool progressDeltaDownload( int value )
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_ProgressDeltaDownload) );
+ if (callback._set && (value - last_reported_delta_download >= 5 || last_reported_delta_download - value >= 5 || value == 100))
+ {
+ last_reported_delta_download = value;
+ callback.addInt( value );
+
+ return callback.evaluateBool();
+ }
+
+ return zypp::source::DownloadResolvableReport::progressDeltaDownload(value);
+ }
+
+ virtual void problemDeltaDownload( std::string description )
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_ProblemDeltaDownload ) );
+ if (callback._set) {
+ callback.addStr( description );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual void finishDeltaDownload()
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_FinishDeltaDownload ) );
+
+ if (callback._set)
+ {
+ callback.evaluate();
+ }
+ }
+
+
+ // Apply delta rpm:
+ // - local path of downloaded delta
+ // - apply is not interruptable
+ // - problems are just informative
+ virtual void startDeltaApply( const zypp::Pathname & filename )
+ {
+ // reset the counter
+ last_reported_delta_apply = 0;
+
+ CB callback( ycpcb( YCPCallbacks::CB_StartDeltaApply) );
+ if (callback._set) {
+ callback.addStr( filename.asString() );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual void progressDeltaApply( int value )
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_ProgressDeltaApply ) );
+ if (callback._set && (value - last_reported_delta_apply >= 5 || last_reported_delta_apply - value >= 5 || value == 100))
+ {
+ last_reported_delta_apply = value;
+ callback.addInt( value );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual void problemDeltaApply( std::string description )
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_ProblemDeltaApply ) );
+
+ if (callback._set) {
+ callback.addStr( description );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual void finishDeltaApply()
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_FinishDeltaApply ) );
+
+ if (callback._set)
+ {
+ callback.evaluate();
+ }
+ }
+
+
+ // Download patch rpm:
+ // - path below url reported on start()
+ // - expected download size (0 if unknown)
+ // - download is interruptable
+ virtual void startPatchDownload( const zypp::Pathname & filename, const zypp::ByteCount & downloadsize )
+ {
+ // reset the counter
+ last_reported_patch_download = 0;
+
+ CB callback( ycpcb( YCPCallbacks::CB_StartPatchDownload ) );
+ if (callback._set) {
+ callback.addStr( filename.asString() );
+ callback.addInt( downloadsize );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual bool progressPatchDownload( int value )
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_ProgressPatchDownload) );
+ if (callback._set && (value - last_reported_patch_download >= 5 || last_reported_patch_download - value >= 5 || value == 100))
+ {
+ last_reported_patch_download = value;
+ callback.addInt( value );
+
+ return callback.evaluateBool();
+ }
+
+ return zypp::source::DownloadResolvableReport::progressPatchDownload(value);
+ }
+
+ virtual void problemPatchDownload( std::string description )
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_ProblemPatchDownload ) );
+
+ if (callback._set) {
+ callback.addStr( description );
+
+ callback.evaluate();
+ }
+ }
+
+ virtual void finishPatchDownload()
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_FinishPatchDownload ) );
+
+ if (callback._set)
+ {
+ callback.evaluate();
+ }
+ }
+
};
int DownloadResolvableReceive::last_source_id = -1;
@@ -770,6 +931,7 @@
struct CreateSourceReceive : public Recipient, public zypp::callback::ReceiveReportzypp::source::CreateSourceReport
{
CreateSourceReceive( RecipientCtl & construct_r ) : Recipient( construct_r ) {}
+ int last_reported;
virtual void reportbegin()
{
@@ -779,35 +941,123 @@
{
}
- virtual void startData(
- zypp::Url source_url
- ) {
+ virtual void startData(zypp::Url source_url)
+ {
_silent_probing = MEDIA_CHANGE_DISABLE;
+
+ last_reported = 0;
+ CB callback( ycpcb( YCPCallbacks::CB_SourceCreateStart ) );
+
+ if (callback._set)
+ {
+ callback.addStr(source_url);
+ callback.evaluate();
+ }
}
- virtual void startProbe(zypp::Url url) {
+ virtual void startProbe(zypp::Url url)
+ {
_silent_probing = MEDIA_CHANGE_DISABLE;
+
+ CB callback( ycpcb( YCPCallbacks::CB_SourceCreateStartProbe ) );
+
+ if (callback._set)
+ {
+ callback.addStr(url);
+ callback.evaluate();
+ }
}
- virtual void endProbe(zypp::Url url) {
+ virtual void endProbe(zypp::Url url)
+ {
_silent_probing = MEDIA_CHANGE_FULL;
+
+ CB callback( ycpcb( YCPCallbacks::CB_SourceCreateEndProbe ) );
+
+ if (callback._set)
+ {
+ callback.addStr(url);
+ callback.evaluate();
+ }
}
virtual bool progressData(int value, zypp::Url url)
- { return zypp::source::CreateSourceReport::progressData(value, url); }
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_SourceCreateProgressData ) );
- virtual Action problem(
- zypp::Url url
- , zypp::source::CreateSourceReport::Error error
- , std::string description
- ) { return zypp::source::CreateSourceReport::problem(url, error, description); }
-
- virtual void finishData(
- zypp::Url url
- , zypp::source::CreateSourceReport::Error error
- , std::string reason
- ) {
+ if (callback._set && (value - last_reported >= 5 || last_reported - value >= 5 || value == 100))
+ {
+ callback.addStr(url);
+ callback.addInt(value);
+
+ last_reported = value;
+
+ return callback.evaluateBool();
+ }
+
+ return zypp::source::CreateSourceReport::progressData(value, url);
+ }
+
+ std::string CreateSrcErrorAsString(zypp::source::CreateSourceReport::Error error)
+ {
+ // convert enum to string
+ std::string error_str;
+
+ switch(error)
+ {
+ // no error
+ case zypp::source::CreateSourceReport::NO_ERROR : error_str = "NO_ERROR"; break;
+ // the requested Url was not found
+ case zypp::source::CreateSourceReport::NOT_FOUND : error_str = "NOT_FOUND"; break;
+ // IO error
+ case zypp::source::CreateSourceReport::IO : error_str = "IO"; break;
+ // the source is invalid
+ case zypp::source::CreateSourceReport::INVALID : error_str = "INVALID"; break;
+ }
+
+ return error_str;
+ }
+
+
+ virtual Action problem(zypp::Url url, zypp::source::CreateSourceReport::Error error, std::string description)
+ {
+ CB callback( ycpcb( YCPCallbacks::CB_SourceCreateError ) );
+
+ if ( callback._set )
+ {
+ callback.addStr(url);
+ callback.addStr(CreateSrcErrorAsString(error));
+ callback.addStr(description);
+
+ std::string result = callback.evaluateSymbol();
+
+ // check the returned symbol
+ if ( result == "ABORT" ) return zypp::source::CreateSourceReport::ABORT;
+ if ( result == "RETRY" ) return zypp::source::CreateSourceReport::RETRY;
+
+ // still here?
+ y2error("Unexpected symbol '%s' returned from callback.", result.c_str());
+ // return default
+ }
+
+ // return the default implementation
+ return zypp::source::CreateSourceReport::problem(url, error, description);
+ }
+
+ virtual void finishData( zypp::Url url, zypp::source::CreateSourceReport::Error error, std::string reason)
+ {
_silent_probing = MEDIA_CHANGE_FULL;
+
+ CB callback( ycpcb( YCPCallbacks::CB_SourceCreateEnd ) );
+
+ if (callback._set)
+ {
+ callback.addStr(url);
+ callback.addStr(CreateSrcErrorAsString(error));
+ callback.addStr(reason);
+
+ callback.evaluate();
+ }
}
};
@@ -1346,4 +1596,197 @@
return SET_YCP_CB( CB_StopConvertDb, args );
}
+
+/**
+ * @builtin CallbackStartDeltaDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string filename, integer download_size)</code>. If the download size is unknown download_size is 0. The callback function is evaluated when a delta RPM download has been started.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackStartDeltaDownload( const YCPString& func ) {
+ return SET_YCP_CB( CB_StartDeltaDownload, func );
+}
+
+/**
+ * @builtin CallbackProgressDeltaDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>boolean (integer value)</code>. The callback function is evaluated when more than 5% of the size has been downloaded since the last evaluation. If the handler returns false the download is aborted.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackProgressDeltaDownload( const YCPString& func ) {
+ return SET_YCP_CB( CB_ProgressDeltaDownload, func );
+}
+
+/**
+ * @builtin CallbackProblemDeltaDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string description)</code>. The callback function should inform user that a problem has occurred during delta file download. This is not fatal, it still may be possible to download the full RPM instead.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackProblemDeltaDownload( const YCPString& func ) {
+ return SET_YCP_CB( CB_ProblemDeltaDownload, func );
+}
+
+/**
+ * @builtin CallbackStartDeltaApply
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string filename)</code>. The callback function should inform user that a delta application has been started.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackStartDeltaApply( const YCPString& func ) {
+ return SET_YCP_CB( CB_StartDeltaApply, func );
+}
+
+/**
+ * @builtin CallbackProgressDeltaApply
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(integer value)</code>. The callback function is evaluated when more than 5% of the delta size has been applied since the last evaluation.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackProgressDeltaApply( const YCPString& func ) {
+ return SET_YCP_CB( CB_ProgressDeltaApply, func );
+}
+
+/**
+ * @builtin CallbackProblemDeltaApply
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string description)</code>. The callback function should inform user that a problem has occurred during delta file application. This is not fatal, it still may be possible to use the full RPM instead.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackProblemDeltaApply( const YCPString& func ) {
+ return SET_YCP_CB( CB_ProblemDeltaApply, func );
+}
+
+/**
+ * @builtin CallbackStartPatchDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string filename, integer download_size)</code>. If the download size is unknown download_size is 0. The callback function is evaluated when a patch download has been started.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackStartPatchDownload( const YCPString& func ) {
+ return SET_YCP_CB( CB_StartPatchDownload, func );
+}
+
+/**
+ * @builtin CallbackProgressPatchDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>boolean(integer value)</code>. The callback function is evaluated when more than 5% of the patch size has been downloaded since the last evaluation. If the handler returns false the download is aborted.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackProgressPatchDownload( const YCPString& func ) {
+ return SET_YCP_CB( CB_ProgressPatchDownload, func );
+}
+
+/**
+ * @builtin CallbackProblemPatchDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string description)</code>. The callback function should inform user that a problem has occurred during download of the patch.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackProblemPatchDownload( const YCPString& func ) {
+ return SET_YCP_CB( CB_ProblemPatchDownload, func );
+}
+
+
+/**
+ * @builtin CallbackFinishDeltaDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void()</code>. The callback function is evaluated when the delta download has been finished.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackFinishDeltaDownload( const YCPString& func)
+{
+ return SET_YCP_CB( CB_FinishDeltaDownload, func );
+}
+
+/**
+ * @builtin CallbackFinishDeltaApply
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void()</code>. The callback function is evaluated when the delta download has been applied.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackFinishDeltaApply( const YCPString& func)
+{
+ return SET_YCP_CB( CB_FinishDeltaApply, func );
+}
+
+/**
+ * @builtin CallbackFinishPatchDownload
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void()</code>. The callback function is evaluated when the patch download has been finished.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackFinishPatchDownload( const YCPString& func)
+{
+ return SET_YCP_CB( CB_FinishPatchDownload, func );
+}
+
+
+/**
+ * @builtin CallbackSourceCreateStart
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string url)</code>. The callback is evaluated when a source creation has been started.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackSourceCreateStart( const YCPString& func)
+{
+ return SET_YCP_CB( CB_SourceCreateStart, func );
+}
+
+
+/**
+ * @builtin CallbackSourceCreateStartProbe
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string url)</code>. The callback is evaluated when a source type (YUM/SUSE) probing has been started.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackSourceCreateStartProbe( const YCPString& func)
+{
+ return SET_YCP_CB( CB_SourceCreateStartProbe, func );
+}
+
+/**
+ * @builtin CallbackSourceCreateEndProbe
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string url)</code>. The callback is evaluated when a source type (YUM/SUSE) probing has been finished.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackSourceCreateEndProbe( const YCPString& func)
+{
+ return SET_YCP_CB( CB_SourceCreateEndProbe, func );
+}
+
+/**
+ * @builtin CallbackSourceProgressData
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>boolean(integer value)</code>. The callback function is evaluated when more than 5% of the data has been processed since the last evaluation. If the handler returns false the download is aborted.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackSourceCreateProgressData( const YCPString& func)
+{
+ return SET_YCP_CB( CB_SourceCreateProgressData, func );
+}
+
+/**
+ * @builtin CallbackSourceCreateError
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string url, string err_code, string description)</code>. err_code is "NO_ERROR", "NOT_FOUND" (the URL was not found), "IO" (I/O error) or "INVALID" (the source is not valid). The callback function is evaluated when an error occurrs during creation of the source.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackSourceCreateError( const YCPString& func)
+{
+ return SET_YCP_CB( CB_SourceCreateError, func );
+}
+
+/**
+ * @builtin CallbackSourceCreateEnd
+ * @short Register callback function
+ * @param string func Name of the callback handler function. Required callback prototype is <code>void(string url, string err_code, string description)</code>. err_code is "NO_ERROR", "NOT_FOUND" (the URL was not found), "IO" (I/O error) or "INVALID" (the source is not valid). The callback function is evaluated when creation of the source has been finished.
+ * @return void
+ */
+YCPValue PkgModuleFunctions::CallbackSourceCreateEnd( const YCPString& func)
+{
+ return SET_YCP_CB( CB_SourceCreateEnd, func );
+}
+
#undef SET_YCP_CB
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/Package.cc new/yast2-pkg-bindings-2.13.92/src/Package.cc
--- old/yast2-pkg-bindings-2.13.90/src/Package.cc 2006-06-14 17:15:42.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/Package.cc 2006-08-09 09:26:15.000000000 +0200
@@ -541,9 +541,10 @@
zypp::PoolItem_Ref item;
zypp::Arch _architecture;
zypp::ResStatus::TransactByValue whoWantsIt;
+ std::string version;
- ProvideProcess( zypp::Arch arch )
- : _architecture( arch ), whoWantsIt(zypp::ResStatus::APPL_HIGH)
+ ProvideProcess( zypp::Arch arch, const std::string &vers)
+ : _architecture( arch ), whoWantsIt(zypp::ResStatus::APPL_HIGH), version(vers)
{ }
bool operator()( zypp::PoolItem provider )
@@ -553,6 +554,13 @@
// 3. best edition
// see QueueItemRequire in zypp/solver/detail, RequireProcess
+ // check the version if it's specified
+ if (!version.empty() && version != provider->edition().asString())
+ {
+ y2milestone("Skipping version %s (requested: %s)", provider->edition().asString().c_str(), version.c_str());
+ return true;
+ }
+
if (!provider.status().isInstalled())
{
// deselect the item if it's already selected,
@@ -588,11 +596,11 @@
*/
bool
-PkgModuleFunctions::DoProvideNameKind( const std::string & name, zypp::Resolvable::Kind kind)
+PkgModuleFunctions::DoProvideNameKind( const std::string & name, zypp::Resolvable::Kind kind, zypp::Arch architecture, const std::string & version)
{
try
{
- ProvideProcess info( zypp_ptr()->architecture() );
+ ProvideProcess info( architecture, version );
info.whoWantsIt = whoWantsIt;
invokeOnEach( zypp_ptr()->pool().byNameBegin( name ),
@@ -726,7 +734,7 @@
{
if (tags->value(i)->isString())
{
- DoProvideNameKind (tags->value(i)->asString()->value(), zypp::ResTraitszypp::Package::kind);
+ DoProvideNameKind (tags->value(i)->asString()->value(), zypp::ResTraitszypp::Package::kind, zypp_ptr()->architecture(), "");
}
else
{
@@ -1634,10 +1642,9 @@
// ensure installation of the 'best' architecture
- return YCPBoolean( DoProvideNameKind( name, zypp::ResTraitszypp::Package::kind) );
+ return YCPBoolean( DoProvideNameKind( name, zypp::ResTraitszypp::Package::kind, zypp_ptr()->architecture(), "") );
}
-
/**
@builtin PkgSrcInstall
@@ -1655,7 +1662,7 @@
// ensure installation of the 'best' architecture
- return YCPBoolean( DoProvideNameKind( name, zypp::ResTraitszypp::SrcPackage::kind) );
+ return YCPBoolean( DoProvideNameKind( name, zypp::ResTraitszypp::SrcPackage::kind, zypp_ptr()->architecture(), "" ) );
}
@@ -2185,6 +2192,10 @@
resolvable->add (YCPString ("kind"), YCPSymbol ("patch"));
else
resolvable->add (YCPString ("kind"), YCPSymbol ("package"));
+ resolvable->add (YCPString ("arch"),
+ YCPString (it->resolvable()->arch().asString()));
+ resolvable->add (YCPString ("version"),
+ YCPString (it->resolvable()->edition().asString()));
remlist->add(resolvable);
}
ret->add(remlist);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/PkgModuleFunctions.h new/yast2-pkg-bindings-2.13.92/src/PkgModuleFunctions.h
--- old/yast2-pkg-bindings-2.13.90/src/PkgModuleFunctions.h 2006-08-02 10:18:17.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/PkgModuleFunctions.h 2006-08-11 09:37:32.000000000 +0200
@@ -41,6 +41,7 @@
#include
#include
#include
+#include
#include
#include
@@ -79,7 +80,7 @@
private: // source related
- bool DoProvideNameKind( const std::string & name , zypp::Resolvable::Kind kind);
+ bool DoProvideNameKind( const std::string & name, zypp::Resolvable::Kind kind, zypp::Arch architecture, const std::string& version);
bool DoRemoveNameKind( const std::string & name, zypp::Resolvable::Kind kind);
bool DoProvideAllKind(zypp::Resolvable::Kind kind);
bool DoRemoveAllKind(zypp::Resolvable::Kind kind);
@@ -156,6 +157,18 @@
/* TYPEINFO: void(string) */
YCPValue CallbackDoneDownload (const YCPString& func);
/* TYPEINFO: void(string) */
+ YCPValue CallbackSourceCreateStart( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackSourceCreateStartProbe( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackSourceCreateEndProbe( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackSourceCreateProgressData( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackSourceCreateError( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackSourceCreateEnd( const YCPString& func);
+ /* TYPEINFO: void(string) */
YCPValue CallbackStartSourceRefresh( const YCPString& func);
/* TYPEINFO: void(string) */
YCPValue CallbackProgressSourceRefresh( const YCPString& func);
@@ -163,6 +176,32 @@
YCPValue CallbackErrorSourceRefresh( const YCPString& func);
/* TYPEINFO: void(string) */
YCPValue CallbackDoneSourceRefresh( const YCPString& func);
+
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackStartDeltaDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackProgressDeltaDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackProblemDeltaDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackStartDeltaApply( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackProgressDeltaApply( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackProblemDeltaApply( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackStartPatchDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackProgressPatchDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackProblemPatchDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackFinishDeltaDownload( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackFinishDeltaApply( const YCPString& func);
+ /* TYPEINFO: void(string) */
+ YCPValue CallbackFinishPatchDownload( const YCPString& func);
+
/* TYPEINFO: void(string) */
YCPValue CallbackMediaChange (const YCPString& func);
/* TYPEINFO: void(string) */
@@ -285,7 +324,11 @@
// target related
/* TYPEINFO: boolean(string,boolean)*/
- YCPValue TargetInit (const YCPString& root, const YCPBoolean& n);
+ YCPValue TargetInit (const YCPString& root, const YCPBoolean& unused);
+ /* TYPEINFO: boolean(string)*/
+ YCPValue TargetInitialize (const YCPString& root);
+ /* TYPEINFO: boolean()*/
+ YCPValue TargetLoad ();
/* TYPEINFO: boolean()*/
YCPBoolean TargetDisableSources ();
/* TYPEINFO: boolean()*/
@@ -458,6 +501,8 @@
YCPValue YouRemovePackages ();
/* TYPEINFO: boolean(string,symbol)*/
YCPValue ResolvableInstall( const YCPString& name_r, const YCPSymbol& kind_r );
+ /* TYPEINFO: boolean(string,symbol,string,string)*/
+ YCPValue ResolvableInstallArchVersion( const YCPString& name_r, const YCPSymbol& kind_r, const YCPString& arch, const YCPString& vers );
/* TYPEINFO: boolean(string,symbol)*/
YCPValue ResolvableRemove( const YCPString& name_r, const YCPSymbol& kind_r );
/* TYPEINFO: boolean(string,symbol,boolean)*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/Resolvable.cc new/yast2-pkg-bindings-2.13.92/src/Resolvable.cc
--- old/yast2-pkg-bindings-2.13.90/src/Resolvable.cc 2006-08-02 10:18:17.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/Resolvable.cc 2006-08-09 09:30:46.000000000 +0200
@@ -46,19 +46,28 @@
// ------------------------
/**
- @builtin ResolvableInstall
- @short Install all resolvables with selected name and kind
+ @builtin ResolvableInstallArchVersion
+ @short Install all resolvables with selected name, architecture and kind. Use it only in a special case, ResolvableInstall() should be prefrerred.
@param name_r name of the resolvable, if empty ("") install all resolvables of the kind
@param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @param arch architecture of the resolvable
+ @param vers Required version of the resolvable, empty string means any version
@return boolean false if failed
*/
YCPValue
-PkgModuleFunctions::ResolvableInstall( const YCPString& name_r, const YCPSymbol& kind_r )
+PkgModuleFunctions::ResolvableInstallArchVersion( const YCPString& name_r, const YCPSymbol& kind_r, const YCPString& arch, const YCPString& vers )
{
zypp::Resolvable::Kind kind;
std::string req_kind = kind_r->symbol ();
+ std::string arch_str = arch->value();
+ if (arch_str.empty())
+ return YCPBoolean (false);
+
+ // ensure installation of the required architecture
+ zypp::Arch architecture(arch_str);
+
if( req_kind == "product" ) {
kind = zypp::ResTraitszypp::Product::kind;
}
@@ -80,13 +89,28 @@
return YCPBoolean(false);
}
+ std::string version_str = vers->value();
+
return YCPBoolean(
(name_r->value().empty())
? DoProvideAllKind(kind)
- : DoProvideNameKind (name_r->value(), kind)
+ : DoProvideNameKind (name_r->value(), kind, architecture, version_str)
);
}
+// ------------------------
+/**
+ @builtin ResolvableInstall
+ @short Install all resolvables with selected name and kind
+ @param name_r name of the resolvable, if empty ("") install all resolvables of the kind
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `selection or `pattern
+ @return boolean false if failed
+*/
+YCPValue
+PkgModuleFunctions::ResolvableInstall( const YCPString& name_r, const YCPSymbol& kind_r )
+{
+ return ResolvableInstallArchVersion(name_r, kind_r, YCPString(zypp_ptr()->architecture().asString()), YCPString(""));
+}
// ------------------------
/**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/Selection.cc new/yast2-pkg-bindings-2.13.92/src/Selection.cc
--- old/yast2-pkg-bindings-2.13.90/src/Selection.cc 2006-06-07 09:43:41.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/Selection.cc 2006-08-08 14:56:42.000000000 +0200
@@ -512,7 +512,7 @@
YCPBoolean
PkgModuleFunctions::SetSelection (const YCPString& selection)
{
- return DoProvideNameKind( selection->value(), zypp::ResTraitszypp::Selection::kind);
+ return DoProvideNameKind( selection->value(), zypp::ResTraitszypp::Selection::kind, zypp_ptr()->architecture(), "");
}
// ------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-pkg-bindings-2.13.90/src/Target.cc new/yast2-pkg-bindings-2.13.92/src/Target.cc
--- old/yast2-pkg-bindings-2.13.90/src/Target.cc 2006-06-07 09:43:41.000000000 +0200
+++ new/yast2-pkg-bindings-2.13.92/src/Target.cc 2006-08-09 15:03:40.000000000 +0200
@@ -41,23 +41,26 @@
#include
#include
+using namespace zypp;
+
/** ------------------------
*
* @builtin TargetInit
- * @short Initialize Target
+ * @deprecated
+ * @short Initialize Target and load resolvables
* @param string root Root Directory
* @param boolean new If true, initialize new rpm database
* @return boolean
*/
YCPValue
-PkgModuleFunctions::TargetInit (const YCPString& root, const YCPBoolean& /*unused*/ )
+PkgModuleFunctions::TargetInit (const YCPString& root, const YCPBoolean & /*unused_and_broken*/)
{
std::string r = root->value();
try
{
zypp_ptr()->initTarget(r);
- zypp_ptr()->target()->enableStorage(r);
+ zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
}
catch (zypp::Exception & excpt)
{
@@ -77,6 +80,61 @@
/** ------------------------
*
+ * @builtin TargetInitialize
+ * @short Initialize Target, read the keys.
+ * @param string root Root Directory
+ * @return boolean
+ */
+YCPValue
+PkgModuleFunctions::TargetInitialize (const YCPString& root)
+{
+ std::string r = root->value();
+
+ try
+ {
+ zypp_ptr()->initializeTarget(r);
+ }
+ catch (zypp::Exception & excpt)
+ {
+ _last_error.setLastError(excpt.asUserString());
+ ycperror("TargetInit has failed: %s", excpt.msg().c_str() );
+ return YCPError(excpt.msg().c_str(), YCPBoolean(false));
+ }
+
+ _target_root = zypp::Pathname(root->value());
+
+ // we have moved to a different target, the broken source information
+ // is no longer valid
+ _broken_sources.clear();
+
+ return YCPBoolean(true);
+}
+
+/** ------------------------
+ *
+ * @builtin TargetLoad
+ * @short Load target resolvables into the pool
+ * @return boolean
+ */
+YCPValue
+PkgModuleFunctions::TargetLoad ()
+{
+ try
+ {
+ zypp_ptr()->addResolvables( zypp_ptr()->target()->resolvables(), true );
+ }
+ catch (zypp::Exception & excpt)
+ {
+ _last_error.setLastError(excpt.asUserString());
+ ycperror("TargetLoad has failed: %s", excpt.msg().c_str() );
+ return YCPError(excpt.msg().c_str(), YCPBoolean(false));
+ }
+
+ return YCPBoolean(true);
+}
+
+/** ------------------------
+ *
* @builtin TargetDisableSources
* @short Disable all sources configured on the target. Typically
* used on upgrade.
@@ -302,23 +360,59 @@
try
{
- for(zypp::ResPool::byKind_iterator it = zypp_ptr()->pool().byKindBegin(zypp::ResTraitszypp::Product::kind)
- ; it != zypp_ptr()->pool().byKindEnd(zypp::ResTraitszypp::Product::kind)
- ; ++it)
- {
- zypp::Product::constPtr product = boost::dynamic_pointer_cast<const zypp::Product>( it->resolvable() );
-
- if (it->status().isInstalled() )
- {
- YCPMap prod;
+ for (ResStore::resfilter_const_iterator it = zypp_ptr()->target()->byKindBegin(ResTraits<Product>::kind); it != zypp_ptr()->target()->byKindEnd(ResTraits<Product>::kind); ++it)
+ {
+ zypp::Product::constPtr product = asKind<const zypp::Product>( *it );
#warning TargetProducts does not return all keys
- // see also PkgModuleFunctions::Descr2Map and Product.ycp::Product
- prod->add( YCPString("name"), YCPString( product->name() ) );
- prod->add( YCPString("version"), YCPString( product->edition().version() ) );
- prod->add( YCPString("relnotesurl"), YCPString( product->releaseNotesUrl().asString() ) );
- products->add(prod);
- }
- }
+ YCPMap prod;
+ // see also PkgModuleFunctions::Descr2Map and Product.ycp::Product
+// FIXME unify with code in Pkg::ResolvablePropertiesEx
+ prod->add( YCPString("name"), YCPString( product->name() ) );
+ prod->add( YCPString("version"), YCPString( product->edition().version() ) );
+ prod->add(YCPString("category"), YCPString(product->category()));
+ prod->add(YCPString("vendor"), YCPString(product->vendor()));
+ prod->add(YCPString("relnotes_url"), YCPString(product->releaseNotesUrl().asString()));
+ std::string product_summary = product->summary();
+ if (product_summary.size() > 0)
+ {
+ prod->add(YCPString("display_name"), YCPString(product_summary));
+ }
+ std::string product_shortname = product->shortName();
+ if (product_shortname.size() > 0)
+ {
+ prod->add(YCPString("short_name"), YCPString(product_shortname));
+ }
+ // use summary for the short name if it's defined
+ else if (product_summary.size() > 0)
+ {
+ prod->add(YCPString("short_name"), YCPString(product_summary));
+ }
+ prod->add(YCPString("description"), YCPString((*it)->description()));
+
+ std::string resolvable_summary = (*it)->summary();
+ if (resolvable_summary.size() > 0)
+ {
+ prod->add(YCPString("summary"), YCPString((*it)->summary()));
+ }
+ YCPList updateUrls;
+ std::listzypp::Url pupdateUrls = product->updateUrls();
+ for (std::listzypp::Url::const_iterator it = pupdateUrls.begin(); it != pupdateUrls.end(); ++it)
+ {
+ updateUrls->add(YCPString(it->asString()));
+ }
+ prod->add(YCPString("update_urls"), updateUrls);
+
+ YCPList flags;
+ std::liststd::string pflags = product->flags();
+ for (std::liststd::string::const_iterator flag_it = pflags.begin();
+ flag_it != pflags.end(); ++flag_it)
+ {
+ flags->add(YCPString(*flag_it));
+ }
+ prod->add(YCPString("flags"), flags);
+
+ products->add(prod);
+ }
}
catch(...)
{
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org