[coreboot] lar directory handling

Peter Stuge peter at stuge.se
Sat Feb 23 13:30:49 CET 2008


On Fri, Feb 22, 2008 at 02:18:36PM -0700, Myles Watson wrote:
> This is a simple patch which corrects directory handling for add
> (makes it the same as create.)
> 
> Without this patch you can create a lar and recursively add a
> directory to it, but you can't add one with add.
> 
> Another patch might be to make lar -l print something when you use the
> directory option, but I'm not sure what was intended originally.
> 
> Myles
> 
> Signed-off-by: Myles Watson <mylesgw at gmail.com>

Acked-by: Peter Stuge <peter at stuge.se>


> Index: util/lar/lar.c
> ===================================================================
> --- util/lar/lar.c	(revision 616)
> +++ util/lar/lar.c	(working copy)
> @@ -370,13 +370,13 @@
>  		exit(1);
>  	}
>  
> -	/* when a new archive is created, recurse over
> -	 * physical files when a directory is found.
> +	/* when a new archive is created or added to, recurse over
> +	 * the physical files when a directory is found.
>  	 * Otherwise just add the directory to the match list
>  	 */
>  
>  	while (optind < argc) {
> -		if (larmode == CREATE) {
> +		if (larmode == CREATE || larmode == ADD) {
>  			add_files(argv[optind++]);
>  		} else
>  			add_file_or_directory(argv[optind++]);
> Index: util/lar/lib.c
> ===================================================================
> --- util/lar/lib.c	(revision 616)
> +++ util/lar/lib.c	(working copy)
> @@ -223,7 +223,7 @@
>  
>  /*
>   * Add physically existing files to the file list. 
> - * This function is used when an archive is created.
> + * This function is used when an archive is created or added to.
>   */
>  
>  int add_files(const char *name)




More information about the coreboot mailing list