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

Re: Node.js and it's future in debian

* Carl Fürstenberg [2012-04-28 03:31 +0200]
> The the hamradio package "node" shipping a binary called "node", and
> as it's so old, the developers argue that the package must ship
> a binary called "node" or breakage will occur.

Upstream's INSTALL file contains:
| Node is intended to be called from ax25d or inetd. It doesn't need
| any command line arguments but there is one to support incoming
| compressed connects. See the node(8) manual page.

So the breakage is that people would need to update their config files?

* Roger Leigh [2012-04-28 10:41 +0100]:
> From a purely pragmatic POV, how many people are using both packages?

I don't think that the answer is zero, but I also don't think that the
answer is that far away from zero.

node ships /usr/sbin/node and nodejs ships /usr/bin/node, so there is no
file conflict from dpkg's point of view and if only one of both packages
is installed, then things just work.

Only for those cases where users install both packages, a special
solution needs to be found.

hamradio's node only accepts one option, -c, no other arguments.  If
nodejs is invoked with this option it responds with "Error: unrecognized
flag -c" (but still enters its interactive mode).  If nodejs' upstream
agrees to never add this option, it is easy to detect which node is
intended to be run unless node is invoked without any arguments.  If
used in a shebang line, there is always an argument that is not '-c'.

nodesjs evaluates what it reads from stdin; if hamradio's node does not
do anything with stdin (I'm not sure about this), the remaining cases
where it is not clear which node should be run would be when it is
invoked without any arguments and if test -p /dev/stdin is false.

If the few users that install node and nodejs would be asked which one
should be invoked if run without any arguments, both node binaries in
their path could be diverted away and replaced with something similar to
the shell snippet below (yes, I know that alternatives does not really
fit here, that "[ -p /dev/stdin ]" might need to be removed and that
a wrapper written in C might be more robust).

  if [ $# -eq 1 ] && [ "$1" = "-c" ]; then
      exec /usr/sbin/hamnode -c
  elif [ $# -ge 1 ] || [ -p /dev/stdin ]; then
      exec /usr/bin/jsnode "$@"
      exec /etc/alternatives/node

Since nodejs will be installed by way more people and the amount of
questions should IMHO be kept low, I think that this magic should either
be in the package node; or be in both packages in a way that avoids
questions to be asked if only one package of the two packages is


Reply to: