Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-dbus for openSUSE:Factory 
checked in at 2023-04-07 18:16:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-dbus (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-dbus.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-dbus"

Fri Apr  7 18:16:41 2023 rev:25 rq:1077765 version:1.2.28

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-dbus/ghc-dbus.changes        2023-04-04 
21:19:48.436955857 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-dbus.new.19717/ghc-dbus.changes     
2023-04-07 18:16:43.844685209 +0200
@@ -1,0 +2,6 @@
+Mon Apr  3 19:01:23 UTC 2023 - Peter Simons <psim...@suse.com>
+
+- Update dbus to version 1.2.28.
+  Upstream does not provide a change log file.
+
+-------------------------------------------------------------------

Old:
----
  dbus-1.2.27.tar.gz

New:
----
  dbus-1.2.28.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-dbus.spec ++++++
--- /var/tmp/diff_new_pack.qzLttr/_old  2023-04-07 18:16:44.348688113 +0200
+++ /var/tmp/diff_new_pack.qzLttr/_new  2023-04-07 18:16:44.352688135 +0200
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.2.27
+Version:        1.2.28
 Release:        0
 Summary:        A client library for the D-Bus IPC system
 License:        Apache-2.0

++++++ dbus-1.2.27.tar.gz -> dbus-1.2.28.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dbus-1.2.27/dbus.cabal new/dbus-1.2.28/dbus.cabal
--- old/dbus-1.2.27/dbus.cabal  2022-10-24 18:39:30.000000000 +0200
+++ new/dbus-1.2.28/dbus.cabal  2023-04-03 20:38:02.000000000 +0200
@@ -1,5 +1,5 @@
 name: dbus
-version: 1.2.27
+version: 1.2.28
 license: Apache-2.0
 license-file: license.txt
 author: John Millikin <j...@john-millikin.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dbus-1.2.27/lib/DBus/Client.hs 
new/dbus-1.2.28/lib/DBus/Client.hs
--- old/dbus-1.2.27/lib/DBus/Client.hs  2022-07-12 16:32:15.000000000 +0200
+++ new/dbus-1.2.28/lib/DBus/Client.hs  2023-04-03 20:37:52.000000000 +0200
@@ -156,6 +156,7 @@
     , clientThreadRunner
     , defaultClientOptions
     , connectWith
+    , connectWithName
 
     , dbusName
     , dbusPath
@@ -427,6 +428,36 @@
 -- Throws a 'ClientError' on failure.
 connectWith :: TransportOpen t => ClientOptions t -> Address -> IO Client
 connectWith opts addr = do
+    client <- connectWith' opts addr
+
+    callNoReply client (methodCall dbusPath dbusInterface "Hello")
+        { methodCallDestination = Just dbusName
+        }
+
+    return client
+
+-- | Connect to the bus at the specified address, with the given connection
+-- options, and return the unique client bus name. Most users should use
+-- 'connect' or 'connectWith' instead.
+--
+-- Throws a 'ClientError' on failure.
+connectWithName :: TransportOpen t => ClientOptions t -> Address -> IO 
(Client, BusName)
+connectWithName opts addr = do
+    client <- connectWith' opts addr
+
+    reply <- call_ client (methodCall dbusPath dbusInterface "Hello")
+        { methodCallDestination = Just dbusName
+        }
+    
+    case methodReturnBody reply of
+      [name] | Just nameStr <- fromVariant name -> do
+        busName <- parseBusName nameStr
+        return (client, busName)
+      _ ->
+        throwIO (clientError "connectWithName: Hello response did not contain 
client name.")
+
+connectWith' :: TransportOpen t => ClientOptions t -> Address -> IO Client
+connectWith' opts addr = do
     sock <- DBus.Socket.openWith (clientSocketOptions opts) addr
 
     pendingCalls <- newIORef M.empty
@@ -450,10 +481,6 @@
             }
     putMVar clientMVar client
 
-    callNoReply client (methodCall dbusPath dbusInterface "Hello")
-        { methodCallDestination = Just dbusName
-        }
-
     return client
 
 makeErrorReply :: ErrorName -> Reply
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dbus-1.2.27/tests/DBusTests/Client.hs 
new/dbus-1.2.28/tests/DBusTests/Client.hs
--- old/dbus-1.2.27/tests/DBusTests/Client.hs   2022-07-12 16:32:15.000000000 
+0200
+++ new/dbus-1.2.28/tests/DBusTests/Client.hs   2023-04-03 20:37:52.000000000 
+0200
@@ -69,6 +69,22 @@
     client <- readMVar clientVar
     DBus.Client.disconnect client
 
+test_ConnectWithName :: TestTree
+test_ConnectWithName = testCase "connectWithName" $ do
+    (addr, sockVar) <- startDummyBus
+    clientVar <- forkVar (DBus.Client.connectWithName 
DBus.Client.defaultClientOptions addr)
+
+    sock <- readMVar sockVar
+    receivedHello <- DBus.Socket.receive sock
+    let (ReceivedMethodCall helloSerial _) = receivedHello
+
+    let helloReturn = (methodReturn helloSerial) { methodReturnBody = 
[toVariant ":1.123"] }
+    DBus.Socket.send sock helloReturn (\_ -> return ())
+
+    (client, clientName) <- readMVar clientVar
+    assertEqual "client name not as expected" (busName_ ":1.123") clientName
+    DBus.Client.disconnect client
+
 suite_Connect :: TestTree
 suite_Connect = testGroup "connect"
     [ test_ConnectSystem
@@ -77,6 +93,7 @@
     , test_ConnectSession_NoAddress
     , test_ConnectStarter
     , test_ConnectStarter_NoAddress
+    , test_ConnectWithName
     ]
 
 test_ConnectSystem :: TestTree

Reply via email to