[anjuta] build-basic-autotools: bgo #645695 - install broken since deec63dfe4c2527d5adfed049eeac423307229d1



commit bd421b605470996b6e1d4f10f9e8f338f1dabcd0
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sat Mar 26 14:23:19 2011 +0100

    build-basic-autotools: bgo #645695 - install broken since deec63dfe4c2527d5adfed049eeac423307229d1

 plugins/build-basic-autotools/plugin.c |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/plugins/build-basic-autotools/plugin.c b/plugins/build-basic-autotools/plugin.c
index b0213f9..c7065fd 100644
--- a/plugins/build-basic-autotools/plugin.c
+++ b/plugins/build-basic-autotools/plugin.c
@@ -1695,19 +1695,33 @@ build_install_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname,
 	gchar* root = get_root_install_command(plugin);
 	gchar *build_dir = build_dir_from_source (plugin, dirname);
 	BuildProgram *prog;
-	gchar *command = g_shell_quote (CHOOSE_COMMAND (plugin, INSTALL));
-	
-	prog = build_program_new_with_command (build_dir,
-	                                       "%s %s",
-	                                       root,
-	                                       command);
+
+	/* Check if we need to quote the command (only after " -c" argument)
+	 * FIXME: it will be better to use a format string here to know if we need to
+	 * quote the command or not */
+	if ((root != NULL) && (strlen (root) > 3) && (strcmp (root + strlen(root) - 3, " -c") == 0))
+	{
+		gchar *command = g_shell_quote (CHOOSE_COMMAND (plugin, INSTALL));
+
+		prog = build_program_new_with_command (build_dir,
+			                                   "%s %s",
+	    		                               root,
+	        		                           command);
+		g_free (command);
+	}
+	else
+	{
+		prog = build_program_new_with_command (build_dir,
+			                                   "%s %s",
+		                                       root,
+	        		                           CHOOSE_COMMAND (plugin, INSTALL));
+	}
 	build_program_set_callback (prog, callback, user_data);	
 	
 	context = build_save_and_execute_command (plugin, prog, TRUE, err);
 	
 	g_free (build_dir);
 	g_free(root);
-	g_free (command);
 	
 	return context;
 }



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