[arch-general] [arch-dev-public] [PATCH 4/4] ftpdir-cleanup: lock repo before doing the cleanup

Evangelos Foutras foutrelis at gmail.com
Wed Feb 24 20:52:25 EST 2010


On Thu, Feb 25, 2010 at 3:36 AM, Eric Bélanger <snowmaniscool at gmail.com> wrote:
<snip>
>  for arch in ${ARCHES[@]}; do
>
> +  IS_LOCKED=0
> +  count=0
> +  while [ $count -le $LOCK_TRIAL ]; do
> +    if repo_lock $reponame $arch ; then
> +      IS_LOCKED=1
> +      let count=$LOCK_TRIAL+1
> +      continue

I'd just use a 'break' here, instead of making the conditional
expression false and jumping to the check again.

> +    fi
> +    sleep $LOCK_DELAY
> +    let count=$count+1
> +  done
> +
> +  if [ $IS_LOCKED -eq 0 ]; then
<snip>

Thanks for creating this patch. :)


More information about the arch-general mailing list