[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a saner bootstrap script
From: |
Stefano Lattarini |
Subject: |
Re: a saner bootstrap script |
Date: |
Mon, 26 Sep 2011 15:39:59 +0200 |
User-agent: |
KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) |
On Monday 26 September 2011, Gary V wrote:
> >>
> > Maybe some code like this should be enough to catch most potential
> > erroneous definitions?
> >
> > case $po_download_command_format in
> > *[^%]%s*[^%]%s*) ;;
> > *) fatal "invalid format in \$po_download_command_format";;
> > esac
>
> That's better than nothing, but catches 2 or more %s specifiers and not
> 'exactly two'.
>
Oops, sorry! *blush*
> This is far from perfect too, but a step closer perhaps?
>
> case `echo $po_download_command_format |sed 's,[^%]*\(%[^%]\),\1,g'` in
> %s%s) ;;
> *) fatal 'invalid format in $po_download_command_format' ;;
> esac
>
> ??
>
Or this, to avoid one fork and possible quotation problems:
case $po_download_command_format in
*[^%]%s*[^%]%s*[^%]%s*) false;;
*[^%]%s*[^%]%s*) : ;;
*) false;;
esac || fatal "invalid format in \$po_download_command_format"
Either way, fine with me.
Thanks,
Stefano
- Re: a saner bootstrap script, (continued)
Re: a saner bootstrap script [Was Re: I fixed this once already], Stefano Lattarini, 2011/09/25
a saner bootstrap script [Was Re: I fixed this once already], Gary V . Vaughan, 2011/09/22