I'm trying to write a script (Perl) for the general public which would need to have a list of all installed TeX files of a certain type, e.g. .sty and/or .cls files or only plainTeX files (.tex), depending on the used options.
I know I can search for specific files using the kpsewhich program, but it seems to have no 'list all' mode (which is understandable). My second idea was to parse all ls-R files which should work, but would be more work.
Is there a way to get all TeX source files or only the ls-R files from kpsewhich or another tool?
At best this should work for both TeX Live and MikTeX on all supported operation systems. However, my main target is TeX Live under Linux. As fall-back solution I would hard code the default paths and allow the user to change these using a configuration file.
tlmgrwhich can list all the installed packages: http://www.tug.org/texlive/doc/tlmgr.html#list____only_installed___collections_schemes_pkg____ Maybe you could utilise its approach. – Harold Cavendish Jul 22 '11 at 17:03find /usr/local/texlive -name "*.sty". – Harold Cavendish Jul 22 '11 at 17:14texluais a standalone lua interpreter. – mbork Jul 22 '11 at 17:28texluawith Lua code from inside a Perl script??? Or are your trying to tell me to not use Perl at all but Lua? – Martin Scharrer Jul 22 '11 at 17:33kpsewhichknowledge is based ontexmf.cnf, onls-Rfiles and on disk scanning for files in trees not specifically marked as "nols-R". It doesn't perform glob searches. – egreg Jul 22 '11 at 20:02