Re: on the correct dependency for packages with scripts using /usr/bin/ruby
On 08/05/11 at 21:44 -0700, Antonio Terceiro wrote:
> Hello all,
> I am preparing a package for shoulda-context as part of upgrading shoulda,
> which got split upstream into three packages. I've sent a patch for lintian to
> cope with the fact the Ruby-Versions field we introduced with gem2deb is not
> recognized , but I am still missing one lintian error:
> $ lintian -iI ../ruby-shoulda-context_1.0.0~beta1-1_i386.changes ;
> E: ruby-shoulda-context: ruby-script-but-no-ruby-dep usr/bin/convert_to_should_syntax
> N: Packages with Ruby scripts must depend on the package ruby. Those that
> N: have Ruby scripts that run under a specific version of Ruby need a
> N: dependency on the equivalent version of Ruby.
> N: For example, if a script in the package uses #!/usr/bin/ruby, the
> N: package needs a dependency on "ruby". If a script uses
> N: #!/usr/bin/ruby1.9, then the package need a dependency on "ruby1.9".
> N: In some cases a weaker relationship, such as Suggests or Recommends,
> N: will be more appropriate.
> N: Severity: important, Certainty: certain
> So, lintian wants the package to depend on 'ruby', but it actually depends on
> 'ruby1.8 | ruby-interpreter' because that's what gem2deb generates.
> Is there any good reason for us to not use 'ruby | ruby-interpreter' instead of
> 'ruby1.8 | ruby-interpreter'? Currently 'ruby' means 'Matz Ruby, version 1.8',
> and 'ruby-interpreter' is provided by ruby1.8 and ruby1.9.1, and will probably
> also be provided by other packages in the future.
> This way, when the default Ruby version changes, instead of modifying all
> packages to depend on 'ruby1.9.1 | ruby-interpreter', we will only need to
> change which package 'ruby' depends on.
> If we agree on that, I will submit a patch to lintian so that it checks for
> 'ruby | ruby-interpreter' for scripts using /usr/bin/ruby, instead of just
>  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623390
There are two cases:
- packages that only work with a specific version of Ruby, e.g ruby1.8.
Those must use /usr/bin/ruby1.8 in shebangs, and depend on ruby1.8
- packages that work with any ruby implementation.
Those must use /usr/bin/ruby in shebangs, and depend on
ruby | ruby-interpreter
So yes, you are correct: what gem2deb currently generates is suboptimal
(though not a serious problem right now).