[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: usr/bin/ scripts for console_scripts which lead to binaries-have-file-conflict when python 2 + 3



Jakub Wilk <jwilk@debian.org> writes:

> * Olivier Berger <olivier.berger@telecom-sudparis.eu>, 2013-12-16, 13:24:
>>- add a python-rdflib-tools package that contains shell scripts of the 
>>form :
>>
>>  #!/bin/sh
>>
>>  exec /usr/bin/python -m rdflib.tools.csv2rdf $*
>
> I can't see how that's better than a script with #!/usr/bin/python 
> shebang...
>

Well... it's essentially easier than altering the modules to provide
them with a sheebang, making them executable and shipping
symlinks... whose targets wouldn't be the same in the v2 and v3
package...

>>- make this package depend on python-rdflib | python3-rdflib
>
> /usr/bin/python can't use the modules shipped by python3-rdflib.
>

Ah, thanks for spotting this... I thought it was a bit too easy indeed
;)

Hmmm... Maybe this is better :

  #!/bin/sh
  
  /usr/bin/python3 -c 'import rdflib.tools.csv2rdf' 2>/dev/null
  if [ "$?" = "0" ]
  then
      exec /usr/bin/python3 -m rdflib.tools.csv2rdf $*
  else
      exec /usr/bin/python -m rdflib.tools.csv2rdf $*
  fi

What do you think ?

Best regards,

-- 
Olivier BERGER 
http://www-public.telecom-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8
Ingenieur Recherche - Dept INF
Institut Mines-Telecom, Telecom SudParis, Evry (France)


Reply to: