Hello community,
here is the log from the commit of package yast2-core for openSUSE:Factory
checked in at Mon Jun 29 16:33:29 CEST 2009.
--------
--- yast2-core/yast2-core.changes 2009-06-15 18:19:51.000000000 +0200
+++ yast2-core/yast2-core.changes 2009-06-19 15:49:08.000000000 +0200
@@ -1,0 +2,18 @@
+Fri Jun 19 14:14:13 CEST 2009 - mvidner@suse.cz
+
+- float::tolstring fixed to use the fixed notation
+- 2.18.14
+
+-------------------------------------------------------------------
+Thu Jun 18 16:59:49 CEST 2009 - lslezak@suse.cz
+
+- DBus service - fixed returning "any" values (bnc#513503),
+ return correct signatures in DBus introspection data, return the
+ values according to it (bnc#513571), added basic testuite
+
+-------------------------------------------------------------------
+Wed Jun 17 13:53:30 CEST 2009 - mvidner@suse.cz
+
+- DBusServerBase: exit properly if the connection got closed
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-core-2.18.13.tar.bz2
New:
----
yast2-core-2.18.14.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-core.spec ++++++
--- /var/tmp/diff_new_pack.Hz1648/_old 2009-06-29 16:30:43.000000000 +0200
+++ /var/tmp/diff_new_pack.Hz1648/_new 2009-06-29 16:30:43.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-core (Version 2.18.13)
+# spec file for package yast2-core (Version 2.18.14)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-core
-Version: 2.18.13
+Version: 2.18.14
Release: 1
-License: GPL v2 or later
+License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-core-2.18.13.tar.bz2
+Source0: yast2-core-2.18.14.tar.bz2
Prefix: /usr
# obviously
BuildRequires: gcc-c++
@@ -46,7 +46,7 @@
# libycp includes crypto built-ins
BuildRequires: libxcrypt-devel
# for SCR DBus service
-BuildRequires: PolicyKit-devel dbus-1-devel
+BuildRequires: PolicyKit-devel dbus-1-devel dbus-1-x11
Summary: YaST2 - Core Libraries
Requires: perl = %{perl_version}
Provides: liby2util = 2.16.1
@@ -56,20 +56,11 @@
This package contains the scanner, parser, and interpreter runtime
library for the YCP scripting language used in YaST2.
-
-
-Authors:
---------
- Arvin Schnell
- Klaus Kaempf
- Mathias Kettner
- Stefan Hundhammer
-
%package devel
-License: GPL v2 or later
+License: GPL
Requires: yast2-core = %version
-Group: Development/Libraries/YaST
-Summary: YaST2 - Include Files and Documentation for Core Libraries
+Group: Development/Libraries
+Summary: YaST2 - Core Libraries
Provides: liby2util-devel = 2.16.1
Obsoletes: liby2util-devel < 2.16.1
Requires: libxcrypt-devel hwinfo-devel
@@ -84,20 +75,11 @@
This package contains include and documentation files for developing
applications using the YaST2 YCP interpreter.
-
-
-Authors:
---------
- Arvin Schnell
- Klaus Kaempf
- Mathias Kettner
- Stefan Hundhammer
- Stanislav Visnovsky
-
%prep
-%setup -n yast2-core-2.18.13
+%setup -n yast2-core-2.18.14
%build
+export SUSE_ASNEEDED=0
%{prefix}/bin/y2tool y2autoconf
%{prefix}/bin/y2tool y2automake
autoreconf --force --install
++++++ yast2-core-2.18.13.tar.bz2 -> yast2-core-2.18.14.tar.bz2 ++++++
++++ 2412 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-core-2.18.13/agent-system/src/SystemAgent.cc new/yast2-core-2.18.14/agent-system/src/SystemAgent.cc
--- old/yast2-core-2.18.13/agent-system/src/SystemAgent.cc 2009-04-10 09:50:28.000000000 +0200
+++ new/yast2-core-2.18.14/agent-system/src/SystemAgent.cc 2009-06-18 10:24:56.000000000 +0200
@@ -7,7 +7,7 @@
* Michal Svec
* Petr Blahos
*
- * $Id: SystemAgent.cc 54455 2009-01-07 16:34:16Z aschnell $
+ * $Id: SystemAgent.cc 57633 2009-06-18 08:24:56Z mvidner $
*/
#include "config.h"
@@ -63,7 +63,7 @@
* @param path path to remove
* @param depth max. depth
*/
-static const void
+static void
remove_directory (const string& path, int depth)
{
struct stat buf;
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-core-2.18.13/configure.in new/yast2-core-2.18.14/configure.in
--- old/yast2-core-2.18.13/configure.in 2009-06-15 18:10:10.000000000 +0200
+++ new/yast2-core-2.18.14/configure.in 2009-06-22 08:02:47.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.18.5 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-core, 2.18.13, http://bugs.opensuse.org/, yast2-core)
+AC_INIT(yast2-core, 2.18.14, http://bugs.opensuse.org/, yast2-core)
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.18.13"
+VERSION="2.18.14"
RPMNAME="yast2-core"
MAINTAINER="Martin Vidner "
@@ -477,6 +477,8 @@
dbus/SCR_service/Makefile
dbus/namespace_service/src/Makefile
dbus/namespace_service/doc/Makefile
+dbus/namespace_service/testsuite/modules/Makefile
+dbus/namespace_service/testsuite/Makefile
dbus/namespace_service/Makefile
dbus/Makefile)
AC_OUTPUT
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-core-2.18.13/dbus/namespace_service/Makefile.am new/yast2-core-2.18.14/dbus/namespace_service/Makefile.am
--- old/yast2-core-2.18.13/dbus/namespace_service/Makefile.am 2009-04-10 09:50:43.000000000 +0200
+++ new/yast2-core-2.18.14/dbus/namespace_service/Makefile.am 2009-06-17 11:10:45.000000000 +0200
@@ -2,4 +2,4 @@
# Makefile.am for core/dbus/namespace_service
#
-SUBDIRS=src doc
+SUBDIRS=src doc testsuite
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-core-2.18.13/dbus/namespace_service/src/DBusModulesServer.cc new/yast2-core-2.18.14/dbus/namespace_service/src/DBusModulesServer.cc
--- old/yast2-core-2.18.13/dbus/namespace_service/src/DBusModulesServer.cc 2009-05-14 15:06:13.000000000 +0200
+++ new/yast2-core-2.18.14/dbus/namespace_service/src/DBusModulesServer.cc 2009-06-19 14:50:43.000000000 +0200
@@ -1,4 +1,3 @@
-
/*
DBus server
@@ -23,6 +22,7 @@
#include "yast_dbus_names.h"
+
void DBusModulesServer::init_wfm()
{
if (Y2WFMComponent::instance() == NULL)
@@ -114,17 +114,31 @@
DBusSignature sig_marshalled;
DBusSignature sig_raw;
+ bool params_ok_raw = true;
- // add return type
- std::string rett(Y2Dtype(rettype));
+ std::string rett;
- if (!rett.empty())
+ try
+ {
+ // add return type
+ rett = DBusMsg::YCPTypeSignature(rettype);
+ }
+ catch (const SignatureException &excpt)
{
- sig_raw.retval = DBusArgument("ret", rett);
+ y2error("Ignoring function %s::%s in raw interface, unsupported return type: %s", nspace.c_str(), fname, rettype->toString().c_str());
+ params_ok_raw = false;
}
- // TODO FIXME void() ?
- sig_marshalled.retval = DBusArgument("ret", "(bsv)");
+ // check void()
+ if (!rettype->isVoid() && !rettype->isNil())
+ {
+ if (params_ok_raw)
+ {
+ sig_raw.retval = DBusArgument("ret", rett);
+ }
+
+ sig_marshalled.retval = DBusArgument("ret", "(bsv)");
+ }
// add parameter types
int params = fptr->parameterCount();
@@ -132,20 +146,20 @@
DBusSignature::Params p_marshalled;
DBusSignature::Params p_raw;
- bool params_ok_raw = true;
while(parindex < params)
{
- std::string partype_raw(Y2Dtype(fptr->parameterType(parindex)));
-
- if (!partype_raw.empty())
+ try
{
+ std::string partype_raw(DBusMsg::YCPTypeSignature(fptr->parameterType(parindex)));
+
DBusArgument param("param", partype_raw);
p_raw.push_back(param);
}
- else
+ catch (const SignatureException &excpt)
{
- y2warning("Function %s is not exported due to an unsupported parameter type", fname);
+ y2warning("Function %s::%s is not exported due to an unsupported type of parameter number %d",
+ nspace.c_str(), fname, parindex);
params_ok_raw = false;
}
@@ -215,7 +229,12 @@
}
-DBusModulesServer::DBusModulesServer(const NameSpaceList &name_spaces) : e(this), manager_callback(this), wfm(NULL)
+DBusModulesServer::DBusModulesServer(const NameSpaceList &name_spaces, bool test_mode)
+ : DBusServerBase(test_mode)
+ , e(this)
+ , manager_callback(this)
+ , wfm(NULL)
+ , m_test_mode(test_mode)
{
init_wfm();
@@ -256,33 +275,6 @@
register_method(YAST_DBUS_OBJ_PREFIX, YAST_DBUS_MGR_INTERFACE, YAST_DBUS_MANAGER_LOCK_METHOD, void_sig, manager_callback);
}
-std::string DBusModulesServer::Y2Dtype(constTypePtr type) const
-{
- YCPValueType vt = type->valueType();
- std::string ret;
-
- switch (vt)
- {
- case(YT_VOID) : ret = ""; break;
- case(YT_BOOLEAN) : ret = DBUS_TYPE_BOOLEAN_AS_STRING; break;
- case(YT_INTEGER) : ret = DBUS_TYPE_INT64_AS_STRING; break;
- case(YT_FLOAT) : ret = DBUS_TYPE_DOUBLE_AS_STRING; break;
- case(YT_STRING) : ret = DBUS_TYPE_STRING_AS_STRING; break;
- case(YT_PATH) : ret = DBUS_TYPE_STRING_AS_STRING; break;
- case(YT_SYMBOL) : ret = DBUS_TYPE_STRING_AS_STRING; break;
- case(YT_LIST) : ret = DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_VARIANT_AS_STRING; break; /* av */
- case(YT_MAP) : ret = DBUS_TYPE_ARRAY_AS_STRING
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING; break; /* a{sv} */
- case(YT_TERM) : ret = DBUS_TYPE_STRING_AS_STRING; break;
-// case(YT_CODE) : ret = DBUS_TYPE_STRING_AS_STRING; break;
-
- default : y2warning("Value type %d is not supported", vt); break;
- }
-
- return ret;
-}
-
constTypePtr DBusModulesServer::searchFuncType(const std::string &objname, const std::string &fname) const
{
if (nsmap.find(objname) == nsmap.end())
@@ -326,7 +318,8 @@
bool DBusModulesServer::connect()
{
registerManager();
- return DBusServerBase::connect(SYSTEM, YAST_DBUS_SERVICE_NAME);
+ return DBusServerBase::connect(m_test_mode ? SESSION : SYSTEM,
+ YAST_DBUS_SERVICE_NAME);
}
/*
@@ -409,6 +402,7 @@
y2debug("Requested object: %s, interface: %s, method: %s", object.c_str(), interface.c_str(), method.c_str());
constTypePtr t = searchFuncType(object, method);
+ constTypePtr rettype = NULL;
if (t)
{
@@ -416,6 +410,8 @@
if (fptr)
{
+ rettype = fptr->returnType();
+
int reqarg = fptr->parameterCount();
if (request.arguments() == reqarg)
@@ -524,7 +520,7 @@
if (interface == YAST_DBUS_RAW_INTERFACE)
{
y2debug("Returning direct DBus value");
- reply.addValue(ret);
+ reply.addValueAs(ret, rettype);
}
else
{
@@ -552,7 +548,7 @@
y2milestone("ModuleManager request: object: %s, method: %s, interface: %s",
object.c_str(), method.c_str(), interface.c_str());
- YCPValue ret;
+ reply.createReply(request);
if (object == YAST_DBUS_OBJ_PREFIX)
{
@@ -573,18 +569,20 @@
if (arg->isString())
{
std::string required_namespace(arg->asString()->value());
+ bool ret;
NameSpaceMap::const_iterator nsiter = nsmap.find(required_namespace);
if (nsiter != nsmap.end())
{
- ret = YCPBoolean(true);
+ ret = true;
}
else
{
- bool retval = importNamespace(arg->asString()->value());
-
- ret = YCPBoolean(retval);
+ ret = importNamespace(arg->asString()->value());
}
+
+ y2milestone("Result: %s", ret ? "true" : "false");
+ reply.addBoolean(ret);
}
else
{
@@ -609,14 +607,6 @@
}
}
- reply.createReply(request);
-
- if (!ret.isNull())
- {
- y2milestone("Result: %s", ret->toString().c_str());
- reply.addValue(ret);
- }
-
return reply;
}
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-core-2.18.13/dbus/namespace_service/src/DBusModulesServer.h new/yast2-core-2.18.14/dbus/namespace_service/src/DBusModulesServer.h
--- old/yast2-core-2.18.13/dbus/namespace_service/src/DBusModulesServer.h 2009-04-10 09:50:43.000000000 +0200
+++ new/yast2-core-2.18.14/dbus/namespace_service/src/DBusModulesServer.h 2009-06-18 16:44:22.000000000 +0200
@@ -1,4 +1,3 @@
-
/*
DBusModulesServer.h
*/
@@ -25,7 +24,7 @@
typedef std::liststd::string NameSpaceList;
- DBusModulesServer(const NameSpaceList &name_spaces);
+ DBusModulesServer(const NameSpaceList &name_spaces, bool test_mode);
virtual ~DBusModulesServer();
virtual bool connect();
@@ -95,8 +94,9 @@
Y2Component *wfm;
void init_wfm();
+
+ bool m_test_mode;
};
#endif
-
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-core-2.18.13/dbus/namespace_service/src/yast_modules_dbus_server.cc new/yast2-core-2.18.14/dbus/namespace_service/src/yast_modules_dbus_server.cc
--- old/yast2-core-2.18.13/dbus/namespace_service/src/yast_modules_dbus_server.cc 2009-04-10 09:50:43.000000000 +0200
+++ new/yast2-core-2.18.14/dbus/namespace_service/src/yast_modules_dbus_server.cc 2009-06-18 16:44:22.000000000 +0200
@@ -1,4 +1,3 @@
-
/*
*/
@@ -12,6 +11,7 @@
bool forever = false;
bool badopts = false;
+ bool test_mode = false;
DBusModulesServer::NameSpaceList modules;
@@ -29,6 +29,10 @@
{
forever = true;
}
+ else if (!strcmp(argv[index], "--test"))
+ {
+ test_mode = true;
+ }
else
{
modules.push_back(argv[index]);
@@ -40,14 +44,16 @@
if (badopts)
{
- std::cerr << "Usage: " << argv[0] << " [--help] [--disable-timer] <namespace> <namespace>..." << std::endl;
+ std::cerr << "Usage: " << argv[0] << " [--help] [--disable-timer] [--session] <namespace> <namespace>..." << std::endl;
std::cerr << " --help Print this text\n";
std::cerr << " --disable-timer Disable automatic shutdown of the service, useful for debugging\n";
+ std::cerr << " --test Set the test mode - Connect to the session bus (system is the default),\n";
+ std::cerr << " disable PolicyKit checks. Useful for testing or debugging.\n";
std::cerr << " <namespace> Preload an yast namespace and export it on DBus\n";
return 1;
}
- DBusModulesServer server(modules);
+ DBusModulesServer server(modules, test_mode);
bool connected = server.connect();
if (connected)
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-core-2.18.13/dbus/namespace_service/testsuite/Makefile.am new/yast2-core-2.18.14/dbus/namespace_service/testsuite/Makefile.am
--- old/yast2-core-2.18.13/dbus/namespace_service/testsuite/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-core-2.18.14/dbus/namespace_service/testsuite/Makefile.am 2009-06-18 19:24:31.000000000 +0200
@@ -0,0 +1,8 @@
+# adhoc testing, TODO use a decent framework (dejagnu does not qualify)
+TESTS = t1
+
+SUBDIRS = modules
+
+EXTRA_DIST = $(wildcard *.test) t1
+
+CLEANFILES = $(wildcard *.test.reply)
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-core-2.18.13/dbus/namespace_service/testsuite/modules/Makefile.am new/yast2-core-2.18.14/dbus/namespace_service/testsuite/modules/Makefile.am
--- old/yast2-core-2.18.13/dbus/namespace_service/testsuite/modules/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-core-2.18.14/dbus/namespace_service/testsuite/modules/Makefile.am 2009-06-18 19:24:31.000000000 +0200
@@ -0,0 +1,13 @@
+
+yast_modules = TEST.ycp
+
+EXTRA_DIST = $(yast_modules)
+
+yast_modules_ybc = $(yast_modules:.ycp=.ybc)
+
+$(yast_modules_ybc): $(yast_modules)
+ ../../../../base/tools/ycpc/ycpc -c $<
+
+all: $(yast_modules_ybc)
+
+CLEANFILES = $(wildcard *.ybc)
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-core-2.18.13/dbus/namespace_service/testsuite/modules/TEST.ycp new/yast2-core-2.18.14/dbus/namespace_service/testsuite/modules/TEST.ycp
--- old/yast2-core-2.18.13/dbus/namespace_service/testsuite/modules/TEST.ycp 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-core-2.18.14/dbus/namespace_service/testsuite/modules/TEST.ycp 2009-06-18 16:44:22.000000000 +0200
@@ -0,0 +1,81 @@
+
+// This is a testing module for the YaST DBuse service
+// Some methods are not called during tests, but the correct signature is checked in the introspection test
+
+{
+
+module "TEST";
+
+global define list List()
+{return [];}
+
+global define list<any> ListAny()
+{return [];}
+
+global define list ListAny1()
+{return [1, "string"];}
+
+global define list ListAny2()
+{return [["dssd", 123], ["zxcxczzx", 456]];}
+
+global define list<string> ListString()
+{return ["dssd", "sdfdfs"];}
+
+global define list ListListString()
+{return [["dssd", "sdfdfs"], ["zxcxczzx"]];}
+
+global define list<map> ListMap()
+{return [];}
+
+global define list