[yast-commit] r58836 - in /branches/SuSE-Code-11-SP1-Branch/core: ./ agent-dbus/ dbus/ libscr/src/ libscr/src/include/scr/ libscr/testsuite/ liby2dbus/ package/ scr/src/
Author: lslezak Date: Wed Sep 30 14:25:49 2009 New Revision: 58836 URL: http://svn.opensuse.org/viewcvs/yast?rev=58836&view=rev Log: - the DBus code has been moved to separate packages (yast2-dbus-client and yast2-dbus-server) (bnc#431208) - 2.17.31 Removed: branches/SuSE-Code-11-SP1-Branch/core/agent-dbus/ branches/SuSE-Code-11-SP1-Branch/core/dbus/ branches/SuSE-Code-11-SP1-Branch/core/liby2dbus/ Modified: branches/SuSE-Code-11-SP1-Branch/core/ (props changed) branches/SuSE-Code-11-SP1-Branch/core/SUBDIRS branches/SuSE-Code-11-SP1-Branch/core/VERSION branches/SuSE-Code-11-SP1-Branch/core/configure.in.in branches/SuSE-Code-11-SP1-Branch/core/libscr/src/Makefile.am branches/SuSE-Code-11-SP1-Branch/core/libscr/src/SCR.cc branches/SuSE-Code-11-SP1-Branch/core/libscr/src/include/scr/SCR.h branches/SuSE-Code-11-SP1-Branch/core/libscr/testsuite/Makefile.am branches/SuSE-Code-11-SP1-Branch/core/package/yast2-core.changes branches/SuSE-Code-11-SP1-Branch/core/scr/src/Makefile.am branches/SuSE-Code-11-SP1-Branch/core/yast2-core.spec.in Modified: branches/SuSE-Code-11-SP1-Branch/core/SUBDIRS URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/SUBDIRS?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/SUBDIRS (original) +++ branches/SuSE-Code-11-SP1-Branch/core/SUBDIRS Wed Sep 30 14:25:49 2009 @@ -1 +1 @@ -liby2util-r liby2 libycp liby2dbus libscr agent-dummy scr agent-system agent-dbus agent-any agent-ini agent-modules agent-resolver agents-non-y2 agents-perl wfm agent-process base autodocs dbus +liby2util-r liby2 libycp libscr agent-dummy scr agent-system agent-any agent-ini agent-modules agent-resolver agents-non-y2 agents-perl wfm agent-process base autodocs Modified: branches/SuSE-Code-11-SP1-Branch/core/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/VERSION?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/core/VERSION Wed Sep 30 14:25:49 2009 @@ -1 +1 @@ -2.17.30 +2.17.31 Modified: branches/SuSE-Code-11-SP1-Branch/core/configure.in.in URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/configure.in.in?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/configure.in.in (original) +++ branches/SuSE-Code-11-SP1-Branch/core/configure.in.in Wed Sep 30 14:25:49 2009 @@ -94,40 +94,6 @@ AC_MSG_ERROR(Headers for blocxx are missing. Please install the package blocxx-devel.) fi -PKG_CHECK_MODULES(DBUS, dbus-1) - -## check for PolicyKit -AC_ARG_ENABLE([policykit], - AS_HELP_STRING([--enable-policykit], [Enable experimental PolicyKit support]), - [ - case "${enableval}" in - yes) policykit=yes ;; - no) policykit=no ;; - *) AC_MSG_ERROR(--enable-policykit: Unknwon value ${enableval}) ;; - esac - ], - [policykit=yes]) - -if test "x${policykit}" == xyes ; then - PKG_CHECK_MODULES(POLKIT, [ polkit-dbus >= 0.7 ], - [ - HAVE_POLKIT=1 - AC_DEFINE([HAVE_POLKIT], 1, [Have PolicyKit]) - policydir=`pkg-config polkit-dbus --variable prefix`/share/PolicyKit/policy/ - AC_SUBST(policydir) - ], - [ - HAVE_POLKIT=0 - AC_MSG_ERROR([*** PolicyKit support not found, install PolicyKit-devel: 'zypper in PolicyKit-devel' or libpolkit-dbus-dev.deb]) - ]) -else - HAVE_POLKIT=0 -fi - -AC_SUBST(POLKIT_CFLAGS) -AC_SUBST(POLKIT_LIBS) -AC_SUBST(HAVE_POLKIT) -AM_CONDITIONAL([HAVE_POLKIT], [test "x$HAVE_POLKIT" = x1]) ## and generate the output AC_CONFIG_FILES([ Modified: branches/SuSE-Code-11-SP1-Branch/core/libscr/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/libscr/src/Makefile.am?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/libscr/src/Makefile.am (original) +++ branches/SuSE-Code-11-SP1-Branch/core/libscr/src/Makefile.am Wed Sep 30 14:25:49 2009 @@ -11,15 +11,9 @@ libscr_la_SOURCES = \ SCRAgent.cc SCR.cc -libscr_la_CPPFLAGS = $(DBUS_CFLAGS) - -libscr_la_LIBADD = $(srcdir)/../../liby2dbus/src/liby2dbus.la - INCLUDES = \ -I$(srcdir)/../../libycp/src/include \ -I$(srcdir)/../../liby2/src/include \ - -I$(srcdir)/../../liby2dbus/src \ - -I$(srcdir)/../../scr/src \ -I$(srcdir)/include \ ${Y2UTIL_CFLAGS} Modified: branches/SuSE-Code-11-SP1-Branch/core/libscr/src/SCR.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/libscr/src/SCR.cc?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/libscr/src/SCR.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/core/libscr/src/SCR.cc Wed Sep 30 14:25:49 2009 @@ -29,96 +29,12 @@ #include "ycp/y2log.h" #include "scr/SCRAgent.h" -#include "DBusConn.h" -#include "DBusMsg.h" - extern StaticDeclaration static_declarations; bool SCR::registered = false; -// DBus related variables -DBusConn *connection; - -bool check_dbus_env() -{ - const char* y2dbus = ::getenv("Y2DBUS"); - - if (y2dbus != NULL) - { - if (::strcmp(y2dbus, "1") == 0) - return true; - } - - return false; -} - -static YCPValue CallDBus(const char *method, const YCPPath &path = YCPNull(), const YCPValue &args = YCPNull (), - const YCPValue &opt = YCPNull ()) -{ - - y2milestone("Calling DBus method %s: path: %s, args: %s, opt: %s", method, path.isNull() ? "NULL" : path->toString().c_str(), args.isNull() ? "NULL" : args->toString().c_str(), opt.isNull() ? "NULL" : opt->toString().c_str()); - - DBusMsg msg; - // TODO create constants for these strings - msg.createCall("org.opensuse.yast.SCR", "/SCR", "org.opensuse.yast.SCR.Methods", method); - - if (!path.isNull()) - { - msg.addYCPValue(path); - } - - if (!args.isNull()) - { - msg.addYCPValue(args); - } - - if (!opt.isNull()) - { - msg.addYCPValue(opt); - } - - // send the message and get the response - DBusMsg reply(connection->call(msg)); - - y2debug("Received reply type: %d", reply.type()); - - // return the first argument from the reply - YCPValue ret = reply.getYCPValue(0); - - // validate the reply (check for exceptions) - if (reply.type() != DBUS_MESSAGE_TYPE_METHOD_RETURN) - { - if (reply.type() == DBUS_MESSAGE_TYPE_ERROR) - { - if (!ret.isNull()) - { - y2error("Received Error reply: %s", ret->toString().c_str()); - } - } - - return YCPVoid(); - } - - if (!ret.isNull()) - { - y2milestone("Received reply: %s", ret->toString().c_str()); - } - else - { - y2error("Received YCPNull or the value is missing"); - } - - return ret; -} - static YCPValue SCRRead3 (const YCPPath &path, const YCPValue &args = YCPNull (), const YCPValue &opt = YCPNull ()) { - - if (connection != NULL) - { - return CallDBus("Read", path, args, opt); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -143,11 +59,6 @@ SCRWrite2 (const YCPPath &path, const YCPValue& value_n) { YCPValue value = value_n.isNull()? YCPVoid(): value_n; // bnc#406138 - if (connection != NULL) - { - return CallDBus("Write", path, value); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -162,11 +73,6 @@ YCPValue value = value_n.isNull()? YCPVoid(): value_n; // bnc#406138 YCPValue arg = arg_n.isNull()? YCPVoid(): arg_n; // bnc#406138 - if (connection != NULL) - { - return CallDBus("Write", path, value, arg); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -178,11 +84,6 @@ static YCPValue SCRDir (const YCPPath& path) { - if (connection != NULL) - { - return CallDBus("Dir", path); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -194,11 +95,6 @@ static YCPValue SCRExecute (const YCPPath &path) { - if (connection != NULL) - { - return CallDBus("Execute", path); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -210,11 +106,6 @@ static YCPValue SCRError (const YCPPath &path) { - if (connection != NULL) - { - return CallDBus("Error", path); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -230,11 +121,6 @@ SCRExecute2 (const YCPPath &path, const YCPValue &arg_n) { YCPValue arg = arg_n.isNull()? YCPVoid(): arg_n; // bnc#406138 - if (connection != NULL) - { - return CallDBus("Execute", path, arg); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -252,11 +138,6 @@ YCPValue arg = arg_n.isNull()? YCPVoid(): arg_n; // bnc#406138 YCPValue opt = opt_n.isNull()? YCPVoid(): opt_n; // bnc#406138 - if (connection != NULL) - { - return CallDBus("Execute", path, arg, opt); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -271,11 +152,6 @@ static YCPValue SCRRegisterAgentS (const YCPPath &path, const YCPString &arg) { - if (connection != NULL) - { - return CallDBus("RegisterAgent", path, arg); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -289,11 +165,6 @@ static YCPValue SCRRegisterAgentT (const YCPPath &path, const YCPTerm &arg) { - if (connection != NULL) - { - return CallDBus("RegisterAgent", path, arg); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -307,11 +178,6 @@ static YCPValue SCRUnregisterAgent (const YCPPath &path) { - if (connection != NULL) - { - return CallDBus("UnregisterAgent", path); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -324,11 +190,6 @@ static YCPValue SCRUnregisterAllAgents () { - if (connection != NULL) - { - return CallDBus("UnregisterAllAgents"); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -340,11 +201,6 @@ static YCPValue SCRUnmountAgent (const YCPPath &path) { - if (connection != NULL) - { - return CallDBus("UnmountAgent", path); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -357,11 +213,6 @@ static YCPValue SCRRegisterNewAgents () { - if (connection != NULL) - { - return CallDBus("RegisterNewAgents"); - } - if (! SCRAgent::instance()) { ycperror ( "No SCR instance found" ); @@ -403,33 +254,5 @@ static_declarations.registerDeclarations ("SCR", declarations); registered = true; - - bool y2dbus = check_dbus_env(); - - // use std SCR or DBUS SCR? - if (y2dbus) - { - y2debug("Y2DBUS is set, using DBUS for SCR access"); - connection = new DBusConn; - - // connect to the system bus - if (!connection->connect(DBUS_BUS_SYSTEM)) - { - y2error("Cannot connect to DBus, exiting..."); - exit(1); - } - } - else - { - y2debug("Y2DBUS is not set, using embedded SCR"); - } } -SCR::~SCR() -{ - if (connection != NULL) - { - delete connection; - connection = NULL; - } -} Modified: branches/SuSE-Code-11-SP1-Branch/core/libscr/src/include/scr/SCR.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/libscr/src/include/scr/SCR.h?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/libscr/src/include/scr/SCR.h (original) +++ branches/SuSE-Code-11-SP1-Branch/core/libscr/src/include/scr/SCR.h Wed Sep 30 14:25:49 2009 @@ -25,7 +25,6 @@ public: SCR (); - ~SCR(); static bool registered; }; Modified: branches/SuSE-Code-11-SP1-Branch/core/libscr/testsuite/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/libscr/testsuite/Makefile.am?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/libscr/testsuite/Makefile.am (original) +++ branches/SuSE-Code-11-SP1-Branch/core/libscr/testsuite/Makefile.am Wed Sep 30 14:25:49 2009 @@ -12,7 +12,7 @@ noinst_PROGRAMS = runscr runscr_SOURCES = runscr.cc -runscr_LDADD = ${AGENT_LIBADD} ../../liby2dbus/src/liby2dbus.la +runscr_LDADD = ${AGENT_LIBADD} PACKAGE = libscr AUTOMAKE_OPTIONS = dejagnu Modified: branches/SuSE-Code-11-SP1-Branch/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/package/yast2-core.changes?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/package/yast2-core.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/core/package/yast2-core.changes Wed Sep 30 14:25:49 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Sep 30 14:08:15 CEST 2009 - lslezak@suse.cz + +- the DBus code has been moved to separate packages + (yast2-dbus-client and yast2-dbus-server) (bnc#431208) +- 2.17.31 + +------------------------------------------------------------------- Fri Apr 17 13:45:47 CEST 2009 - juhliarik@suse.cz - added fix for problem with adding nil to list (bnc#216177) Modified: branches/SuSE-Code-11-SP1-Branch/core/scr/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/scr/src/Makefile.am?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/scr/src/Makefile.am (original) +++ branches/SuSE-Code-11-SP1-Branch/core/scr/src/Makefile.am Wed Sep 30 14:25:49 2009 @@ -30,6 +30,13 @@ libpy2scr_la_LDFLAGS = -version-info 2:0 +libpy2scr_la_LIBADD = $(top_builddir)/libscr/src/libscr.la + INCLUDES = ${AGENT_INCLUDES} +pkgincludedir = $(includedir)/scr +# these go to $(pkgincludedir) +pkginclude_HEADERS = \ + ScriptingAgent.h \ + SCRSubAgent.h Modified: branches/SuSE-Code-11-SP1-Branch/core/yast2-core.spec.in URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/core/yast2-core.spec.in?rev=58836&r1=58835&r2=58836&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/core/yast2-core.spec.in (original) +++ branches/SuSE-Code-11-SP1-Branch/core/yast2-core.spec.in Wed Sep 30 14:25:49 2009 @@ -22,9 +22,6 @@ # libycp includes crypto built-ins BuildRequires: libxcrypt-devel -# for SCR DBus service -BuildRequires: dbus-1-devel PolicyKit-devel - Summary: - Requires: perl = %{perl_version} Provides: liby2util = 2.16.1 @@ -40,7 +37,6 @@ Requires: libxcrypt-devel hwinfo-devel Requires: glibc-devel libstdc++-devel pcre-devel libblocxx-devel sysfsutils # required for libscr -Requires: PolicyKit-devel dbus-1-devel # for FlexLexer.h; I think that this dependency could be made # private but it seems not worth the effort Requires: flex @@ -101,13 +97,6 @@ # .packlist %{perl_vendorarch}/auto/ycp /var/adm/perl-modules/%name -# DBus service -@ybindir@/SCR_dbus_server -# DBus service config -/usr/share/dbus-1/system-services/org.opensuse.yast.SCR.service -/etc/dbus-1/system.d/org.opensuse.yast.SCR.conf -# PolicyKit default policies -/usr/share/PolicyKit/policy/org.opensuse.yast.scr.policy %files devel %defattr(-,root,root) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org