let filter 'which' find a command in a specified subdir of PATH elements
This commit is contained in:
parent
f72bf802f3
commit
a02a611694
@ -226,6 +226,14 @@ class RclExecM:
|
|||||||
|
|
||||||
|
|
||||||
# Helper routine to test for program accessibility
|
# Helper routine to test for program accessibility
|
||||||
|
# Note that this works a bit differently from Linux 'which', which
|
||||||
|
# won't search the PATH if there is a path part in the program name,
|
||||||
|
# even if not absolute (e.g. will just try subdir/cmd in current
|
||||||
|
# dir). We will find such a command if it exists in a matching subpath
|
||||||
|
# of any PATH element.
|
||||||
|
# This is very useful esp. on Windows so that we can have several bin
|
||||||
|
# filter directories under filters (to avoid dll clashes). The
|
||||||
|
# corresponding c++ routine in recoll execcmd works the same.
|
||||||
def which(program):
|
def which(program):
|
||||||
def is_exe(fpath):
|
def is_exe(fpath):
|
||||||
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
|
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
|
||||||
@ -242,9 +250,8 @@ def which(program):
|
|||||||
yield path
|
yield path
|
||||||
for path in os.environ["PATH"].split(os.pathsep):
|
for path in os.environ["PATH"].split(os.pathsep):
|
||||||
yield path
|
yield path
|
||||||
|
|
||||||
fpath, fname = os.path.split(program)
|
if os.path.isabs(program):
|
||||||
if fpath:
|
|
||||||
if is_exe(program):
|
if is_exe(program):
|
||||||
return program
|
return program
|
||||||
else:
|
else:
|
||||||
@ -296,7 +303,9 @@ def main(proto, extract):
|
|||||||
# Not running the main loop: either acting as single filter (when called
|
# Not running the main loop: either acting as single filter (when called
|
||||||
# from other filter for example), or debugging
|
# from other filter for example), or debugging
|
||||||
def usage():
|
def usage():
|
||||||
print("Usage: rclexecm.py [-d] [-s] [-i ipath] [filename]",
|
print("Usage: rclexecm.py [-d] [-s] [-i ipath] <filename>",
|
||||||
|
file=sys.stderr)
|
||||||
|
print(" rclexecm.py -w <prog>",
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@ -305,7 +314,7 @@ def main(proto, extract):
|
|||||||
ipath = ""
|
ipath = ""
|
||||||
|
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
opts, args = getopt.getopt(args, "hdsi:")
|
opts, args = getopt.getopt(args, "hdsi:w:")
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if opt in ['-h']:
|
if opt in ['-h']:
|
||||||
usage()
|
usage()
|
||||||
@ -313,6 +322,13 @@ def main(proto, extract):
|
|||||||
actAsSingle = True
|
actAsSingle = True
|
||||||
elif opt in ['-i']:
|
elif opt in ['-i']:
|
||||||
ipath = arg
|
ipath = arg
|
||||||
|
elif opt in ['-w']:
|
||||||
|
ret = which(arg)
|
||||||
|
if ret:
|
||||||
|
print("%s" % ret)
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
sys.exit(1)
|
||||||
elif opt in ['-d']:
|
elif opt in ['-d']:
|
||||||
debugDumpData = True
|
debugDumpData = True
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -15,6 +15,12 @@ In the following, a number of commands will use a command window with an
|
|||||||
MinGW environment. This can be easily created by executing
|
MinGW environment. This can be easily created by executing
|
||||||
C:\MinGW\msys\1.0\msys.bat from File Explorer.
|
C:\MinGW\msys\1.0\msys.bat from File Explorer.
|
||||||
|
|
||||||
|
Note: you should take care to use the gcc compiler which comes with Qt for
|
||||||
|
all the following builds. For this, you will want to execute the following
|
||||||
|
command in the command window:
|
||||||
|
|
||||||
|
export PATH=c:/qt/tools/mingw492_32/bin:$PATH
|
||||||
|
|
||||||
== Tortoise HG
|
== Tortoise HG
|
||||||
|
|
||||||
This is needed because there is no source package for recoll or its
|
This is needed because there is no source package for recoll or its
|
||||||
@ -30,15 +36,26 @@ dependancies] to C:/recolldeps
|
|||||||
You can change the target names, but there will be more script editing
|
You can change the target names, but there will be more script editing
|
||||||
later on then (nothing much).
|
later on then (nothing much).
|
||||||
|
|
||||||
|
== Qt
|
||||||
|
|
||||||
|
Download and install Qt 5.5.x (mingw version) from: http://www.qt.io/download/
|
||||||
|
|
||||||
|
Note: it is not possible to build a static webkit, so the installation is
|
||||||
|
necessarily dynamic, which means that the Qt DLLS will need to be copied
|
||||||
|
into the installation directory. This is done by the installation-building
|
||||||
|
script (using `windeployqt`)
|
||||||
|
|
||||||
|
|
||||||
== zlib
|
== zlib
|
||||||
|
|
||||||
Download from http://zlib.net/zlib-1.2.8.tar.gz
|
Download from http://zlib.net/zlib-1.2.8.tar.gz
|
||||||
Then, from an MSYS command window (see above):
|
Then, from an MSYS command window (see above):
|
||||||
|
|
||||||
cd c:/temp
|
cd c:/temp
|
||||||
|
export PATH=c:/qt/tools/mingw492_32/bin:$PATH
|
||||||
tar xzf path-to-tar-file
|
tar xzf path-to-tar-file
|
||||||
cd zlib-1.2.8
|
cd zlib-1.2.8
|
||||||
make -f Win32/Makefile.gcc
|
make -f win32/Makefile.gcc
|
||||||
|
|
||||||
== Xapian
|
== Xapian
|
||||||
|
|
||||||
@ -56,18 +73,10 @@ http://oligarchy.co.uk/xapian/1.2.21/xapian-core-1.2.21.tar.xz
|
|||||||
|
|
||||||
Then:
|
Then:
|
||||||
|
|
||||||
|
export PATH=c:/qt/tools/mingw492_32/bin:$PATH
|
||||||
CPPFLAGS=-IC:/temp/zlib-1.2.8 LDFLAGS=-Lc:/temp/zlib-1.2.8 ./configure
|
CPPFLAGS=-IC:/temp/zlib-1.2.8 LDFLAGS=-Lc:/temp/zlib-1.2.8 ./configure
|
||||||
make
|
make
|
||||||
|
|
||||||
== Qt
|
|
||||||
|
|
||||||
Download and install Qt 5.5.x (mingw version) from: http://www.qt.io/download/
|
|
||||||
|
|
||||||
Note: it is not possible to build a static webkit, so the installation is
|
|
||||||
necessarily dynamic, which means that the Qt DLLS will need to be copied
|
|
||||||
into the installation directory. This is done by the installation-building
|
|
||||||
script (using `windeployqt`)
|
|
||||||
|
|
||||||
== Recoll
|
== Recoll
|
||||||
|
|
||||||
You need to use the source from the repository, there is no release
|
You need to use the source from the repository, there is no release
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user