hooks: improve shlib-provides detection as suggested by Gottox.