[pacman-dev] [PATCH 4/6] bacman: use globbing in place of regex

Dave Reisner d at falconindy.com
Thu Sep 29 13:46:32 EDT 2011


On Fri, Sep 30, 2011 at 01:14:04AM +0800, lolilolicon wrote:
> The original regex is also not accurate (should be ^[A-Z]+$).
> 
> Signed-off-by: lolilolicon <lolilolicon at gmail.com>
> ---
>  contrib/bacman.in |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/contrib/bacman.in b/contrib/bacman.in
> index d43bf78..c69ab6f 100755
> --- a/contrib/bacman.in
> +++ b/contrib/bacman.in
> @@ -143,7 +143,7 @@ while read i; do
>          continue
>      fi
>  
> -    if [[ "$i" =~ %[A-Z]*% ]] ; then
> +    if [[ "$i" == %+([A-Z])% ]] ; then

nak. This is affected by locale. If we're going to fix it, fix it
correctly and use [[:upper:]]. See fun commits like 541c2470b8ad.

>          current=$i
>          continue
>      fi
> @@ -199,7 +199,7 @@ while read i; do
>          continue;
>      fi
>  
> -    if [[ "$i" =~ %[A-Z]*% ]] ; then
> +    if [[ "$i" == %+([A-Z])% ]] ; then
>          current=$i
>          continue
>      fi
> -- 
> 1.7.6.4
> 
> 


More information about the pacman-dev mailing list