On Tue, Dec 14, 2010 at 11:18:02AM +0100, Sven Hoexter wrote:
> Hi,
> after a short look I think something like this should help:
> 
> --- preinst.orig        2010-12-14 11:09:41.000000000 +0100
> +++ preinst     2010-12-14 11:10:20.000000000 +0100
> @@ -64,7 +64,7 @@
>                         fi
>  
>                         if test -d /var/www/squid-reports; then
> -                               mv /var/www/squid-reports/* /var/lib/sarg
> +                               test -f /var/www/squid-reports/* && mv 
> /var/www/squid-reports/* /var/lib/sarg                                        
>         
>                                 rmdir /var/www/squid-reports                  
>                                                                               
>  
>                         fi                                                    
>                                                                               
>  
>                 fi 
> 

This solution will fail if /var/www/squid-reports/* ever expands to
more than 1 file; e.g.

  test -f /usr/lib/lib*.so
  bash: test: too many arguments

One simple answer is to just ignore the error:

  mv /var/www/squid-reports/* /var/lib/sarg || true

Any objections to this fix?

-Steve

Attachment: signature.asc
Description: Digital signature

Reply via email to