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

Re: Moving bash from essential/required to important?



Goswin von Brederlow <goswin-v-b@web.de> writes:

> Lars Wirzenius <liw@liw.fi> writes:
>
>>       * We can perhaps change debhelper to automatically add the
>>         dependency, if it is missing. Since most packages use debhelper,
>>         this might transition most of the packages automatically.
>
> I've beend thinking about this a while back when I had a package fail
> due to missing Depends for some shell script. So I would even take it a
> step further.
>
> dpkg-shlibsdebs finds all depends needed for dynamic libraries
> automatically.
>
That information is quite neatly and unambigously encoded in the
binaries, making extraction of the information both (relatively) easy
and reliable.  With shell scripts, this is not the case, see below.

> Why not find all depends needed for shell scripts automatically too?
>
> 1) check shebang for the needed shell
>
Seems like a reasonable thing to do.

> 2) parse shell script and extract all executables being called
>
You can't generally do that without executing the shell script, and even
then you'd miss out on stuff that's not invoked due to conditionals.
It's certainly possible to get a subset of executables used by parsing,
but it's bound to be an unreliable heuristic.  Additionally, adding a
shell script parser would probably add quite a bunch of code.  I don't
see the point of doing that when you'd have to check the result anyway,
since the information is unreliable -- and when you need to do that, you
might as well specify the dependencies manually.

> 3) lookup packages for for binaries
> 4) remove essential packages
> 5) set substvar
>
> So if you have a script like
>
> #!/usr/bin/zsh
>
> if [ grep-dctrl foo bar ]; then
>   echo buzz
> fi
>
> you would get a dependency on zsh and dctrl-tools.
>
One more point: you'd have to write a parser to understand zsh syntax to
do that in general.

Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>


Reply to: