initial import
[patches.git] / bitpim-search-path-for-helpers.patch
CommitLineData
5e993f12 1Index: src/conversions.py
2===================================================================
3--- src/conversions.py (revision 2853)
4+++ src/conversions.py (working copy)
5@@ -49,7 +49,14 @@
6 f=shortfilename(f)
7 except:
8 # this craps out if the helper does not exist!
9- raise common.HelperBinaryNotFound(basename, basename+osext, [helperdir])
10+ # see if we can't find it in the system path instead ...
11+ try:
12+ for path in os.getenv("PATH", "").split(":"):
13+ f = path+"/"+basename+osext
14+ if os.access(f, os.X_OK) and os.path.isfile(f):
15+ return f
16+ except:
17+ raise common.HelperBinaryNotFound(basename, basename+osext, [helperdir])
18 if not os.path.isfile(f):
19 raise common.HelperBinaryNotFound(basename, basename+osext, [helperdir])
20 return f