Compare commits
No commits in common. 'c9' and 'cs10' have entirely different histories.
@ -1,31 +0,0 @@
|
||||
--- a/gvdb/gvdb-builder.c
|
||||
+++ b/gvdb/gvdb-builder.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "gvdb-format.h"
|
||||
|
||||
#include <glib.h>
|
||||
+#include <glib/gstdio.h>
|
||||
#include <fcntl.h>
|
||||
#if !defined(G_OS_WIN32) || !defined(_MSC_VER)
|
||||
#include <unistd.h>
|
||||
@@ -509,13 +510,20 @@ gvdb_table_write_contents (GHashTable *table,
|
||||
gboolean status;
|
||||
FileBuilder *fb;
|
||||
GString *str;
|
||||
+ GStatBuf buf;
|
||||
+ gint stat_ret;
|
||||
|
||||
fb = file_builder_new (byteswap);
|
||||
file_builder_add_hash (fb, table, &root);
|
||||
str = file_builder_serialise (fb, root);
|
||||
|
||||
+ stat_ret = g_stat (filename, &buf);
|
||||
+
|
||||
status = g_file_set_contents (filename, str->str, str->len, error);
|
||||
g_string_free (str, TRUE);
|
||||
|
||||
+ if (stat_ret == 0)
|
||||
+ g_chmod (filename, buf.st_mode);
|
||||
+
|
||||
return status;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
From c755ccd699cc0b52f73cfdae30fb7e2c3a46c8c1 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Tue, 12 Nov 2024 15:23:37 +0100
|
||||
Subject: [PATCH] tests: Do not use system profile
|
||||
|
||||
Set default profile containing "user-db:user"
|
||||
so that tests don't use system profile.
|
||||
|
||||
Fixes: #58
|
||||
---
|
||||
tests/test-dconf.py | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/tests/test-dconf.py b/tests/test-dconf.py
|
||||
index 1f50da8..3ac60d3 100755
|
||||
--- a/tests/test-dconf.py
|
||||
+++ b/tests/test-dconf.py
|
||||
@@ -105,10 +105,17 @@ class DBusTest(unittest.TestCase):
|
||||
os.mkdir(self.dbus_dir, mode=0o700)
|
||||
os.mkdir(os.path.join(self.config_home, 'dconf'))
|
||||
|
||||
+ os.environ['DCONF_PROFILE'] = os.path.join(self.temporary_dir.name, 'profile')
|
||||
os.environ['DCONF_BLAME'] = ''
|
||||
os.environ['XDG_RUNTIME_DIR'] = self.runtime_dir
|
||||
os.environ['XDG_CONFIG_HOME'] = self.config_home
|
||||
|
||||
+ # Configure default profile so that the system one
|
||||
+ # does not affect the tests.
|
||||
+ path = os.path.join(self.temporary_dir.name, 'profile')
|
||||
+ with open(path, 'w') as file:
|
||||
+ file.write('user-db:user')
|
||||
+
|
||||
# Prepare dbus-daemon config.
|
||||
dbus_daemon_config = os.path.join(self.dbus_dir, 'session.conf')
|
||||
with open(dbus_daemon_config, 'w') as file:
|
||||
--
|
||||
2.47.0
|
||||
|
Loading…
Reference in new issue