convert fail silently if cvsps is not installed

marco gaddoni marco.gaddoni at gmail.com
Sun Oct 28 17:56:02 UTC 2007


On 10/28/07, Steve Borho <steve at borho.org> wrote:
>
> On Sun, 2007-10-28 at 16:23 +0100, marco gaddoni wrote:
> > hello,
> >
> > convert fail silently if cvsps is not installed.
> >
> > i have made a small patch. is it acceptable?
>
> It looks like there's a bug in your find_program().  I'm pretty sure you
> intended to append .exe to program, not p.  Since you're half-way there,
> why not use PATHEXT and look for all Windows executable file extensions
> (*.exe, *.com, *.bat, *.cmd, etc). Something like this:
>
>     for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
>         if os.name == "nt":
>             for ext in os.environ.get('PATHEXT').split(os.pathsep):
>                 exepath = os.path.join(p, name + ext)
>                 if os.access(exepath, os.X_OK):
>                     return exepath
>         else:
>             exepath = os.path.join(p, name)
>             if os.access(exepath, os.X_OK):
>                 return exepath
>     return None
>
> Cheers,
>

hello,

yes you are right.
see the updated patch.
i have copied (adding a bug) that function from
run-tests.py.
shall i update that function too?

ciao, marco.

-- 
"Reality continues to ruin my life." - Calvin.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch2.patch
Type: text/x-patch
Size: 3559 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20071028/2db1ca59/attachment-0002.bin>


More information about the Mercurial-devel mailing list