diff options
author | Vincent Untz <vuntz@gnome.org> | 2007-09-01 14:10:27 +0000 |
---|---|---|
committer | Vincent Untz <vuntz@gnome.org> | 2007-09-01 14:10:27 +0000 |
commit | 740682d75b9ea0cb2934b26f4730c0171f497cb6 (patch) | |
tree | 45bb4d429d1aa2e7b53b7480283b757428120edf | |
parent | 5acb0c711dff9406bffdeb62427b3be004cc14f9 (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-- | ChangeLog | 6 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/install.c | 24 |
3 files changed, 8 insertions, 24 deletions
@@ -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]) |