Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package hawk-apiserver for openSUSE:Factory 
checked in at 2025-02-27 14:51:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hawk-apiserver (Old)
 and      /work/SRC/openSUSE:Factory/.hawk-apiserver.new.25152 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hawk-apiserver"

Thu Feb 27 14:51:22 2025 rev:4 rq:1248981 version:0.0.4+git.1740652077.f970d6a

Changes:
--------
--- /work/SRC/openSUSE:Factory/hawk-apiserver/hawk-apiserver.changes    
2025-02-26 17:15:32.887740071 +0100
+++ /work/SRC/openSUSE:Factory/.hawk-apiserver.new.25152/hawk-apiserver.changes 
2025-02-27 14:54:32.285499835 +0100
@@ -1,0 +2,5 @@
+Thu Feb 27 12:42:47 UTC 2025 - Aleksei Burlakov <aburla...@suse.com>
+
+- Dev: use the newest go-pacemaker and updated ToString (bsc#1237259)
+
+-------------------------------------------------------------------

Old:
----
  hawk-apiserver-0.0.4+git.1740070313.ca7ee57.tar.gz

New:
----
  hawk-apiserver-0.0.4+git.1740652077.f970d6a.tar.gz

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

Other differences:
------------------
++++++ hawk-apiserver.spec ++++++
--- /var/tmp/diff_new_pack.5FMRu9/_old  2025-02-27 14:54:32.861523870 +0100
+++ /var/tmp/diff_new_pack.5FMRu9/_new  2025-02-27 14:54:32.865524037 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           hawk-apiserver
-Version:        0.0.4+git.1740070313.ca7ee57
+Version:        0.0.4+git.1740652077.f970d6a
 Release:        0
 Summary:        Web server and API provider for Hawk
 License:        GPL-3.0-or-later

++++++ hawk-apiserver-0.0.4+git.1740070313.ca7ee57.tar.gz -> 
hawk-apiserver-0.0.4+git.1740652077.f970d6a.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hawk-apiserver-0.0.4+git.1740070313.ca7ee57/cib/asynccib.go 
new/hawk-apiserver-0.0.4+git.1740652077.f970d6a/cib/asynccib.go
--- old/hawk-apiserver-0.0.4+git.1740070313.ca7ee57/cib/asynccib.go     
2025-02-20 17:51:53.000000000 +0100
+++ new/hawk-apiserver-0.0.4+git.1740652077.f970d6a/cib/asynccib.go     
2025-02-27 11:27:57.000000000 +0100
@@ -3,7 +3,6 @@
 import (
        "fmt"
        "os"
-       "os/exec"
        "sync"
        "time"
 
@@ -128,23 +127,11 @@
 }
 
 func (acib *AsyncCib) notifyNewCib(cibxml *pacemaker.CibDocument) {
-       /* The pacemaker-3.0.0 drops the support of xml general purpose 
routines.
-        * There is no more dump_xml_unformatted to convert  xmlNode -> char*
-        * And we don't want to reinvent it. Let's just call the 'cibadmin -Q'
-        * and get it as the text.
-        */
-       cmd := exec.Command("/usr/sbin/cibadmin", "-Q") // Invalid command for 
testing
-       text, err := cmd.CombinedOutput()
-
-       if err != nil {
-               msg := fmt.Sprintf("Failed to connect execute cibadmin: %v", 
err)
-               log.Warnf(msg)
-       }
-
+       text := cibxml.ToString()
        version := cibxml.Version()
        log.Infof("[CIB]: %v", version)
        acib.lock.Lock()
-       acib.xmldoc = string(text)
+       acib.xmldoc = text
        acib.version = version
        acib.lock.Unlock()
        // Notify anyone waiting
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hawk-apiserver-0.0.4+git.1740070313.ca7ee57/go.mod 
new/hawk-apiserver-0.0.4+git.1740652077.f970d6a/go.mod
--- old/hawk-apiserver-0.0.4+git.1740070313.ca7ee57/go.mod      2025-02-20 
17:51:53.000000000 +0100
+++ new/hawk-apiserver-0.0.4+git.1740652077.f970d6a/go.mod      2025-02-27 
11:27:57.000000000 +0100
@@ -3,7 +3,7 @@
 go 1.13
 
 require (
-       github.com/ClusterLabs/go-pacemaker v0.0.0-20250220164558-6fc9deff3ba6
+       github.com/ClusterLabs/go-pacemaker v0.0.0-20250226162851-267530e46cf9
        github.com/sirupsen/logrus v1.9.3
        github.com/stretchr/testify v1.7.0
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hawk-apiserver-0.0.4+git.1740070313.ca7ee57/go.sum 
new/hawk-apiserver-0.0.4+git.1740652077.f970d6a/go.sum
--- old/hawk-apiserver-0.0.4+git.1740070313.ca7ee57/go.sum      2025-02-20 
17:51:53.000000000 +0100
+++ new/hawk-apiserver-0.0.4+git.1740652077.f970d6a/go.sum      2025-02-27 
11:27:57.000000000 +0100
@@ -1,5 +1,5 @@
-github.com/ClusterLabs/go-pacemaker v0.0.0-20250220164558-6fc9deff3ba6 
h1:LzCpdqoa6sIDmOm4dttDEF+QpQXaOUsz+UR4kpo/wh0=
-github.com/ClusterLabs/go-pacemaker v0.0.0-20250220164558-6fc9deff3ba6/go.mod 
h1:Z8/kfx30NVPr2Q3t7b7sVdRs//Ba+CR/yCD1gwk4Nrg=
+github.com/ClusterLabs/go-pacemaker v0.0.0-20250226162851-267530e46cf9 
h1:bqjpPHCU1NgpTXvQ+8+vHZ2c0ldBcALVCTYu9wS61gI=
+github.com/ClusterLabs/go-pacemaker v0.0.0-20250226162851-267530e46cf9/go.mod 
h1:Z8/kfx30NVPr2Q3t7b7sVdRs//Ba+CR/yCD1gwk4Nrg=
 github.com/davecgh/go-spew v1.1.0/go.mod 
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 
h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod 
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

++++++ vendor.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/vendor/github.com/ClusterLabs/go-pacemaker/pacemaker.go 
new/vendor/github.com/ClusterLabs/go-pacemaker/pacemaker.go
--- old/vendor/github.com/ClusterLabs/go-pacemaker/pacemaker.go 2025-02-20 
17:55:06.000000000 +0100
+++ new/vendor/github.com/ClusterLabs/go-pacemaker/pacemaker.go 2025-02-27 
11:30:54.000000000 +0100
@@ -32,6 +32,37 @@
 extern int go_cib_query(cib_t * cib, const char *section, xmlNode ** 
output_data, int call_options);
 extern unsigned int go_cib_register_notify_callbacks(cib_t * cib);
 extern void go_add_idle_scheduler(GMainLoop* loop);
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
+static char* xmlNode2string(xmlNodePtr node) {
+    if (node == NULL) {
+        return NULL;
+    }
+
+    xmlBufferPtr buffer = xmlBufferCreate();
+    if (buffer == NULL) {
+        return NULL;
+    }
+
+    xmlDocPtr doc = node->doc;
+    if (doc == NULL) {
+        xmlBufferFree(buffer);
+        return NULL;
+    }
+
+    int bytes_written = xmlNodeDump(buffer, doc, node, 0, 0);
+    if (bytes_written == -1) {
+        xmlBufferFree(buffer);
+        return NULL;
+    }
+
+    char *result = strdup((char*) xmlBufferContent(buffer));
+    xmlBufferFree(buffer);
+
+    return result; // Don't forget to free in the go code
+}
 */
 import "C"
 
@@ -70,6 +101,7 @@
 
 const (
        Query              CibConnection = C.cib_query
+       QueryXPath         CibConnection = C.cib_xpath
        Command            CibConnection = C.cib_command
        NoConnection       CibConnection = C.cib_no_connection
        CommandNonBlocking CibConnection = C.cib_command_nonblocking
@@ -239,19 +271,13 @@
 }
 
 func (doc *CibDocument) ToString() string {
-       /* The dump_xml_unformatted os deprecated in the pacemaker-2.1.9
-        * and completely dropped from the pacemaker-3.0.0.
-        * Basically the ToString function is broken
-        * if the pacemaker-3.0.0 is used.
-        * The hask-apiserver doesn't use it anymore.
-        * TODO: either remove the ToString completely,
-        *       or reinvent the dump_xml_unformatted in Golang.
-        */
-
-       // buffer := C.dump_xml_unformatted(doc.xml)
-       log.Errorf("dump_xml_unformatted is no more suppored.")
-
-       return ""
+       buffer := C.xmlNode2string(doc.xml)
+       if buffer == nil {
+               log.Errorf("Error: Failed to convert XML")
+               return ""
+       }
+       defer C.free(unsafe.Pointer(buffer))
+       return C.GoString(buffer)
 }
 
 func (doc *CibDocument) Close() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt
--- old/vendor/modules.txt      2025-02-20 17:55:06.000000000 +0100
+++ new/vendor/modules.txt      2025-02-27 11:30:54.000000000 +0100
@@ -1,4 +1,4 @@
-# github.com/ClusterLabs/go-pacemaker v0.0.0-20250220164558-6fc9deff3ba6
+# github.com/ClusterLabs/go-pacemaker v0.0.0-20250226162851-267530e46cf9
 github.com/ClusterLabs/go-pacemaker
 # github.com/davecgh/go-spew v1.1.1
 github.com/davecgh/go-spew/spew

Reply via email to