cvs commit: ALFS/nALFS/src/handlers download.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Mon Mar 1 20:09:00 PST 2004


kpfleming    04/03/01 21:09:00

  Modified:    nALFS/src/handlers download.c
  Log:
  cleanups
  remove change_to_base_dir from download_common (it was a duplicate)
  
  Revision  Changes    Path
  1.24      +19 -22    ALFS/nALFS/src/handlers/download.c
  
  Index: download.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/download.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- download.c	29 Feb 2004 03:30:00 -0000	1.23
  +++ download.c	2 Mar 2004 04:09:00 -0000	1.24
  @@ -96,25 +96,6 @@
   	xfree(data);
   }
   
  -static int download_attribute(const element_s * const element,
  -			      const struct handler_attribute * const attr,
  -			      const char * const value)
  -{
  -	struct download_data *data = (struct download_data *) element->handler_data;
  -
  -	switch (attr->private) {
  -	case DOWNLOAD_BASE:
  -		if (data->base) {
  -			Nprint_err("<download>: cannot specify \"base\" more than once.");
  -			return 1;
  -		}
  -		data->base = xstrdup(value);
  -		return 0;
  -	default:
  -		return 1;
  -	}
  -}
  -
   static int download_parameter(const element_s * const element,
   			      const struct handler_parameter * const param,
   			      const char * const value)
  @@ -192,9 +173,6 @@
   	struct stat file_stat;
   	char *digest, *digest_type;
   
  -	if (change_current_dir(data->destination))
  -		return -1;
  -
   	if (data->digest) {
   		digest = data->digest->handler->alloc_data(data->digest, HDATA_COMMAND);
   		digest_type = data->digest->handler->alloc_data(data->digest, HDATA_VERSION);
  @@ -273,6 +251,25 @@
   	{ .name = "base", .private = DOWNLOAD_BASE },
   	{ .name = NULL }
   };
  +
  +static int download_attribute(const element_s * const element,
  +			      const struct handler_attribute * const attr,
  +			      const char * const value)
  +{
  +	struct download_data *data = (struct download_data *) element->handler_data;
  +
  +	switch (attr->private) {
  +	case DOWNLOAD_BASE:
  +		if (data->base) {
  +			Nprint_err("<download>: cannot specify \"base\" more than once.");
  +			return 1;
  +		}
  +		data->base = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
  +	}
  +}
   
   static int download_valid_data_v3_2(const element_s * const element)
   {
  
  
  



More information about the alfs-log mailing list