Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wtmpdb for openSUSE:Factory checked 
in at 2025-02-09 20:00:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wtmpdb (Old)
 and      /work/SRC/openSUSE:Factory/.wtmpdb.new.2316 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wtmpdb"

Sun Feb  9 20:00:18 2025 rev:19 rq:1244111 version:0.71.0+git20250206.608632a

Changes:
--------
--- /work/SRC/openSUSE:Factory/wtmpdb/wtmpdb.changes    2025-02-04 
18:10:18.566033611 +0100
+++ /work/SRC/openSUSE:Factory/.wtmpdb.new.2316/wtmpdb.changes  2025-02-09 
20:00:18.783634581 +0100
@@ -1,0 +2,7 @@
+Thu Feb 06 10:44:44 UTC 2025 - [email protected]
+
+- Update to version 0.71.0+git20250206.608632a:
+  * Fix expected output of wtmpdb_rotate() test
+  * Make header usable from C++
+
+-------------------------------------------------------------------

Old:
----
  wtmpdb-0.71.0+git20250203.86b8442.tar.xz

New:
----
  wtmpdb-0.71.0+git20250206.608632a.tar.xz

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

Other differences:
------------------
++++++ wtmpdb.spec ++++++
--- /var/tmp/diff_new_pack.6Gs73s/_old  2025-02-09 20:00:19.899680467 +0100
+++ /var/tmp/diff_new_pack.6Gs73s/_new  2025-02-09 20:00:19.899680467 +0100
@@ -18,7 +18,7 @@
 
 %define lname   libwtmpdb0
 Name:           wtmpdb
-Version:        0.71.0+git20250203.86b8442
+Version:        0.71.0+git20250206.608632a
 Release:        0
 Summary:        Database for recording the last logged in users and system 
reboots
 License:        BSD-2-Clause

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.6Gs73s/_old  2025-02-09 20:00:19.943682276 +0100
+++ /var/tmp/diff_new_pack.6Gs73s/_new  2025-02-09 20:00:19.947682441 +0100
@@ -4,6 +4,6 @@
 </service>
 <service name="tar_scm">
                 <param name="url">https://github.com/thkukuk/wtmpdb.git</param>
-              <param 
name="changesrevision">86b84424e28df94c5a94c93abfb8e86ad5a0f403</param></service></servicedata>
+              <param 
name="changesrevision">608632a97be265174d05a3e8c3e1d26e623061cc</param></service></servicedata>
 (No newline at EOF)
 

++++++ wtmpdb-0.71.0+git20250203.86b8442.tar.xz -> 
wtmpdb-0.71.0+git20250206.608632a.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wtmpdb-0.71.0+git20250203.86b8442/include/wtmpdb.h 
new/wtmpdb-0.71.0+git20250206.608632a/include/wtmpdb.h
--- old/wtmpdb-0.71.0+git20250203.86b8442/include/wtmpdb.h      2025-02-03 
13:43:43.000000000 +0100
+++ new/wtmpdb-0.71.0+git20250206.608632a/include/wtmpdb.h      2025-02-06 
11:36:28.000000000 +0100
@@ -44,6 +44,10 @@
 #define NSEC_PER_USEC ((uint64_t) 1000ULL)
 #define USEC_PER_SEC  ((uint64_t) 1000000ULL)
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern int64_t logwtmpdb (const char *db_path, const char *tty,
                          const char *name, const char *host,
                          const char *service, char **error);
@@ -71,3 +75,7 @@
 extern int64_t wtmpdb_get_id (const char *db_path, const char *tty,
                              char **error);
 extern uint64_t wtmpdb_timespec2usec (const struct timespec ts);
+
+#ifdef __cplusplus
+}
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wtmpdb-0.71.0+git20250203.86b8442/tests/tst-login-logout.c 
new/wtmpdb-0.71.0+git20250206.608632a/tests/tst-login-logout.c
--- old/wtmpdb-0.71.0+git20250203.86b8442/tests/tst-login-logout.c      
2025-02-03 13:43:43.000000000 +0100
+++ new/wtmpdb-0.71.0+git20250206.608632a/tests/tst-login-logout.c      
2025-02-06 11:36:28.000000000 +0100
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-2-Clause
 
-  Copyright (c) 2023, Thorsten Kukuk <[email protected]>
+  Copyright (c) 2023, 2025 Thorsten Kukuk <[email protected]>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
@@ -34,6 +34,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include "basics.h"
 
 #include "wtmpdb.h"
 
@@ -98,6 +99,7 @@
 static int
 test_rotate (const char *db_path, const int days)
 {
+  int expected;
   char *error = NULL;
 
   counter = 0;
@@ -112,9 +114,10 @@
        fprintf (stderr, "wtmpdb_read_all failed\n");
       return 1;
     }
-  if (counter != ((days-1) * 5))
+  expected = (days-1) * 5;
+  if (counter != expected)
     {
-      fprintf (stderr, "wtmpdb_read_all returned %d expected 5\n", counter);
+      fprintf (stderr, "wtmpdb_read_all returned %d expected %d\n", counter, 
expected);
       return 1;
     }
 
@@ -142,15 +145,37 @@
        fprintf (stderr, "wtmpdb_read_all failed\n");
       return 1;
     }
-  if (counter != (days-2) * 5)
+  expected = (days-2) * 5;
+  if (counter != expected)
     {
-      fprintf (stderr, "wtmpdb_read_all returned %d expected 0\n", counter);
+      fprintf (stderr, "wtmpdb_read_all returned %d expected %d\n", counter, 
expected);
       return 1;
     }
 
   return 0;
 }
 
+static void
+remove_backup_db(int days)
+{
+  _cleanup_(freep) char *backup_path = NULL;
+  struct timespec ts_now;
+
+  clock_gettime (CLOCK_REALTIME, &ts_now);
+
+  time_t offset = ts_now.tv_sec - days * 86400;
+  struct tm *tm = localtime (&offset);
+  char date[10];
+  strftime (date, 10, "%Y%m%d", tm);
+
+  if (asprintf (&backup_path, "tst-login-logout_%s.db", date) < 0)
+    {
+      fprintf (stderr, "Out of memory");
+      return;
+    }
+  remove (backup_path);
+}
+
 int
 main(void)
 {
@@ -188,20 +213,8 @@
     return 1;
 
   /* cleanup */
-  struct timespec ts_now;
-  clock_gettime (CLOCK_REALTIME, &ts_now);
-  time_t offset = ts_now.tv_sec - 2 * 86400;
-  struct tm *tm = localtime (&offset);
-  char date[10];
-  strftime (date, 10, "%Y%m%d", tm);
-  char *backup_path = NULL;
-  if (asprintf (&backup_path, "tst-login-logout_%s.db", date) < 0)
-    {
-      fprintf (stderr, "Out of memory");
-      return 1;
-    }
-  remove (backup_path);
-  free (backup_path);
+  remove_backup_db(2);
+  remove_backup_db(3);
   remove (db_path);
 
   return 0;

Reply via email to