cvs commit: ALFS/nALFS/src/handlers configure.c link.c setenv.c textdump.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Mon Mar 8 09:21:43 PST 2004


kpfleming    04/03/08 10:21:43

  Modified:    nALFS/src/handlers configure.c link.c setenv.c textdump.c
  Log:
  restore "command" support to <configure> (it was removed when it should not have been)
  specify enum values for <link> parameters and attributes
  correct "mode" handling for <setenv> and <textdump>
  
  Revision  Changes    Path
  1.21      +27 -3     ALFS/nALFS/src/handlers/configure.c
  
  Index: configure.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/configure.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- configure.c	3 Mar 2004 03:57:05 -0000	1.20
  +++ configure.c	8 Mar 2004 17:21:43 -0000	1.21
  @@ -48,6 +48,7 @@
   	CONFIGURE_BASE,
   	CONFIGURE_PARAM,
   	CONFIGURE_PREFIX,
  +	CONFIGURE_COMMAND,
   };
   
   struct configure_data {
  @@ -56,6 +57,7 @@
   	int param_seen;
   	char *prefix;
   	int prefix_seen;
  +	char *command;
   };
   
   static int configure_setup(element_s * const element)
  @@ -70,6 +72,7 @@
   	data->prefix = xstrdup("");
   	data->prefix_seen = 0;
   	data->base = NULL;
  +	data->command = NULL;
   	element->handler_data = data;
   
   	return 0;
  @@ -82,6 +85,7 @@
   	xfree(data->base);
   	xfree(data->prefix);
   	xfree(data->param);
  +	xfree(data->command);
   	xfree(data);
   }
   
  @@ -99,6 +103,13 @@
   		}
   		data->base = xstrdup(value);
   		return 0;
  +	case CONFIGURE_COMMAND:
  +		if (data->command) {
  +			Nprint_err("<%s>: cannot specify \"command\" more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->command = xstrdup(value);
  +		return 0;
   	default:
   		return 1;
   	}
  @@ -128,6 +139,13 @@
   		append_str(&data->param, " ");
   		data->param_seen = 1;
   		return 0;
  +	case CONFIGURE_COMMAND:
  +		if (data->command) {
  +			Nprint_err("<%s>: cannot specify <command> more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->command = xstrdup(value);
  +		return 0;
   	default:
   		return 1;
   	}
  @@ -138,6 +156,7 @@
   static const struct handler_parameter configure_parameters_v2[] = {
   	{ .name = "base", .private = CONFIGURE_BASE },
   	{ .name = "param", .private = CONFIGURE_PARAM },
  +	{ .name = "command", .private = CONFIGURE_COMMAND },
   	{ .name = NULL }
   };
   
  @@ -153,6 +172,7 @@
   
   static const struct handler_attribute configure_attributes_v3[] = {
   	{ .name = "base", .private = CONFIGURE_BASE },
  +	{ .name = "command", .private = CONFIGURE_COMMAND },
   	{ .name = NULL }
   };
   
  @@ -167,9 +187,13 @@
   		return -1;
   	
   	Nprint_h("Executing system command");
  -	Nprint_h("    %s configure %s", data->prefix, data->param);
  -
  -	status = execute_command(element, "%s configure %s", data->prefix, data->param);
  +	Nprint_h("    %s %s %s", data->prefix,
  +		 (data->command) ? data->command : "configure",
  +		 data->param);
  +
  +	status = execute_command(element, "%s %s %s", data->prefix,
  +				 (data->command) ? data->command : "configure",
  +				 data->param);
   
   	return status;
   }
  
  
  
  1.21      +5 -5      ALFS/nALFS/src/handlers/link.c
  
  Index: link.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/link.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- link.c	3 Mar 2004 04:54:03 -0000	1.20
  +++ link.c	8 Mar 2004 17:21:43 -0000	1.21
  @@ -243,15 +243,15 @@
   #if HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2
   
   static const struct handler_parameter link_parameters_v3[] = {
  -	{ .name = "option" },
  -	{ .name = "target" },
  -	{ .name = "name" },
  +	{ .name = "option", .private = LINK_OPTION },
  +	{ .name = "target", .private = LINK_TARGET },
  +	{ .name = "name", .private = LINK_NAME },
   	{ .name = NULL }
   };
   
   static const struct handler_attribute link_attributes_v3[] = {
  -	{ .name = "type" },
  -	{ .name = "base" },
  +	{ .name = "type", .private = LINK_TYPE },
  +	{ .name = "base", .private = LINK_BASE },
   	{ .name = NULL }
   };
   
  
  
  
  1.19      +2 -2      ALFS/nALFS/src/handlers/setenv.c
  
  Index: setenv.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/setenv.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- setenv.c	2 Mar 2004 05:33:12 -0000	1.18
  +++ setenv.c	8 Mar 2004 17:21:43 -0000	1.19
  @@ -94,8 +94,8 @@
   
   	switch (attr->private) {
   	case SETENV_MODE:
  -		if (!strcmp(value, "append")) {
  -			Nprint_err("<%s>: the only \"mode\" allowed is \"append\".", element->handler->name);
  +		if (strcmp(value, "append")) {
  +			Nprint_err("<%s>: the only \"mode\" allowed is \"append\". (%s)", element->handler->name, value);
   			return 1;
   		}
   		data->append_mode = 1;
  
  
  
  1.24      +2 -2      ALFS/nALFS/src/handlers/textdump.c
  
  Index: textdump.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/textdump.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- textdump.c	2 Mar 2004 06:54:11 -0000	1.23
  +++ textdump.c	8 Mar 2004 17:21:43 -0000	1.24
  @@ -127,8 +127,8 @@
   		data->base = xstrdup(value);
   		return 0;
   	case TEXTDUMP_MODE:
  -		if (!strcmp(value, "append")) {
  -			Nprint_err("<%s>: the only \"mode\" allowed is \"append\".", element->handler->name);
  +		if (strcmp(value, "append")) {
  +			Nprint_err("<%s>: the only \"mode\" allowed is \"append\" (%s).", element->handler->name, value);
   			return 1;
   		}
   		data->append_mode = 1;
  
  
  



More information about the alfs-log mailing list