retrying CVS
Jasper Huijsmans
jasper at moongroup.com
Thu May 29 22:11:11 GMT 2003
Ok, I just commited these changes. Yell at me if it breaks anything.
Jasper
On Thu, 29 May 2003 09:30:29 +0200
Jasper Huijsmans <jasper at moongroup.com> wrote:
> Hi all,
>
> The patch below implements the NUM_RETRY setting for CVS downloads. It
> significantly increases the chance of getting a proper update from
> SourceForge repositories ;)
>
> What do you think?
>
> Jasper
>
>
> Index: download.lunar
> ===================================================================
> RCS file: /var/cvs/theedge/var/lib/lunar/functions/download.lunar,v
> retrieving revision 1.14
> diff -u -r1.14 download.lunar
> --- download.lunar 30 Apr 2003 22:46:06 -0000 1.14
> +++ download.lunar 29 May 2003 07:22:41 -0000
> @@ -78,13 +78,26 @@
>
> verbose_msg "CVSROOT=\"$CVSROOT\""
>
> - if [[ -d $CVSMODULE/CVS ]]; then
> - verbose_msg "cvs -qz3 up -PAd $CVSRELEASE $CVSMODULE"
> - cvs -qz3 up -PAd $CVSRELEASE $CVSMODULE && GOT_CVS="yes"
> - elif ! [[ -d CVS ]]; then
> - verbose_msg "cvs -qz3 co $CVSRELEASE $CVSMODULE"
> - cvs -qz3 co $CVSRELEASE $CVSMODULE && GOT_CVS="yes"
> - fi
> + NUM_RETRY=${NUM_RETRY:=5}
> +
> + for (( TRY=1 ; $TRY<$NUM_RETRY+1 ; TRY++ ))
> + do
> + verbose_msg "${MESSAGE_COLOR}Try: ${TRY}${DEFAULT_COLOR}"
> +
> + if [[ -d $CVSMODULE/CVS ]]; then
> + verbose_msg "cvs -qz3 up -PAd $CVSRELEASE $CVSMODULE"
> + cvs -qz3 up -PAd $CVSRELEASE $CVSMODULE && GOT_CVS="yes"
> + elif ! [[ -d CVS ]]; then
> + verbose_msg "cvs -qz3 co $CVSRELEASE $CVSMODULE"
> + cvs -qz3 co $CVSRELEASE $CVSMODULE && GOT_CVS="yes"
> + fi
> +
> + if [[ "$?" == "0" ]]; then
> + break
> + fi
> +
> + sleep 2
> + done
>
> if [[ "$GOT_CVS" == "yes" ]]; then
> message "${MESSAGE_COLOR}Creating
> ${FILE_COLOR}${SOURCE}${DEFAULT_COLOR}"
>
>
> --
> _______________________________________________
> Lunar-dev mailing list
> Lunar-dev at lunar-linux.org
> http://lunar-linux.org/mailman/listinfo/lunar-dev
--
More information about the Lunar-dev
mailing list