summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2007-09-01 14:10:27 +0000
committerVincent Untz <vuntz@gnome.org>2007-09-01 14:10:27 +0000
commit740682d75b9ea0cb2934b26f4730c0171f497cb6 (patch)
tree45bb4d429d1aa2e7b53b7480283b757428120edf
parent5acb0c711dff9406bffdeb62427b3be004cc14f9 (diff)
require glib 2.8.0 kill (main): directly use g_mkdir_with_parents()
2007-09-01 Vincent Untz <vuntz@gnome.org> * configure.in: require glib 2.8.0 * src/install.c: (mkdir_and_parents): kill (main): directly use g_mkdir_with_parents()
-rw-r--r--ChangeLog6
-rw-r--r--configure.in2
-rw-r--r--src/install.c24
3 files changed, 8 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f15022..4e1e746 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2007-09-01 Vincent Untz <vuntz@gnome.org>
+ * configure.in: require glib 2.8.0
+ * src/install.c: (mkdir_and_parents): kill
+ (main): directly use g_mkdir_with_parents()
+
+2007-09-01 Vincent Untz <vuntz@gnome.org>
+
* src/install.c: (process_one_file): simplify the code with a macro
(parse_options_callback): if --add-category="GNOME;GTK" is passed as
argument, parse the list of categories instead of assuming the user
diff --git a/configure.in b/configure.in
index 801f77c..5d066b5 100644
--- a/configure.in
+++ b/configure.in
@@ -94,7 +94,7 @@ CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
changequote([,])dnl
-PKG_CHECK_MODULES(DESKTOP_FILE_UTILS, glib-2.0 >= 2.6.0)
+PKG_CHECK_MODULES(DESKTOP_FILE_UTILS, glib-2.0 >= 2.8.0)
AM_PATH_LISPDIR
diff --git a/src/install.c b/src/install.c
index 1668cb2..b1a891d 100644
--- a/src/install.c
+++ b/src/install.c
@@ -9,7 +9,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <sys/stat.h>
#include <locale.h>
#include "keyfileutils.h"
@@ -507,27 +506,6 @@ parse_options_callback (const gchar *option_name,
return TRUE;
}
-static void
-mkdir_and_parents (const char *dirname,
- mode_t mode)
-{
- char *parent;
- char *slash;
-
- parent = g_strdup (dirname);
- slash = NULL;
- if (*parent != '\0')
- slash = strrchr (parent, '/');
- if (slash != NULL)
- {
- *slash = '\0';
- mkdir_and_parents (parent, mode);
- }
- g_free (parent);
-
- mkdir (dirname, mode);
-}
-
int
main (int argc, char **argv)
{
@@ -582,7 +560,7 @@ main (int argc, char **argv)
if (permissions & 0004)
dir_permissions |= 0001;
- mkdir_and_parents (target_dir, dir_permissions);
+ g_mkdir_with_parents (target_dir, dir_permissions);
i = 0;
while (args && args[i])