cvs commit: ALFS/nALFS/src/handlers alfs.c conditionals.c configure.c copy.c download.c execute.c link.c make.c mkdir.c move.c owner.c ownership.c package.c patch.c permissions.c remove.c search_replace.c stage.c textdump.c unpack.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Tue Feb 10 21:08:12 PST 2004


kpfleming    04/02/10 22:08:12

  Modified:    nALFS/src backend.c backend.h handlers.h logging.c
               nALFS/src/handlers alfs.c conditionals.c configure.c copy.c
                        download.c execute.c link.c make.c mkdir.c move.c
                        owner.c ownership.c package.c patch.c permissions.c
                        remove.c search_replace.c stage.c textdump.c
                        unpack.c
  Log:
  make all syntax 3.2 supported handlers support <shell> parameter in <stageinfo>
  
  Revision  Changes    Path
  1.11      +9 -29     ALFS/nALFS/src/backend.c
  
  Index: backend.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/backend.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- backend.c	11 Feb 2004 04:21:54 -0000	1.10
  +++ backend.c	11 Feb 2004 05:08:12 -0000	1.11
  @@ -248,7 +248,9 @@
   		Nprint_err("Executing command using %s failed: %s", command,
   			strerror(errno));
   
  -		exit(EXIT_FAILURE);
  +		/* use a non-standard exit() code to ensure that the parent
  +		   knows the executing command failed completely */
  +		exit(-1);
   	}
   
   	/* Parent. */
  @@ -289,7 +291,7 @@
   	return status;
   }
   
  -int execute_shell_command(element_s *element, const char *format, ...)
  +int execute_command(element_s *element, const char *format, ...)
   {
   	va_list ap;
   	int status = 0;
  @@ -304,7 +306,11 @@
   	va_end(ap);
   
   	if (status > -1 && status < (int) sizeof command) {
  -		shell = alloc_stage_shell(element);
  +		if (element && element->handler->info->alternate_shell) {
  +			shell = alloc_stage_shell(element);
  +		} else {
  +			shell = xstrdup("sh");
  +		}
   		/* make a copy of shell because basename may modify it */
   		temp = xstrdup(shell);
   		args[0] = xstrdup(basename(temp));
  @@ -315,32 +321,6 @@
   		xfree(args[0]);
   		xfree(temp);
   		xfree(shell);
  -	} else {
  -		Nprint_err("System command is too long.");
  -		return -1;
  -	}
  -
  -	return status;
  -}
  -
  -int execute_command(const char *format, ...)
  -{
  -	va_list ap;
  -	int status = 0;
  -	char command[MAX_COMMAND_LEN];
  -	char *args[4];
  -
  -
  -	va_start(ap, format);
  -	status = vsnprintf(command, sizeof command, format, ap);
  -	va_end(ap);
  -
  -	if (status > -1 && status < (int) sizeof command) {
  -		args[0] = "sh";
  -		args[1] = "-c";
  -		args[2] = command;
  -		args[3] = NULL;
  -		status = execute_direct_command("sh", args);
   	} else {
   		Nprint_err("System command is too long.");
   		return -1;
  
  
  
  1.5       +1 -4      ALFS/nALFS/src/backend.h
  
  Index: backend.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/backend.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- backend.h	8 Feb 2004 03:15:09 -0000	1.4
  +++ backend.h	11 Feb 2004 05:08:12 -0000	1.5
  @@ -42,11 +42,8 @@
   
   void fatal_backend_error(const char *format, ...);
   
  -/* execute_command() is deprecated, please use execute_shell_command() */
  -int execute_command(const char *format, ...);
  -
   int execute_direct_command(const char *command, char *const argv[]);
  -int execute_shell_command(element_s *element, const char *format, ...);
  +int execute_command(element_s *element, const char *format, ...);
   
   int do_execute_test_element(element_s *element, int *result);
   int execute_children(element_s *element);
  
  
  
  1.11      +4 -1      ALFS/nALFS/src/handlers.h
  
  Index: handlers.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- handlers.h	8 Feb 2004 05:23:59 -0000	1.10
  +++ handlers.h	11 Feb 2004 05:08:12 -0000	1.11
  @@ -68,6 +68,10 @@
   				   handlers that replace standard ones) */
   
   	handler_test test;	/* used by HTYPE_TEST */
  +	int alternate_shell;	/* commands issued by handler should support
  +				   <shell> element if present in a containing
  +				   stage
  +				*/
   } handler_info_s;
   
   
  @@ -101,6 +105,5 @@
   void check_options(int total, int *opts, const char *string_, element_s *el);
   char *append_param_elements(char **string, element_s *el);
   char *append_prefix_elements(char **string, element_s *el);
  -
   
   #endif /* H_HANDLER_ */
  
  
  
  1.15      +1 -1      ALFS/nALFS/src/logging.c
  
  Index: logging.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/logging.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- logging.c	3 Nov 2003 21:45:04 -0000	1.14
  +++ logging.c	11 Feb 2004 05:08:12 -0000	1.15
  @@ -95,7 +95,7 @@
   
   		/* Directory doesn't exist. */
   
  -		if (execute_command("mkdir -p %s", dirname) != 0) {
  +		if (execute_command(NULL, "mkdir -p %s", dirname) != 0) {
   			Nprint_warn("Creating %s failed.\n", dirname);
   			return -1;
   		}
  
  
  
  1.13      +1 -0      ALFS/nALFS/src/handlers/alfs.c
  
  Index: alfs.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/alfs.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- alfs.c	6 Feb 2004 05:54:36 -0000	1.12
  +++ alfs.c	11 Feb 2004 05:08:12 -0000	1.13
  @@ -96,6 +96,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 0,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.4       +11 -4     ALFS/nALFS/src/handlers/conditionals.c
  
  Index: conditionals.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/conditionals.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- conditionals.c	8 Feb 2004 03:15:09 -0000	1.3
  +++ conditionals.c	11 Feb 2004 05:08:12 -0000	1.4
  @@ -40,7 +40,7 @@
   static const char *null_parameters[] = { NULL };
   
   #if HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2
  -static int do_shelltest(const char *test, int *result)
  +static int do_shelltest(element_s *element, const char *test, int *result)
   {
   	int status = 0;
   	long num_value;
  @@ -68,7 +68,7 @@
   		*result = 0;
   	} else {
   		Nprint_h("    test %s", temp);
  -		status = execute_command("test %s", temp);
  +		status = execute_command(element, "test %s", temp);
   		if ((status == 0) || (status == 1)) {
   			*result = (status == 0) ? 1 : 0;
   			status = 0;
  @@ -102,7 +102,7 @@
   		return -1;
   	}
   	if (shelltest) {
  -		if ((status = do_shelltest(shelltest, &test_result)))
  +		if ((status = do_shelltest(element, shelltest, &test_result)))
   			return status;
   	} else {
   	}
  @@ -217,7 +217,7 @@
   	if ((test = alloc_trimmed_str(element->content)) == NULL) {
   		Nprint_h_err("No test content specified.");
   	} else {
  -		status = do_shelltest(test, result);
  +		status = do_shelltest(element, test, result);
   		xfree(test);
   	}
   
  @@ -267,6 +267,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -278,6 +279,7 @@
   		.type = HTYPE_TEST,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -289,6 +291,7 @@
   		.type = HTYPE_TEST,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -300,6 +303,7 @@
   		.type = HTYPE_TEST,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -310,6 +314,7 @@
   		.test = shelltest_test_3_2,
   		.type = HTYPE_TEST,
   		.alloc_data = NULL,
  +		.alternate_shell = 1,
   		.is_action = 1,
   		.priority = 0
   	},
  @@ -322,6 +327,7 @@
   		.type = HTYPE_TEST,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -333,6 +339,7 @@
   		.type = HTYPE_TEST,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +3 -2      ALFS/nALFS/src/handlers/configure.c
  
  Index: configure.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/configure.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- configure.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ configure.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -70,7 +70,7 @@
   
   	Nprint_h("Executing in %s:", base);
   	Nprint_h("    %s", command);
  -	status = execute_command("%s", command);
  +	status = execute_command(el, "%s", command);
   
   	xfree(base);
   	xfree(command);
  @@ -115,7 +115,7 @@
   
   	Nprint_h("Executing in %s:", base);
   	Nprint_h("    %s", command);
  -	status = execute_command("%s", command);
  +	status = execute_command(el, "%s", command);
   
   	xfree(base);
   	xfree(command);
  @@ -180,6 +180,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +3 -2      ALFS/nALFS/src/handlers/copy.c
  
  Index: copy.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/copy.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- copy.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ copy.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -107,7 +107,7 @@
   		Nprint_h("Executing in %s:", base);
   		Nprint_h("    %s", command);
   
  -		status = execute_command("%s", command);
  +		status = execute_command(el, "%s", command);
   
   		xfree(command);
   
  @@ -201,7 +201,7 @@
   		Nprint_h("Executing in %s:", base);
   		Nprint_h("    %s", command);
   
  -		status = execute_command("%s", command);
  +		status = execute_command(el, "%s", command);
   
   		xfree(command);
   		xfree(s);
  @@ -276,6 +276,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.15      +1 -0      ALFS/nALFS/src/handlers/download.c
  
  Index: download.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/download.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- download.c	6 Feb 2004 05:54:36 -0000	1.14
  +++ download.c	11 Feb 2004 05:08:12 -0000	1.15
  @@ -262,6 +262,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.20      +4 -3      ALFS/nALFS/src/handlers/execute.c
  
  Index: execute.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/execute.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- execute.c	8 Feb 2004 05:12:35 -0000	1.19
  +++ execute.c	11 Feb 2004 05:08:12 -0000	1.20
  @@ -74,7 +74,7 @@
   	Nprint_h("Executing system command in %s:", base);
   	Nprint_h("    %s", command);
   
  -	status = execute_command("%s", command);
  +	status = execute_command(el, "%s", command);
   
   	xfree(base);
   	xfree(command);
  @@ -129,7 +129,7 @@
   	Nprint_h("Executing system command in %s:", base);
   	Nprint_h("    %s", command);
   
  -	status = execute_command("%s", command);
  +	status = execute_command(el, "%s", command);
   
   	xfree(base);
   	xfree(command);
  @@ -201,7 +201,7 @@
   		append_param_elements(&command, el);
   		Nprint_h("Executing system command in %s:", base);
   		Nprint_h("    %s", command);
  -		status = execute_shell_command(el, "%s", command);
  +		status = execute_command(el, "%s", command);
   		xfree(command);
   	} else {
   		FILE *temp_script;
  @@ -316,6 +316,7 @@
   		.type = HTYPE_EXECUTE,
   		.alloc_data = execute_data_ver3_2,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +3 -2      ALFS/nALFS/src/handlers/link.c
  
  Index: link.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/link.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- link.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ link.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -117,7 +117,7 @@
   		append_str(&command, link_name);
   	}
   
  -	if ((status = execute_command("%s", command))) {
  +	if ((status = execute_command(el, "%s", command))) {
   		Nprint_h_err("Executing \"%s\" in \"%s\" failed.",
   			command, base);
   	}
  @@ -232,7 +232,7 @@
   		Nprint_h("%s", message);
   		Nprint_h("    %s", targets);
   
  -		if ((status = execute_command("%s", command))) {
  +		if ((status = execute_command(el, "%s", command))) {
   			Nprint_h_err("Executing \"%s\" in %s failed.",
   				command, base);
   		}
  @@ -307,6 +307,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +3 -2      ALFS/nALFS/src/handlers/make.c
  
  Index: make.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/make.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- make.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ make.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -64,7 +64,7 @@
   	Nprint_h("Executing in %s:", base);
   	Nprint_h("    %s", command);
   
  -	status = execute_command("%s", command);
  +	status = execute_command(el, "%s", command);
   
   	xfree(base);
   	xfree(command);
  @@ -105,7 +105,7 @@
   	Nprint_h("Executing in %s:", base);
   	Nprint_h("    %s", command);
   
  -	status = execute_command("%s", command);
  +	status = execute_command(el, "%s", command);
   
   	xfree(base);
   	xfree(command);
  @@ -170,6 +170,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +6 -5      ALFS/nALFS/src/handlers/mkdir.c
  
  Index: mkdir.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/mkdir.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mkdir.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ mkdir.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -85,9 +85,9 @@
   		}
   
   		if (parents) {
  -			status = execute_command("mkdir -p %s", tok);
  +			status = execute_command(el, "mkdir -p %s", tok);
   		} else {
  -			status = execute_command("mkdir %s", tok);
  +			status = execute_command(el, "mkdir %s", tok);
   		}
   
   		if (status) {
  @@ -100,7 +100,7 @@
   		}
   
   		/* Change permissions. */
  -		if ((status = execute_command("chmod %s %s", perm, tok))) {
  +		if ((status = execute_command(el, "chmod %s %s", perm, tok))) {
   			Nprint_h_err("Changing permissions failed.");
   			break;
   		}
  @@ -180,7 +180,7 @@
   		
   		Nprint_h("%s", message);
   
  -		if ((status = execute_command("%s", command))) {
  +		if ((status = execute_command(el, "%s", command))) {
   			Nprint_h_err("Creating %s failed.", dir);
   			xfree(dir);
   			xfree(command);
  @@ -190,7 +190,7 @@
   
   		if (perm) {
   			/* Change permissions. */
  -			if ((status = execute_command("chmod %s %s",
  +			if ((status = execute_command(el, "chmod %s %s",
   			perm, dir))) {
   				Nprint_h_err("Changing permissions failed.");
   				xfree(dir);
  @@ -268,6 +268,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +5 -4      ALFS/nALFS/src/handlers/move.c
  
  Index: move.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/move.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- move.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ move.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -85,9 +85,9 @@
   			base, destination, force ? " (force)" : "", tok);
   
   		if (force) {
  -			status = execute_command("mv -f %s %s", tok, destination);
  +			status = execute_command(el, "mv -f %s %s", tok, destination);
   		} else {
  -			status = execute_command("mv %s %s", tok, destination);
  +			status = execute_command(el, "mv %s %s", tok, destination);
   		}
   
   		if (status) {
  @@ -155,9 +155,9 @@
   			base, destination, force ? " (force)" : "", s);
   
   		if (force) {
  -			status = execute_command("mv -f %s %s", s, destination);
  +			status = execute_command(el, "mv -f %s %s", s, destination);
   		} else {
  -			status = execute_command("mv %s %s", s, destination);
  +			status = execute_command(el, "mv %s %s", s, destination);
   		}
   
   		xfree(s);
  @@ -231,6 +231,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +1 -1      ALFS/nALFS/src/handlers/owner.c
  
  Index: owner.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/owner.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- owner.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ owner.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -152,7 +152,7 @@
   
   		Nprint_h("%s", message);
   
  -		if ((status = execute_command(command))) {
  +		if ((status = execute_command(el, command))) {
   			Nprint_h_err("Changing ownership failed.");
   			break;
   		}
  
  
  
  1.12      +3 -2      ALFS/nALFS/src/handlers/ownership.c
  
  Index: ownership.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/ownership.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ownership.c	6 Feb 2004 05:54:36 -0000	1.11
  +++ ownership.c	11 Feb 2004 05:08:12 -0000	1.12
  @@ -102,7 +102,7 @@
   
   			Nprint_h("%s", message);
   
  -			if ((status = execute_command(command))) {
  +			if ((status = execute_command(el, command))) {
   				Nprint_h_err("Changing ownership failed.");
   				xfree(s);
   				xfree(command);
  @@ -141,7 +141,7 @@
   
   			Nprint_h("%s", message);
   
  -			if ((status = execute_command(command))) {
  +			if ((status = execute_command(el, command))) {
   				Nprint_h_err("Changing ownership failed.");
   				xfree(s);
   				xfree(command);
  @@ -205,6 +205,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.16      +1 -0      ALFS/nALFS/src/handlers/package.c
  
  Index: package.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/package.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- package.c	8 Feb 2004 05:57:23 -0000	1.15
  +++ package.c	11 Feb 2004 05:08:12 -0000	1.16
  @@ -334,6 +334,7 @@
   		.type = HTYPE_PACKAGE,
   		.alloc_data = package_data_ver3,
   		.is_action = 0,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.18      +5 -3      ALFS/nALFS/src/handlers/patch.c
  
  Index: patch.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/patch.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- patch.c	6 Feb 2004 05:54:36 -0000	1.17
  +++ patch.c	11 Feb 2004 05:08:12 -0000	1.18
  @@ -69,7 +69,7 @@
   	Nprint_h("Patching in %s", base);
   	Nprint_h("    patch %s", parameters);
   
  -	if ((status = execute_command("patch %s", parameters))) {
  +	if ((status = execute_command(el, "patch %s", parameters))) {
   		Nprint_h_err("Patching failed.");
   	}
   	
  @@ -125,7 +125,7 @@
   
   	Nprint_h("    %s", command);
   
  -	if ((status = execute_command(command))) {
  +	if ((status = execute_command(el, command))) {
   		Nprint_h_err("Patching failed.");
   	}
   	
  @@ -249,7 +249,8 @@
   
   	Nprint_h("    %s", command);
   
  -	if ((status = execute_command(decompressor, file, command))) {
  +	if ((status = execute_command(el, decompressor, file,
  +				      command))) {
   		Nprint_h_err("Patching failed.");
   	}
   	
  @@ -320,6 +321,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.14      +3 -2      ALFS/nALFS/src/handlers/permissions.c
  
  Index: permissions.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/permissions.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- permissions.c	6 Feb 2004 05:54:36 -0000	1.13
  +++ permissions.c	11 Feb 2004 05:08:12 -0000	1.14
  @@ -104,7 +104,7 @@
   
   		Nprint_h("%s", message);
   
  -		if ((status = execute_command(command))) {
  +		if ((status = execute_command(el, command))) {
   			Nprint_h_err("Changing permissions failed.");
   			break;
   		}
  @@ -189,7 +189,7 @@
   
   		Nprint_h("%s", message);
   
  -		if ((status = execute_command(command))) {
  +		if ((status = execute_command(el, command))) {
   			Nprint_h_err("Changing permissions failed.");
   		}
   
  @@ -263,6 +263,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.17      +4 -3      ALFS/nALFS/src/handlers/remove.c
  
  Index: remove.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/remove.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- remove.c	8 Feb 2004 05:12:35 -0000	1.16
  +++ remove.c	11 Feb 2004 05:08:12 -0000	1.17
  @@ -81,7 +81,7 @@
   
   		warn_if_doesnt_exist(tok);
   
  -		if ((status = execute_command("rm -fr %s", tok))) {
  +		if ((status = execute_command(el, "rm -fr %s", tok))) {
   			Nprint_h_err("Removing failed.");
   			break;
   		}
  @@ -114,7 +114,7 @@
   
   	Nprint_h("Removing %s.", name);
   
  -	if ((status = execute_command("rm -fr %s", name))) {
  +	if ((status = execute_command(el, "rm -fr %s", name))) {
   		Nprint_h_err("Removing failed.");
   	}
   
  @@ -158,7 +158,7 @@
           
           	Nprint_h("Removing %s.", name);
   
  -        	if ((status = execute_command("rm -fr %s", name))) {
  +        	if ((status = execute_command(el, "rm -fr %s", name))) {
               		Nprint_h_err("Removing failed.");
               		status = -1;
               		break;
  @@ -232,6 +232,7 @@
   		.type = 0,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.15      +2 -1      ALFS/nALFS/src/handlers/search_replace.c
  
  Index: search_replace.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/search_replace.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- search_replace.c	6 Feb 2004 05:54:36 -0000	1.14
  +++ search_replace.c	11 Feb 2004 05:08:12 -0000	1.15
  @@ -159,7 +159,7 @@
   	Nprint_h("Made %d change%s.", num_found,
   		num_found != 1 ? "s" : ""); /* :-) */
   
  -	if (execute_command("mv -f %s %s", tmp_file, file)) {
  +	if (execute_command(el, "mv -f %s %s", tmp_file, file)) {
   		Nprint_h_err("System command for moving %s to %s failed.",
   			tmp_file, file);
   		xfree(find);
  @@ -278,6 +278,7 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.18      +3 -0      ALFS/nALFS/src/handlers/stage.c
  
  Index: stage.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/stage.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- stage.c	11 Feb 2004 03:43:30 -0000	1.17
  +++ stage.c	11 Feb 2004 05:08:12 -0000	1.18
  @@ -533,6 +533,7 @@
   		.type = HTYPE_NORMAL | HTYPE_STAGE,
   		.alloc_data = NULL,
   		.is_action = 0,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -544,6 +545,7 @@
   		.type = HTYPE_TRUE_RESULT | HTYPE_STAGE,
   		.alloc_data = NULL,
   		.is_action = 0,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   	{
  @@ -555,6 +557,7 @@
   		.type = HTYPE_FALSE_RESULT | HTYPE_STAGE,
   		.alloc_data = NULL,
   		.is_action = 0,
  +		.alternate_shell = 1,
   		.priority = 0
   	},
   #endif
  
  
  
  1.16      +2 -1      ALFS/nALFS/src/handlers/textdump.c
  
  Index: textdump.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/textdump.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- textdump.c	6 Feb 2004 05:54:36 -0000	1.15
  +++ textdump.c	11 Feb 2004 05:08:12 -0000	1.16
  @@ -214,7 +214,8 @@
   		.type = HTYPE_TEXTDUMP,
   		.alloc_data = textdump_data,
   		.is_action = 1,
  -		.priority = 0
  +		.priority = 0,
  +		.alternate_shell = 1,
   	},
   #endif
   	{
  
  
  
  1.21      +8 -7      ALFS/nALFS/src/handlers/unpack.c
  
  Index: unpack.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/unpack.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- unpack.c	6 Feb 2004 05:54:36 -0000	1.20
  +++ unpack.c	11 Feb 2004 05:08:12 -0000	1.21
  @@ -71,7 +71,7 @@
   	return base_name;
   }
   
  -static int unpack_archive(const char *archive)
  +static int unpack_archive(element_s *element, const char *archive)
   {
   	char *decompressor = NULL;
   	char *unpacker = NULL;
  @@ -90,7 +90,7 @@
   		}
   		append_str(&command, unpacker);
   		Nprint_h("Unpacking %s...", archive);
  -		status = execute_command(command, archive);
  +		status = execute_command(element, command, archive);
   	} else if (decompressor != NULL) {
   		/* Allocate basename (without the last extension). */
   		char *base_name = alloc_basename(archive);
  @@ -98,7 +98,7 @@
   		Nprint_h("Decompressing %s...", archive);
   		command = xstrdup(decompressor);
   		append_str(&command, " > %s");
  -		status = execute_command(command, archive, base_name);
  +		status = execute_command(element, command, archive, base_name);
   		xfree(base_name);
   	} else {
   		Nprint_h_err("Unknown archive (%s).", archive);
  @@ -149,7 +149,7 @@
   		return -1;
   	}
   
  -	if (unpack_archive(archive)) {
  +	if (unpack_archive(el, archive)) {
   		Nprint_h_err("Unpacking %s failed.", archive);
   	} else {
   		Nprint_h("Done unpacking %s.", archive);
  @@ -232,7 +232,7 @@
   		goto free_all_and_return;
   	}
   
  -	if (unpack_archive(archive)) {
  +	if (unpack_archive(el, archive)) {
   		Nprint_h_err("Unpacking %s failed.", archive);
   	} else {
   		Nprint_h("Done unpacking %s.", archive);
  @@ -324,7 +324,7 @@
   		goto free_all_and_return;
   	}
   
  -	if (unpack_archive(archive)) {
  +	if (unpack_archive(el, archive)) {
   		Nprint_h_err("Unpacking %s failed.", archive);
   	} else {
   		Nprint_h("Done unpacking %s.", archive);
  @@ -397,7 +397,8 @@
   		.type = HTYPE_NORMAL,
   		.alloc_data = NULL,
   		.is_action = 1,
  -		.priority = 0
  +		.priority = 0,
  +		.alternate_shell = 1,
   	},
   #endif
   	{
  
  
  



More information about the alfs-log mailing list