On 2/27/06, Giacomo A. Catenazzi <[EMAIL PROTECTED]> wrote:
> > I was refering to this:
> >
> >> give in my debian machine:
> >> do_wget()
> >>  { wget -t3 -nv -O $2 $1
> >>  [ ! -z sleep is /bin/sleep ] && sleep ""
> >> return $?
> >
> > the 'sleep ""' should be "sleep SOMETHING-NUMERIC"
> >
> > or was this the consequence of running from the console?
>
> I think you should introduce the test only if fetch script
> should wait. And in this case we have already a numeric argument.
>

Done, but i am not sure if the generated code is the correct one. (I
just made the modifications and I can't test them.)

Could you, please, test that the generated code is correct?

I prefered to use 'true' when the sleep command should not be ran
because this would allow us to safely write lines like:

command_A || ${SLEEPCMD} || command_B



[ After an idea poped in my head ]

Hmm, I realised that I should isolate the commands (success format):
SLEEPCMD='[ ! -z "\`type sleep\`" ] && sleep "${SLEEPTIME}"'
should be somethig like:
SLEEPCMD='( [ ! -z "\`type sleep\`" ] && sleep "${SLEEPTIME}")'

because the command above would expand to:
command_A || [ ! -z "\`type sleep\`" ] && sleep "${SLEEPTIME}" || command_B

which changes the meaning of the last part of the command.... (but
that is a corner case and we don't use it currently anywhere in this
form).

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

Attachment: apt-zip-0.13.6.sleep_fix.diff
Description: Binary data

Reply via email to