cvs commit: ALFS/nALFS/src/handlers alfs.c stage.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Tue Feb 24 20:07:01 PST 2004


kpfleming    04/02/24 21:07:01

  Modified:    nALFS/src/handlers alfs.c stage.c
  Log:
  additional semantic error checking
  
  Revision  Changes    Path
  1.19      +4 -0      ALFS/nALFS/src/handlers/alfs.c
  
  Index: alfs.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/alfs.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- alfs.c	24 Feb 2004 06:34:54 -0000	1.18
  +++ alfs.c	25 Feb 2004 04:07:01 -0000	1.19
  @@ -78,6 +78,10 @@
   
   	switch (attr->private) {
   	case ALFS_VERSION:
  +		if (data->version) {
  +			Nprint_err("<alfs>: cannot specify \"version\" more than once.");
  +			return 1;
  +		}
   		data->version = xstrdup(value);
   		return 0;
   	default:
  
  
  
  1.28      +28 -0     ALFS/nALFS/src/handlers/stage.c
  
  Index: stage.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/stage.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- stage.c	24 Feb 2004 06:34:54 -0000	1.27
  +++ stage.c	25 Feb 2004 04:07:01 -0000	1.28
  @@ -323,6 +323,10 @@
   
   	switch (attr->private) {
   	case STAGE_NAME:
  +		if (data->name) {
  +			Nprint_err("<stage>: cannot specify \"name\" more than once.");
  +			return 1;
  +		}
   		data->name = xstrdup(value);
   		return 0;
   	default:
  @@ -510,15 +514,31 @@
   
   	switch (param->private) {
   	case STAGEINFO_BASE:
  +		if (data->base) {
  +			Nprint_err("<stageinfo>: cannot specify <base> more than once.");
  +			return 1;
  +		}
   		data->base = xstrdup(value);
   		return 0;
   	case STAGEINFO_USER:
  +		if (data->user) {
  +			Nprint_err("<stageinfo>: cannot specify <user> more than once.");
  +			return 1;
  +		}
   		data->user = xstrdup(value);
   		return 0;
   	case STAGEINFO_ROOT:
  +		if (data->root) {
  +			Nprint_err("<stageinfo>: cannot specify <root> more than once.");
  +			return 1;
  +		}
   		data->root = xstrdup(value);
   		return 0;
   	case STAGEINFO_SHELL:
  +		if (data->shell) {
  +			Nprint_err("<stageinfo>: cannot specify <shell> more than once.");
  +			return 1;
  +		}
   		data->shell = xstrdup(value);
   		return 0;
   	default:
  @@ -665,9 +685,17 @@
   
   	switch (attr->private) {
   	case VARIABLE_NAME:
  +		if (data->name) {
  +			Nprint_err("<variable>: cannot specify \"name\" more than once.");
  +			return 1;
  +		}
   		data->name = xstrdup(value);
   		return 0;
   	case VARIABLE_MODE:
  +		if (data->mode != VAR_SET) {
  +			Nprint_err("<variable>: cannot specify \"mode\" more than once.");
  +			return 1;
  +		}
   		if (strcmp(value, "append") == 0) {
   			data->mode = VAR_APPEND;
   			return 0;
  
  
  



More information about the alfs-log mailing list