[gobolinux-users] Suggestion: Dependency checker

Hisham Muhammad hisham.hm at gmail.com
Wed Nov 15 03:16:31 UTC 2006

On 11/15/06, Martin Baldan <martinobal at gmail.com> wrote:
> Hi, guys.
> I've been asking about this in #gobolinux and they told me it would be ok to
> send a request for a feature here, so there I go.
> Wouldnt it be nice to have a recursive dependency checker, so that when you
> want to remove a program, you can ask it and it tells you:

We already have this, except that it's not recursive.

Dependencies --reverse qt
Dependencies --reverse glib

> Notice that it wouldn't list the libraries no program is using any more
> (Lucas told me that sometimes the user himself wants to use the libraries),
> only those libraries and ultimately programs that are linked to what you
> want to remove, by a chain of dependecies.
> What do you think? Desirable? How easy/difficult to do? Are you already
> working on this?

I think it would be nice to have it recursive. The Dependencies script
is being phased out (it has been replaced in main purpose by the new,
smarter, CheckDependencies) but it is being still kept around because
of these little "extra features" it has.

If you look at the relevant code, it's really simple shell:

   for f in "${goboPrograms}"/*/*/Resources/Dependencies
      echo "$f" | grep -q "/Current/" && continue
      if [ "$2" ]
      then grep -qi "^$package $version" "$f"
      else grep -qi "^$package " "$f"
      if [ $? -eq 0 ]
      then echo `Which_Package "$f"` `Which_Version "$f"`

(Which_Package and Which_Version are just utility functions for
extracting the relevant tokens from a path.) I think that's the last
useful feature in the Dependencies script that hasn't been superseded
in other scripts. Indeed, if a nice recursive version of reverse
dependency check was implemented, we could send good ol' Deps to enjoy
retirement in some sunny resort. :)

-- Hisham

More information about the gobolinux-users mailing list