Geert Stappers, you have misunderstood my problem. I want to support ALL interpreters available in Debian (Perl, Python, Ruby, Java, etc.)
I need to make supporting all interpreters and all their versions manageable. My question is how to support it all, specifically when a user explicitly specifies a version range. Input: - name of programming language - the range of versions of the programming language - the location of a script in this language Output: - the command line to run the script Note that if several version match, I'd prefer to use the latest matching version. Geert Stappers wrote: > On Sat, Jun 25, 2016 at 02:41:04PM +0300, Victor Porton wrote: >> I have an interpreter name (say "Python") and an interval of versions >> (say "2.5 - 2.6"). >> >> Based on this data I need to select the python executable among installed >> files, if available. > > That "problem" is solved by '#!/usr/bin/env python' > >> The rule of the "game" is that I write a data file (preferably in >> RDF/Turtle format) which describes all available version of Python (and >> other interpreters). > > That seems like the (wrong??) mindset "I have problem, so I add > something". > > >> My question is advice how to do it, in a practical way. >> >> For example, if I understand correctly /usr/bin/python on some systems >> may mean Python 2.x and on some systems Python 3.x. >> >> Is there any "standard" to avoid such multiple meanings of an executable >> located in the same path of the filesystem? In Debian, are there always >> more specific paths like /usr/bin/python2.7 or /usr/bin/python3.1? >> >> Also, does it make sense to parse output of `dpkg -p`? or is it better to >> write RDF config files manually? > > > > I think the original poster needs to elaborate the "problem" > > > Regards > Geert Stappers > > P.S. it is interpreter -- Victor Porton - http://portonvictor.org