pidgin/pidgin

Replace purple_build_dir with g_mkdir_with_parents.

2019-11-04, Elliott Sales de Andrade
cdce45867b10
Parents 15c3354736c3
Children a7acc7b00d79
Replace purple_build_dir with g_mkdir_with_parents.

That's all the function does anyway.
--- a/ChangeLog.API Mon Nov 04 02:16:33 2019 -0500
+++ b/ChangeLog.API Mon Nov 04 02:22:52 2019 -0500
@@ -393,6 +393,7 @@
* purple_buddy_icons_has_custom_icon
* purple_buddy_icons_find_custom_icon
* purple_buddy_icons_set_custom_icon
+ * purple_build_dir. Use g_mkdir_with_parents instead
* purple_certificate_check_signature_chain_with_failing. Use
purple_certificate_check_signature_chain, instead
* purple_certificate_display_x509. Use purple_request_certificate,
--- a/libpurple/log.c Mon Nov 04 02:16:33 2019 -0500
+++ b/libpurple/log.c Mon Nov 04 02:22:52 2019 -0500
@@ -871,7 +871,7 @@
if (dir == NULL)
return;
- purple_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
+ g_mkdir_with_parents(dir, S_IRUSR | S_IWUSR | S_IXUSR);
dt = g_date_time_to_local(log->time);
tz = purple_escape_filename(g_date_time_get_timezone_abbreviation(dt));
--- a/libpurple/plugins/autoaccept.c Mon Nov 04 02:16:33 2019 -0500
+++ b/libpurple/plugins/autoaccept.c Mon Nov 04 02:22:52 2019 -0500
@@ -54,8 +54,9 @@
{
if (!g_file_test(dir, G_FILE_TEST_IS_DIR))
{
- if (purple_build_dir(dir, S_IRUSR | S_IWUSR | S_IXUSR))
+ if (g_mkdir_with_parents(dir, S_IRUSR | S_IWUSR | S_IXUSR)) {
return FALSE;
+ }
}
return TRUE;
--- a/libpurple/util.c Mon Nov 04 02:16:33 2019 -0500
+++ b/libpurple/util.c Mon Nov 04 02:22:52 2019 -0500
@@ -2166,7 +2166,7 @@
gboolean xdg_path_exists;
/* Create destination directory */
- mkdir_res = purple_build_dir(purple_xdg_dir, S_IRWXU);
+ mkdir_res = g_mkdir_with_parents(purple_xdg_dir, S_IRWXU);
if (mkdir_res == -1) {
purple_debug_error("util", "Error creating xdg directory %s: %s; failed migration\n",
purple_xdg_dir, g_strerror(errno));
@@ -2215,11 +2215,6 @@
custom_user_dir = NULL;
}
-int purple_build_dir(const char *path, int mode)
-{
- return g_mkdir_with_parents(path, mode);
-}
-
static gboolean
purple_util_write_data_to_file_common(const char *dir, const char *filename, const char *data, gssize size)
{
--- a/libpurple/util.h Mon Nov 04 02:16:33 2019 -0500
+++ b/libpurple/util.h Mon Nov 04 02:22:52 2019 -0500
@@ -591,19 +591,6 @@
void purple_util_set_user_dir(const char *dir);
/**
- * purple_build_dir:
- * @path: The path you wish to create. Note that it must start
- * from the root or this function will fail.
- * @mode: Unix-style permissions for this directory.
- *
- * Builds a complete path from the root, making any directories along
- * the path which do not already exist.
- *
- * Returns: 0 for success, nonzero on any error.
- */
-int purple_build_dir(const char *path, int mode);
-
-/**
* purple_util_write_data_to_file:
* @filename: The basename of the file to write in the purple_user_dir.
* @data: A string of data to write.
--- a/pidgin/gtkprefs.c Mon Nov 04 02:16:33 2019 -0500
+++ b/pidgin/gtkprefs.c Mon Nov 04 02:22:52 2019 -0500
@@ -1259,8 +1259,9 @@
gchar *destdir_escaped = g_shell_quote(destdir);
gchar *command;
- if (!g_file_test(destdir, G_FILE_TEST_IS_DIR))
- purple_build_dir(destdir, S_IRUSR | S_IWUSR | S_IXUSR);
+ if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) {
+ g_mkdir_with_parents(destdir, S_IRUSR | S_IWUSR | S_IXUSR);
+ }
command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped);
g_free(path_escaped);
@@ -1298,8 +1299,9 @@
purple_theme_get_name(theme),
"purple", info->type, NULL);
- if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR))
- purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
+ if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) {
+ g_mkdir_with_parents(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
+ }
g_free(theme_dest);
theme_dest = g_build_filename(purple_data_dir(), "themes",
@@ -1344,8 +1346,9 @@
g_free(source_name);
}
- if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR))
- purple_build_dir(temp_path, S_IRUSR | S_IWUSR | S_IXUSR);
+ if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR)) {
+ g_mkdir_with_parents(temp_path, S_IRUSR | S_IWUSR | S_IXUSR);
+ }
if (purple_theme_file_copy(path, temp_file)) {
/* find the theme, could be in subfolder */
@@ -1357,8 +1360,9 @@
purple_theme_get_name(theme), "purple",
info->type, NULL);
- if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR))
- purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
+ if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) {
+ g_mkdir_with_parents(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
+ }
if (g_rename(purple_theme_get_dir(theme), theme_dest)) {
purple_debug_error("gtkprefs", "Error renaming %s to %s: "