Hello community,
here is the log from the commit of package yast2-pkg-bindings
checked in at Sat Sep 6 05:10:02 CEST 2008.
--------
--- yast2-pkg-bindings/yast2-pkg-bindings.changes 2008-08-21 14:12:35.000000000 +0200
+++ yast2-pkg-bindings/yast2-pkg-bindings.changes 2008-09-04 14:10:14.837633000 +0200
@@ -1,0 +2,9 @@
+Thu Sep 4 12:53:53 CEST 2008 - lslezak@suse.cz
+
+- added support for services, new functions: Pkg::ServiceAliases(),
+ Pkg::ServiceAdd() Pkg::ServiceDelete(), Pkg::ServiceGet(),
+ Pkg::ServiceSet(), Pkg::ServicesSave(), Pkg::ServicesLoad(),
+ Pkg::ServiceRefresh(), Pkg::ServicesReset()
+- 2.17.9
+
+-------------------------------------------------------------------
Old:
----
yast2-pkg-bindings-2.17.8.tar.bz2
New:
----
yast2-pkg-bindings-2.17.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-pkg-bindings-devel-doc.spec ++++++
--- /var/tmp/diff_new_pack.D13705/_old 2008-09-06 05:08:29.000000000 +0200
+++ /var/tmp/diff_new_pack.D13705/_new 2008-09-06 05:08:29.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pkg-bindings-devel-doc (Version 2.17.8)
+# spec file for package yast2-pkg-bindings-devel-doc (Version 2.17.9)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-pkg-bindings-devel-doc
-Version: 2.17.8
+Version: 2.17.9
Release: 1
License: GPL v2 or later
Group: Documentation/HTML
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-2.17.8.tar.bz2
+Source0: yast2-pkg-bindings-2.17.9.tar.bz2
Prefix: %_prefix
# same as in the main package (because we use the same configure.in.in)
BuildRequires: blocxx-devel docbook-xsl-stylesheets doxygen gcc-c++ libgcrypt-devel libxcrypt-devel libxslt libzypp-devel perl-XML-Writer sgml-skel yast2-core-devel yast2-devtools
@@ -45,7 +45,7 @@
Ladislav Slez�k
%prep
-%setup -n yast2-pkg-bindings-2.17.8
+%setup -n yast2-pkg-bindings-2.17.9
# build only documentation, ignore all other directories
echo "doc" > SUBDIRS
++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.D13705/_old 2008-09-06 05:08:29.000000000 +0200
+++ /var/tmp/diff_new_pack.D13705/_new 2008-09-06 05:08:29.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-pkg-bindings (Version 2.17.8)
+# spec file for package yast2-pkg-bindings (Version 2.17.9)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-pkg-bindings
-Version: 2.17.8
+Version: 2.17.9
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-pkg-bindings-2.17.8.tar.bz2
+Source0: yast2-pkg-bindings-2.17.9.tar.bz2
Prefix: /usr
BuildRequires: blocxx-devel docbook-xsl-stylesheets doxygen gcc-c++ libgcrypt-devel libxcrypt-devel libxslt perl-XML-Writer sgml-skel yast2-core-devel yast2-devtools
BuildRequires: libzypp-devel >= 5.0.0
@@ -47,7 +47,7 @@
Stanislav Visnovsky
%prep
-%setup -n yast2-pkg-bindings-2.17.8
+%setup -n yast2-pkg-bindings-2.17.9
# build only the library, ignore documentation (it is in devel-doc package)
echo "src" > SUBDIRS
@@ -79,6 +79,12 @@
%{_libdir}/YaST2/plugin/libpy2Pkg.so
%doc %{prefix}/share/doc/packages/yast2-pkg-bindings
%changelog
+* Thu Sep 04 2008 lslezak@suse.cz
+- added support for services, new functions: Pkg::ServiceAliases(),
+ Pkg::ServiceAdd() Pkg::ServiceDelete(), Pkg::ServiceGet(),
+ Pkg::ServiceSet(), Pkg::ServicesSave(), Pkg::ServicesLoad(),
+ Pkg::ServiceRefresh(), Pkg::ServicesReset()
+- 2.17.9
* Thu Aug 21 2008 lslezak@suse.cz
- 2.17.8
* Wed Aug 20 2008 lslezak@suse.cz
++++++ yast2-pkg-bindings-2.17.8.tar.bz2 -> yast2-pkg-bindings-2.17.9.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/configure new/yast2-pkg-bindings-2.17.9/configure
--- old/yast2-pkg-bindings-2.17.8/configure 2008-08-21 14:02:56.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/configure 2008-09-04 13:58:36.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-pkg-bindings 2.17.8.
+# Generated by GNU Autoconf 2.61 for yast2-pkg-bindings 2.17.9.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -728,8 +728,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-pkg-bindings'
PACKAGE_TARNAME='yast2-pkg-bindings'
-PACKAGE_VERSION='2.17.8'
-PACKAGE_STRING='yast2-pkg-bindings 2.17.8'
+PACKAGE_VERSION='2.17.9'
+PACKAGE_STRING='yast2-pkg-bindings 2.17.9'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1453,7 +1453,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-pkg-bindings 2.17.8 to adapt to many kinds of systems.
+\`configure' configures yast2-pkg-bindings 2.17.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1524,7 +1524,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-pkg-bindings 2.17.8:";;
+ short | recursive ) echo "Configuration of yast2-pkg-bindings 2.17.9:";;
esac
cat <<\_ACEOF
@@ -1636,7 +1636,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-pkg-bindings configure 2.17.8
+yast2-pkg-bindings configure 2.17.9
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1650,7 +1650,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-pkg-bindings $as_me 2.17.8, which was
+It was created by yast2-pkg-bindings $as_me 2.17.9, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2471,7 +2471,7 @@
# Define the identity of the package.
PACKAGE='yast2-pkg-bindings'
- VERSION='2.17.8'
+ VERSION='2.17.9'
cat >>confdefs.h <<_ACEOF
@@ -2699,7 +2699,7 @@
-VERSION="2.17.8"
+VERSION="2.17.9"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák "
@@ -21700,7 +21700,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-pkg-bindings $as_me 2.17.8, which was
+This file was extended by yast2-pkg-bindings $as_me 2.17.9, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21753,7 +21753,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-pkg-bindings config.status 2.17.8
+yast2-pkg-bindings config.status 2.17.9
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/configure.in new/yast2-pkg-bindings-2.17.9/configure.in
--- old/yast2-pkg-bindings-2.17.8/configure.in 2008-08-21 14:02:43.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/configure.in 2008-09-04 13:58:22.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.17.3 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-pkg-bindings, 2.17.8, http://bugs.opensuse.org/, yast2-pkg-bindings)
+AC_INIT(yast2-pkg-bindings, 2.17.9, http://bugs.opensuse.org/, yast2-pkg-bindings)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.17.8"
+VERSION="2.17.9"
RPMNAME="yast2-pkg-bindings"
MAINTAINER="Ladislav Slezák "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/doc/builtins.xml new/yast2-pkg-bindings-2.17.9/doc/builtins.xml
--- old/yast2-pkg-bindings-2.17.8/doc/builtins.xml 2008-05-14 19:17:56.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/doc/builtins.xml 2008-09-04 12:40:57.000000000 +0200
@@ -22,6 +22,7 @@
<!ENTITY PkgModuleFunctionsSource_Load SYSTEM "Source_Load.xml">
<!ENTITY PkgModuleFunctionsSource_Save SYSTEM "Source_Save.xml">
<!ENTITY PkgModuleFunctionsSource_Set SYSTEM "Source_Set.xml">
+<!ENTITY PkgModuleFunctionsService SYSTEM "Service.xml">
<!ENTITY PkgModuleFunctionsTarget_DU SYSTEM "Target_DU.xml">
<!ENTITY PkgModuleFunctionsTarget_Load SYSTEM "Target_Load.xml">
<!ENTITY PkgModuleFunctionsTarget SYSTEM "Target.xml">
@@ -75,6 +76,7 @@
&PkgModuleFunctionsSource_Load;
&PkgModuleFunctionsSource_Save;
&PkgModuleFunctionsSource_Set;
+ &PkgModuleFunctionsService;
&PkgModuleFunctionsTarget_DU;
&PkgModuleFunctionsTarget_Load;
&PkgModuleFunctionsTarget;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/pkg-bindings.pot new/yast2-pkg-bindings-2.17.9/pkg-bindings.pot
--- old/yast2-pkg-bindings-2.17.8/pkg-bindings.pot 2007-12-12 16:36:49.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.9/pkg-bindings.pot 2008-09-04 13:21:12.000000000 +0200
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-12-12 16:36+0100\n"
+"POT-Creation-Date: 2008-09-04 13:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,6 +16,10 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
+#: src/GPGMap.cc:54
+msgid "Never"
+msgstr ""
+
#. help text
#: src/HelpTexts.h:36
msgid "<P><BIG><B>Loading Available Packages</B></BIG></P><P>Loading available objects from the configured repositories is in progress. This may take a while...</P>"
@@ -23,7 +27,7 @@
#. help text
#: src/HelpTexts.h:42
-msgid "<P><BIG><B>Loading Installed Packages</B><BIG></P><P>The package manager is reading installed packages...</P>"
+msgid "<P><BIG><B>Loading Installed Packages</B></BIG></P><P>The package manager is reading installed packages...</P>"
msgstr ""
#. help text
@@ -39,6 +43,22 @@
msgid "<P><BIG><B>Refreshing the Repository</B></BIG></P><P>The package manager is updating the repository content...</P>"
msgstr ""
+#. error message
+#: src/Package.cc:648
+msgid "The package cannot be selected to install."
+msgstr ""
+
+#. error message
+#: src/Package.cc:654
+msgid "The package is not available."
+msgstr ""
+
+#. still not initialized, throw an exception
+#. translators: this is an error message
+#: src/PkgFunctions.cc:119
+msgid "Cannot connect to the package manager"
+msgstr ""
+
#: src/Source_Callbacks.cc:129
msgid "Refreshing repository "
msgstr ""
@@ -47,102 +67,102 @@
msgid "Probing repository "
msgstr ""
-#: src/Source_Create.cc:51
+#: src/Source_Create.cc:52
msgid "Scanning products in "
msgstr ""
-#: src/Source_Create.cc:593
+#: src/Source_Create.cc:608
msgid "Search Available Products"
msgstr ""
-#: src/Source_Create.cc:598
+#: src/Source_Create.cc:613
msgid "Probe Source Type"
msgstr ""
-#: src/Source_Create.cc:601
+#: src/Source_Create.cc:616
msgid "Download Descriptions"
msgstr ""
-#: src/Source_Create.cc:602 src/Source_Download.cc:243 src/Source_Load.cc:112
-#: src/Source_Load.cc:304
+#: src/Source_Create.cc:617 src/Source_Download.cc:236 src/Source_Load.cc:113
+#: src/Source_Load.cc:391
msgid "Rebuild Cache"
msgstr ""
-#: src/Source_Create.cc:606 src/Source_Load.cc:113 src/Source_Load.cc:305
-#: src/Source_Set.cc:75
+#: src/Source_Create.cc:621 src/Source_Load.cc:114 src/Source_Load.cc:392
+#: src/Source_Set.cc:76
msgid "Load Data"
msgstr ""
-#: src/Source_Create.cc:609
+#: src/Source_Create.cc:624
msgid "Adding the Repository..."
msgstr ""
-#: src/Source_Download.cc:45 src/Source_Download.cc:173
+#: src/Source_Download.cc:46 src/Source_Download.cc:174
msgid "Downloading "
msgstr ""
#. stages: "download", "build cache"
-#: src/Source_Download.cc:242
+#: src/Source_Download.cc:235
msgid "Refresh Metadata"
msgstr ""
#. 3 steps per repository (download, cache rebuild, load resolvables)
-#: src/Source_Download.cc:250
+#: src/Source_Download.cc:243
msgid "Refreshing Repository..."
msgstr ""
#. error message (followed by detailed description)
-#: src/Source_Installation.cc:69
+#: src/Source_Installation.cc:71
msgid "Error: Cannot copy the cache to the target directory\n"
msgstr ""
#. error message (followed by directory name)
-#: src/Source_Installation.cc:103
+#: src/Source_Installation.cc:105
msgid "Cannot create directory "
msgstr ""
#. error message
-#: src/Source_Installation.cc:133
+#: src/Source_Installation.cc:135
msgid "Copying failed"
msgstr ""
-#: src/Source_Load.cc:111 src/Source_Load.cc:303
+#: src/Source_Load.cc:112 src/Source_Load.cc:390
msgid "Refresh Sources"
msgstr ""
#. 3 steps per repository (download, cache rebuild, load resolvables)
-#: src/Source_Load.cc:118 src/Source_Load.cc:308 src/Source_Set.cc:82
-#: src/Target_Load.cc:65 src/Target_Load.cc:129
+#: src/Source_Load.cc:119 src/Source_Load.cc:395 src/Source_Set.cc:83
+#: src/Target_Load.cc:62 src/Target_Load.cc:179
msgid "Loading the Package Manager..."
msgstr ""
-#: src/Source_Load.cc:302
+#: src/Source_Load.cc:389
msgid "Load Sources"
msgstr ""
#. TODO: improve the error message
-#: src/Source_Misc.cc:72
+#: src/Source_Misc.cc:70
msgid "Cannot find source"
msgstr ""
-#: src/Source_Save.cc:112
+#: src/Source_Save.cc:113
msgid "Remove Repositories"
msgstr ""
#. stages: "download", "build cache"
-#: src/Source_Save.cc:117
+#: src/Source_Save.cc:118
msgid "Save Repositories"
msgstr ""
#. start the process
-#: src/Source_Save.cc:125
+#: src/Source_Save.cc:126
msgid "Saving Repositories..."
msgstr ""
-#: src/Target_Load.cc:61
+#: src/Target_Load.cc:58
msgid "Initialize the Target System"
msgstr ""
-#: src/Target_Load.cc:62 src/Target_Load.cc:125
+#: src/Target_Load.cc:59 src/Target_Load.cc:175
msgid "Read Installed Packages"
msgstr ""
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/Makefile.am new/yast2-pkg-bindings-2.17.9/src/Makefile.am
--- old/yast2-pkg-bindings-2.17.8/src/Makefile.am 2008-08-20 10:08:00.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/src/Makefile.am 2008-09-01 17:28:58.000000000 +0200
@@ -51,6 +51,9 @@
Callbacks.cc Callbacks_Register.cc \
Y2PkgFunction.cc Y2PkgFunction.h \
YRepo.h YRepo.cc \
+ PkgService.cc PkgService.h \
+ ServiceManager.cc ServiceManager.h \
+ Service.cc \
HelpTexts.h i18n.h log.h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/Makefile.in new/yast2-pkg-bindings-2.17.9/src/Makefile.in
--- old/yast2-pkg-bindings-2.17.8/src/Makefile.in 2008-08-21 14:02:59.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/src/Makefile.in 2008-09-04 13:58:40.000000000 +0200
@@ -67,7 +67,8 @@
Source_Installation.lo Source_Load.lo Source_Misc.lo \
Source_Resolvables.lo Source_Save.lo Source_Set.lo Keyring.lo \
GPGMap.lo Callbacks.YCP.lo Callbacks.lo Callbacks_Register.lo \
- Y2PkgFunction.lo YRepo.lo
+ Y2PkgFunction.lo YRepo.lo PkgService.lo ServiceManager.lo \
+ Service.lo
libpy2Pkg_la_OBJECTS = $(am_libpy2Pkg_la_OBJECTS)
libpy2Pkg_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
@@ -301,6 +302,9 @@
Callbacks.cc Callbacks_Register.cc \
Y2PkgFunction.cc Y2PkgFunction.h \
YRepo.h YRepo.cc \
+ PkgService.cc PkgService.h \
+ ServiceManager.cc ServiceManager.h \
+ Service.cc \
HelpTexts.h i18n.h log.h
libpy2Pkg_la_LDFLAGS = -version-info 2:0
@@ -398,10 +402,13 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PkgModule.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PkgModuleFunctions.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PkgProgress.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PkgService.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Resolvable_Install.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Resolvable_Patches.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Resolvable_Properties.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Selection.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Service.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServiceManager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Source_Callbacks.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Source_Create.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Source_Download.Plo@am__quote@
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/PkgFunctions.h new/yast2-pkg-bindings-2.17.9/src/PkgFunctions.h
--- old/yast2-pkg-bindings-2.17.8/src/PkgFunctions.h 2008-08-20 10:08:00.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/src/PkgFunctions.h 2008-09-01 18:02:11.000000000 +0200
@@ -51,6 +51,8 @@
#include
#include
+#include "ServiceManager.h"
+
#include "PkgError.h"
class PkgProgress;
@@ -176,6 +178,8 @@
bool target_log_set;
+ ServiceManager service_manager;
+
/**
* Logging helper:
* search for a repository and in case of exception, log error
@@ -754,6 +758,27 @@
/* TYPEINFO: boolean(string)*/
YCPValue SourceMoveDownloadArea (const YCPString & path);
+ // services related functions
+ /* TYPEINFO: list<string>()*/
+ YCPValue ServiceAliases();
+ /* TYPEINFO: boolean(string,string)*/
+ YCPValue ServiceAdd(const YCPString&, const YCPString&);
+ /* TYPEINFO: boolean(string)*/
+ YCPValue ServiceDelete(const YCPString&);
+ /* TYPEINFO: map(string)*/
+ YCPValue ServiceGet(const YCPString&);
+ /* TYPEINFO: boolean(string,map)*/
+ YCPValue ServiceSet(const YCPString&, const YCPMap&);
+ /* TYPEINFO: boolean()*/
+ YCPValue ServicesSave();
+ /* TYPEINFO: boolean()*/
+ YCPValue ServicesLoad();
+ /* TYPEINFO: boolean(string)*/
+ YCPValue ServiceRefresh(const YCPString&);
+ /* TYPEINFO: void()*/
+ YCPValue ServicesReset();
+
+
YCPValue ResolvablePropertiesEx(const YCPString& name, const YCPSymbol& kind_r, const YCPString& version, bool dependencies);
YCPValue ResolvableSetPatches(const YCPSymbol& kind_r, bool preselect);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/PkgService.cc new/yast2-pkg-bindings-2.17.9/src/PkgService.cc
--- old/yast2-pkg-bindings-2.17.8/src/PkgService.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.9/src/PkgService.cc 2008-08-22 13:27:45.000000000 +0200
@@ -0,0 +1,56 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2008 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+
+#include "PkgService.h"
+
+PkgService::PkgService() : _deleted(false), _old_alias()
+{
+}
+
+PkgService::PkgService(const zypp::ServiceInfo &s, const std::string &old_alias) :
+ zypp::ServiceInfo(s), _deleted(false), _old_alias(old_alias.empty() ? s.alias() : old_alias)
+{
+}
+
+PkgService::PkgService(const PkgService &s) :
+ zypp::ServiceInfo(s), _deleted(s._deleted), _old_alias(s._old_alias)
+{
+}
+
+PkgService::~PkgService()
+{
+}
+
+bool PkgService::isDeleted() const
+{
+ return _deleted;
+}
+
+void PkgService::setDeleted()
+{
+ _deleted = true;
+}
+
+std::string PkgService::origAlias() const
+{
+ return _old_alias;
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/PkgService.h new/yast2-pkg-bindings-2.17.9/src/PkgService.h
--- old/yast2-pkg-bindings-2.17.8/src/PkgService.h 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.9/src/PkgService.h 2008-08-22 13:26:41.000000000 +0200
@@ -0,0 +1,50 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2008 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+#include <string>
+#include
+
+// Extend zypp::ServiceInfo class to contain "deleted" flag and original service alias
+class PkgService : public zypp::ServiceInfo
+{
+ public:
+
+ PkgService();
+
+ PkgService(const zypp::ServiceInfo &s, const std::string &old_alias = "");
+
+ PkgService(const PkgService &s);
+
+ ~PkgService();
+
+ bool isDeleted() const;
+
+ void setDeleted();
+
+ std::string origAlias() const;
+
+
+ private:
+
+ bool _deleted;
+ std::string _old_alias;
+};
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/Service.cc new/yast2-pkg-bindings-2.17.9/src/Service.cc
--- old/yast2-pkg-bindings-2.17.8/src/Service.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.9/src/Service.cc 2008-09-04 12:35:23.000000000 +0200
@@ -0,0 +1,271 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2008 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/*
+ File: $Id$
+ Author: Ladislav Slezák
+ Summary: Functions for accessing services in the package management
+ Namespace: Pkg
+*/
+
+#include "PkgFunctions.h"
+#include "log.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/**
+ @builtin ServiceAliases
+ @short Returns aliases of all known services.
+ @return list<string> list of known aliases
+*/
+YCPValue PkgFunctions::ServiceAliases()
+{
+ YCPList ret;
+
+ ServiceManager::Services services = service_manager.GetServices();
+
+ for_(it, services.begin(), services.end())
+ {
+ ret->add(YCPString(it->alias()));
+ }
+
+ return ret;
+}
+
+/**
+ @builtin ServiceAdd
+ @short Add a new service
+ @param alias alias of the new service, must be unique
+ @param url URL of the serivce
+ @return boolean false if failed
+*/
+YCPValue PkgFunctions::ServiceAdd(const YCPString &alias, const YCPString &url)
+{
+ try
+ {
+ if (alias.isNull() || url.isNull())
+ {
+ y2error("Found nil parameter in Pkg::ServiceAdd()");
+ return YCPBoolean(false);
+ }
+
+ return YCPBoolean(service_manager.AddService(alias->value(), url->value()));
+ }
+ catch(...)
+ {
+ }
+
+ return YCPBoolean(false);
+}
+
+/**
+ @builtin ServiceDelete
+ @short Remove a service
+ @param alias alias of the service to remove
+ @return boolean false if failed
+*/
+YCPValue PkgFunctions::ServiceDelete(const YCPString &alias)
+{
+ try
+ {
+ if (alias.isNull())
+ {
+ y2error("Found nil parameter in Pkg::ServiceDelete()");
+ return YCPBoolean(false);
+ }
+
+ return YCPBoolean(service_manager.RemoveService(alias->value()));
+ }
+ catch(...)
+ {
+ }
+
+ return YCPBoolean(false);
+}
+
+
+/**
+ @builtin ServiceGet
+ @short Get detailed properties of a service
+ @param alias alias of the service
+ @return map Service data in map $[ "alias":string, "name":string, "url":string, "autorefresh":boolean, "enabled":boolean, "file":string ]. "file" is name of the file from which the service has been read, it is empty if the service has not been saved yet
+*/
+YCPValue PkgFunctions::ServiceGet(const YCPString &alias)
+{
+ if (alias.isNull())
+ {
+ y2error("Error: nil service name");
+ return YCPVoid();
+ }
+
+ YCPMap ret;
+ zypp::ServiceInfo s(service_manager.GetService(alias->value()));
+
+ ret->add(YCPString("alias"), YCPString(s.alias()));
+ ret->add(YCPString("name"), YCPString(s.name()));
+ ret->add(YCPString("url"), YCPString(s.url().asString()));
+ ret->add(YCPString("autorefresh"), YCPBoolean(s.autorefresh()));
+ ret->add(YCPString("enabled"), YCPBoolean(s.enabled()));
+ ret->add(YCPString("file"), YCPString(s.filepath().asString()));
+
+ return ret;
+}
+
+/**
+ @builtin ServiceSet
+ @short Set properties of a service
+ @param alias old of the service, if the service is being renamed here is the old alias, the new alias is in the map (the second parameter)
+ @param service new properties of the service, see Pkg::ServiceGet() for the description
+ @return boolean false if failed
+*/
+YCPValue PkgFunctions::ServiceSet(const YCPString &old_alias, const YCPMap &service)
+{
+ if (old_alias.isNull() || service.isNull())
+ {
+ y2error("Error: nil parameter");
+ return YCPBoolean(false);
+ }
+
+ try
+ {
+ zypp::ServiceInfo s(service_manager.GetService(old_alias->value()));
+ YCPValue v;
+
+ v = service->value(YCPString("alias"));
+ if(!v.isNull() && v->isString())
+ {
+ s.setAlias(v->asString()->value());
+ }
+
+ v = service->value(YCPString("name"));
+ if(!v.isNull() && v->isString())
+ {
+ s.setName(v->asString()->value());
+ }
+
+ v = service->value(YCPString("url"));
+ if(!v.isNull() && v->isString())
+ {
+ s.setUrl(v->asString()->value());
+ }
+
+ v = service->value(YCPString("autorefresh"));
+ if(!v.isNull() && v->isBoolean())
+ {
+ s.setAutorefresh(v->asBoolean()->value());
+ }
+
+ v = service->value(YCPString("enabled"));
+ if(!v.isNull() && v->isBoolean())
+ {
+ s.setEnabled(v->asBoolean()->value());
+ }
+
+ // note: do not allow to change the file name?
+
+ return YCPBoolean(service_manager.SetService(old_alias->value(), s));
+ }
+ catch(...)
+ {
+ }
+
+ return YCPBoolean(false);
+}
+
+/**
+ @builtin ServicesSave
+ @short Save the current service configuration to disk.
+ @return boolean false if failed
+*/
+YCPValue PkgFunctions::ServicesSave()
+{
+ try
+ {
+ zypp::RepoManager repomanager = CreateRepoManager();
+ return YCPBoolean(service_manager.SaveServices(repomanager));
+ }
+ catch(...)
+ {
+ }
+
+ return YCPBoolean(false);
+}
+
+/**
+ @builtin ServicesLoad
+ @short Load service configurations from disk. If the services have alrady been loaded it does nothing.
+ @return boolean false if failed
+*/
+YCPValue PkgFunctions::ServicesLoad()
+{
+ try
+ {
+ zypp::RepoManager repomanager = CreateRepoManager();
+ return YCPBoolean(service_manager.LoadServices(repomanager));
+ }
+ catch(...)
+ {
+ }
+
+ return YCPBoolean(false);
+}
+
+/**
+ @builtin ServiceRefresh
+ @short Refresh the service, the service must already be saved on the system!
+ @param alias alias of the service to refresh
+ @return boolean false if failed
+*/
+YCPValue PkgFunctions::ServiceRefresh(const YCPString &alias)
+{
+ try
+ {
+ if (alias.isNull())
+ {
+ y2error("Error: nil parameter");
+ return YCPBoolean(false);
+ }
+
+ zypp::RepoManager repomanager = CreateRepoManager();
+ return YCPBoolean(service_manager.RefreshService(alias->value(), repomanager));
+ }
+ catch(...)
+ {
+ }
+
+ return YCPBoolean(false);
+}
+
+/**
+ @builtin ServicesReset
+ @short Reset the list of known services. All changes are lost.
+*/
+YCPValue PkgFunctions::ServicesReset()
+{
+ service_manager.Reset();
+ return YCPVoid();
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/ServiceManager.cc new/yast2-pkg-bindings-2.17.9/src/ServiceManager.cc
--- old/yast2-pkg-bindings-2.17.8/src/ServiceManager.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.9/src/ServiceManager.cc 2008-09-01 16:03:20.000000000 +0200
@@ -0,0 +1,312 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2008 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+
+#include "log.h"
+#include "ServiceManager.h"
+
+#include
+
+ServiceManager::ServiceManager() : _services_loaded(false)
+{
+}
+
+ServiceManager::~ServiceManager()
+{
+}
+
+bool ServiceManager::LoadServices(const zypp::RepoManager &repomgr)
+{
+ bool ret = true;
+
+ if (!_services_loaded)
+ {
+ try
+ {
+ for_ (it, repomgr.serviceBegin(), repomgr.serviceEnd())
+ {
+ // set the original alias to the current one
+ PkgService s(*it, it->alias());
+ y2milestone("Loaded service %s (%s)", s.alias().c_str(), s.url().asString().c_str());
+ _known_services.insert(std::make_pair(s.alias(), s));
+ }
+
+ _services_loaded = true;
+ }
+ catch(...)
+ {
+ ret = false;
+ }
+ }
+ else
+ {
+ y2warning("Services have already been loaded, skipping load");
+ }
+
+ return ret;
+}
+
+bool ServiceManager::SaveServices(zypp::RepoManager &repomgr) const
+{
+ bool ret = true;
+
+ for_ (it, _known_services.begin(), _known_services.end())
+ {
+ std::string alias(it->second.alias());
+
+ try
+ {
+ // delete
+ if (it->second.isDeleted())
+ {
+ y2milestone("Removing service %s", alias.c_str());
+ repomgr.removeService(alias);
+ }
+ }
+ catch(...)
+ {
+ y2error("Cannot delete service %s", alias.c_str());
+ ret = false;
+ }
+ }
+
+ for_ (it, _known_services.begin(), _known_services.end())
+ {
+ std::string alias(it->second.alias());
+
+ try
+ {
+ // save
+ if (!it->second.isDeleted())
+ {
+ if (it->second != repomgr.getService(alias))
+ {
+ y2milestone("Saving modified service %s", alias.c_str());
+ // FIXME use old alias
+ repomgr.modifyService(alias, it->second);
+ }
+ }
+ }
+ catch(...)
+ {
+ y2error("Cannot save service %s", alias.c_str());
+ ret = false;
+ }
+ }
+
+ return ret;
+}
+
+bool ServiceManager::RefreshService(const std::string &alias, zypp::RepoManager &repomgr) const
+{
+ try
+ {
+ repomgr.refreshService(alias);
+ return true;
+ }
+ catch(...)
+ {
+ return false;
+ }
+}
+
+ServiceManager::Services ServiceManager::GetServices() const
+{
+ Services ret;
+
+ for_ (it, _known_services.begin(), _known_services.end())
+ {
+ // return only valid services
+ if (!it->second.isDeleted())
+ {
+ ret.push_back(it->second);
+ }
+ }
+
+ return ret;
+}
+
+bool ServiceManager::AddService(const std::string &alias, const std::string &url)
+{
+ try
+ {
+ if (alias.empty())
+ {
+ y2error("Empty alias for service %s", url.c_str());
+ return false;
+ }
+
+ PkgServices::iterator serv_it = _known_services.find(alias);
+ std::string orig_alias;
+
+ if (serv_it != _known_services.end())
+ {
+ if (serv_it->second.isDeleted())
+ {
+ // remember the original alias
+ // adding a removed service is the same as changing existing one
+ orig_alias = serv_it->second.alias();
+
+ // we are adding an already removed service,
+ // remove the existing service
+ _known_services.erase(serv_it);
+ }
+ else
+ {
+ y2error("Service with alias %s already exists", alias.c_str());
+ return false;
+ }
+ }
+
+ zypp::ServiceInfo info;
+ info.setAlias(alias);
+ info.setUrl(url);
+
+ PkgService srv(info, orig_alias);
+
+ _known_services.insert(std::make_pair(alias, srv));
+ }
+ catch(...)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ServiceManager::RemoveService(const std::string &alias)
+{
+ try
+ {
+ PkgServices::iterator serv_it = _known_services.find(alias);
+
+ if (serv_it != _known_services.end())
+ {
+ if (serv_it->second.isDeleted())
+ {
+ y2warning("Service %s has been already removed", alias.c_str());
+ return true;
+ }
+ else
+ {
+ serv_it->second.setDeleted();
+ y2milestone("Service %s has been marked as deleted", alias.c_str());
+ return true;
+ }
+ }
+ else
+ {
+ y2error("Service %s does not exist", alias.c_str());
+ return false;
+ }
+ }
+ catch(...)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+void ServiceManager::Reset()
+{
+ y2milestone("Resetting known services...");
+ // reset the internal structures
+ _known_services.clear();
+ _services_loaded = false;
+}
+
+
+zypp::ServiceInfo ServiceManager::GetService(const std::string &alias) const
+{
+ try
+ {
+ PkgServices::const_iterator serv_it = _known_services.find(alias);
+
+ if (serv_it != _known_services.end())
+ {
+ if (serv_it->second.isDeleted())
+ {
+ y2warning("Service %s has been removed", alias.c_str());
+ return zypp::ServiceInfo::noService;
+ }
+ else
+ {
+ return serv_it->second;
+ }
+ }
+ else
+ {
+ y2error("Service %s does not exist", alias.c_str());
+ return zypp::ServiceInfo::noService;
+ }
+ }
+ catch(...)
+ {
+ }
+
+ return zypp::ServiceInfo::noService;
+}
+
+bool ServiceManager::SetService(const std::string old_alias, const zypp::ServiceInfo &srv)
+{
+ try
+ {
+ PkgServices::const_iterator serv_it = _known_services.find(old_alias);
+
+ if (serv_it != _known_services.end())
+ {
+ if (serv_it->second.isDeleted())
+ {
+ y2warning("Service %s has been removed", old_alias.c_str());
+ return false;
+ }
+ else
+ {
+ // if the alias has been already changed then keep the original alias
+ if (old_alias == serv_it->second.alias() )
+ {
+ PkgService s(srv, old_alias);
+ _known_services[srv.alias()] = s;
+ }
+ else
+ {
+ // keep the old alias
+ PkgService s(srv, serv_it->second.origAlias());
+ _known_services[srv.alias()] = s;
+ }
+
+ return true;
+ }
+ }
+ else
+ {
+ y2error("Service %s does not exist", old_alias.c_str());
+ return false;
+ }
+ }
+ catch(...)
+ {
+ }
+
+ return false;
+}
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/src/ServiceManager.h new/yast2-pkg-bindings-2.17.9/src/ServiceManager.h
--- old/yast2-pkg-bindings-2.17.8/src/ServiceManager.h 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-pkg-bindings-2.17.9/src/ServiceManager.h 2008-09-01 14:48:17.000000000 +0200
@@ -0,0 +1,72 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2008 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+
+#include <map>
+#include <string>
+#include "PkgService.h"
+
+namespace zypp
+{
+ class RepoManager;
+}
+
+class ServiceManager
+{
+ public:
+
+ typedef std::listzypp::ServiceInfo Services;
+
+ ServiceManager();
+
+ ~ServiceManager();
+
+ Services GetServices() const;
+
+ bool LoadServices(const zypp::RepoManager &repomgr);
+
+ bool SaveServices(zypp::RepoManager &repomgr) const;
+
+ bool AddService(const std::string &alias, const std::string &url);
+
+ bool RemoveService(const std::string &alias);
+
+ zypp::ServiceInfo GetService(const std::string &alias) const;
+
+ bool SetService(const std::string old_alias, const zypp::ServiceInfo &srv);
+
+ bool RefreshService(const std::string &alias, zypp::RepoManager &repomgr) const;
+
+ void Reset();
+
+
+ private:
+
+ // current alias -> PkgService for convenient search by alias
+ typedef std::map PkgServices;
+
+ // services has been loaded from system
+ bool _services_loaded;
+
+ // all known services (even deleted)
+ PkgServices _known_services;
+};
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.17.8/VERSION new/yast2-pkg-bindings-2.17.9/VERSION
--- old/yast2-pkg-bindings-2.17.8/VERSION 2008-08-21 11:03:42.000000000 +0200
+++ new/yast2-pkg-bindings-2.17.9/VERSION 2008-09-04 13:50:46.000000000 +0200
@@ -1 +1 @@
-2.17.8
+2.17.9
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org