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

Re: CLI recommendations for version-specific /usr/bin scripts



Barry Warsaw <barry@debian.org> writes:

> Some cli's do care though, e.g. nose. In those cases, I think common
> practice seems to be the following:

> […]
>  * Expose /usr/bin/foo with a shebang line of #!/usr/bin/python
>
>  * Expose /usr/bin/foo-3 with a shebang line of #!/usr/bin/python3

In cases where the command name has a “python” prefix (recommended if
the command is something Python-specific, such as a coverage testing
tool for Python) the “python” becomes “python2” and “python3”:

  * ‘/usr/bin/python-foo’ with a shebang of “#! /usr/bin/python”
  * ‘/usr/bin/python2-foo’ with a shebang of “#! /usr/bin/python2”
  * ‘/usr/bin/python3-foo’ with a shebang of “#! /usr/bin/python3”

>  * If the minor version number matters, include a /usr/bin/foo-X.Y with a
>    shebang line /usr/bin/pythonX.Y.

Continuing the above example (a command which has “python” prefix):

  * ‘/usr/bin/pythonX.Y-foo’ with a shebang of “#! /usr/bin/pythonX.Y”
  * ‘/usr/bin/pythonX-foo’ can symlink to ‘pythonX.Y-foo’

>    - Question should /usr/bin/foo-X.Y ever be a symlink to
>    /usr/bin/foo-X?

I can't think of a case where a symlink from specific-name to
general-name would help. The link should be from general-name to the
specific-name which implements that command.

-- 
 \        “When I was crossing the border into Canada, they asked if I |
  `\      had any firearms with me. I said, ‘Well, what do you need?’” |
_o__)                                                   —Steven Wright |
Ben Finney


Reply to: