cvs commit: ALFS/nALFS/src handlers.c

jamie at linuxfromscratch.org jamie at linuxfromscratch.org
Tue Feb 3 12:25:35 PST 2004


jamie       04/02/03 13:25:35

  Modified:    nALFS/src handlers.c
  Log:
  Added function to force a <base> tag to be present.
  
  Revision  Changes    Path
  1.13      +27 -0     ALFS/nALFS/src/handlers.c
  
  Index: handlers.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- handlers.c	3 Nov 2003 21:45:04 -0000	1.12
  +++ handlers.c	3 Feb 2004 20:25:35 -0000	1.13
  @@ -375,6 +375,33 @@
   	return xstrdup("/");
   }
   
  +/* Used by new syntax (3.2) when you _must_ have <base> present */
  +char *alloc_base_dir_force(element_s *el)
  +{
  +	element_s *s;
  +	char *dir = NULL;
  +
  +	if ((dir = attr_value("base", el)) && strlen(dir)) {
  +		return xstrdup(dir);
  +	}
  +
  +	for (s = el->parent; s; s = s->parent) {
  +		if (Is_element_name(s, "stage")) {
  +			element_s *sinfo;
  +
  +			if ((sinfo = first_param("stageinfo", s)) == NULL) {
  +				continue;
  +			}
  +
  +			if ((dir = alloc_trimmed_param_value("base", sinfo))) {
  +				return dir;
  +			}
  +		}
  +	}
  +
  +	return dir;
  +}
  +
   /* Used by the old syntax (2.0). */
   int option_exists(const char *option, element_s *element)
   {
  
  
  



More information about the alfs-log mailing list