gimp r27101 - in trunk: . tools



Author: neo
Date: Wed Oct  1 19:13:16 2008
New Revision: 27101
URL: http://svn.gnome.org/viewvc/gimp?rev=27101&view=rev

Log:
2008-10-01  Sven Neumann  <sven gimp org>

	* tools/gimptool.c: create the target directory and intermediate
	parent directories as needed. Restores the behavior of the
	gimptool shell script.



Modified:
   trunk/ChangeLog
   trunk/tools/gimptool.c

Modified: trunk/tools/gimptool.c
==============================================================================
--- trunk/tools/gimptool.c	(original)
+++ trunk/tools/gimptool.c	Wed Oct  1 19:13:16 2008
@@ -31,10 +31,16 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <sys/stat.h>
+
 #include <glib.h>
 
 #include "libgimpbase/gimpversion.h"
 
+#ifdef G_OS_WIN32
+#include "libgimpbase/gimpwin32-io.h"
+#endif
+
 
 static gboolean     silent  = FALSE;
 static gboolean     dry_run = FALSE;
@@ -499,19 +505,19 @@
 }
 
 static void
-do_build (char *what)
+do_build (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), NULL, what);
 }
 
 static void
-do_build_noui (char *what)
+do_build_noui (const gchar *what)
 {
   do_build_2 (get_cflags_noui (), get_libs_noui (), NULL, what);
 }
 
 static void
-do_build_nogimpui (char *what)
+do_build_nogimpui (const gchar *what)
 {
   do_build (what);
 }
@@ -535,19 +541,19 @@
 }
 
 static void
-do_install (char *what)
+do_install (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), get_user_plugin_dir (FALSE), what);
 }
 
 static void
-do_install_noui (char *what)
+do_install_noui (const gchar *what)
 {
   do_build_2 (get_cflags_noui (), get_libs_noui (), get_user_plugin_dir (FALSE), what);
 }
 
 static void
-do_install_nogimpui (char *what)
+do_install_nogimpui (const gchar *what)
 {
   do_install (what);
 }
@@ -567,51 +573,56 @@
 }
 
 static void
-do_install_admin (char *what)
+do_install_admin (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), get_sys_plugin_dir (TRUE), what);
 }
 
 static void
-do_install_admin_noui (char *what)
+do_install_admin_noui (const gchar *what)
 {
   do_build_2 (get_cflags_noui (), get_libs_noui (), get_sys_plugin_dir (TRUE), what);
 }
 
 static void
-do_install_admin_nogimpui (char *what)
+do_install_admin_nogimpui (const gchar *what)
 {
   do_build_2 (get_cflags (), get_libs (), get_sys_plugin_dir (TRUE), what);
 }
 
 static void
-do_install_bin_2 (gchar *dir,
-		  gchar *what)
+do_install_bin_2 (const gchar *dir,
+		  const gchar *what)
 {
+  g_mkdir_with_parents (dir,
+                        S_IRUSR | S_IXUSR | S_IWUSR |
+                        S_IRGRP | S_IXGRP |
+                        S_IROTH | S_IXOTH);
+
   maybe_run (g_strconcat (COPY, " ", what, " ", dir, NULL));
 }
 
 static void
-do_install_bin (char *what)
+do_install_bin (const gchar *what)
 {
   do_install_bin_2 (get_user_plugin_dir (FALSE), what);
 }
 
 static void
-do_install_admin_bin (char *what)
+do_install_admin_bin (const gchar *what)
 {
   do_install_bin_2 (get_sys_plugin_dir (FALSE), what);
 }
 
 static void
-do_uninstall (gchar *dir,
-	      gchar *what)
+do_uninstall (const gchar *dir,
+	      const gchar *what)
 {
   maybe_run (g_strconcat (REMOVE, " ", dir, G_DIR_SEPARATOR_S, what, NULL));
 }
 
-static gchar *
-maybe_append_exe (gchar *what)
+static const gchar *
+maybe_append_exe (const gchar *what)
 {
 #ifdef G_OS_WIN32
   gchar *p = strrchr (what, '.');
@@ -624,13 +635,13 @@
 }
 
 static void
-do_uninstall_bin (char *what)
+do_uninstall_bin (const gchar *what)
 {
   do_uninstall (get_user_plugin_dir (FALSE), maybe_append_exe (what));
 }
 
 static void
-do_uninstall_admin_bin (char *what)
+do_uninstall_admin_bin (const gchar *what)
 {
   do_uninstall (get_sys_plugin_dir (FALSE), maybe_append_exe (what));
 }
@@ -649,7 +660,7 @@
 }
 
 static void
-do_install_script (char *what)
+do_install_script (const gchar *what)
 {
   do_install_bin_2 (get_user_script_dir (FALSE), what);
 }
@@ -671,19 +682,19 @@
 }
 
 static void
-do_install_admin_script (char *what)
+do_install_admin_script (const gchar *what)
 {
   do_install_bin_2 (get_sys_script_dir (FALSE), what);
 }
 
 static void
-do_uninstall_script (char *what)
+do_uninstall_script (const gchar *what)
 {
   do_uninstall (get_user_script_dir (FALSE), what);
 }
 
 static void
-do_uninstall_admin_script (char *what)
+do_uninstall_admin_script (const gchar *what)
 {
   do_uninstall (get_sys_script_dir (FALSE), what);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]