[lug] library naming conventions, sym links

Michael Hirsch mdhirsch at gmail.com
Tue Jul 19 13:42:02 MDT 2005


On 7/17/05, D. Stimits <stimits at comcast.net> wrote:
> Chan Kar Heng wrote:
> > hi all,
> >
> > the only implication i can suggest is that an rpm packager has the
> > responsibility to recreate all sym links with every update & can't be
> > lazy with the way rpm prefers it (the latter way).
> >
> > eg:
> >
> > Existing:
> > libSomeLib.so.0.0.0
> > libSomeLib.so.0.0 -> libSomeLib.so.0.0.0
> > libSomeLib.so.0 -> libSomeLib.0.0
> > libSomeLib.so -> libSomeLib.0
> >
> > Introduction of a patch/minor upgrade:
> > libSomeLib.so.0.0.1
> >
> > Update required:
> > rm libSomeLib.so.0.0
> > ln -s libSomeLib.so.0.0.1 libSomeLib.so.0.0
> >
> > All libSomeLib.so.0.0, libSomeLib.so.0 & libSomeLib.so still refer to
> > the new/latest libSomeLib.
> >
> > if on the otherhand:
> >
> > Existing:
> > libSomeLib.so.0.0.0
> > libSomeLib.so.0.0 -> libSomeLib.so.0.0.0
> > libSomeLib.so.0 -> libSomeLib.so.0.0.0
> > libSomeLib.so -> libSomeLib.so.0.0.0
> >
> > Introduction of a patch/minor upgrade:
> > libSomeLib.so.0.0.1
> >
> > Update required:
> > rm libSomeLib.so.0.0 libSomeLib.so.0 libSomeLib.so
> > ln -s libSomeLib.so.0.0.1 libSomeLib.so.0.0
> > # these are also required, else libSomeLib.so.0 & libSomeLib.so breaks.
> > ln -s libSomeLib.so.0.0.1 libSomeLib.so.0
> > ln -s libSomeLib.so.0.0.1 libSomeLib.so
> >
> > i'd assume rpm assumes packagers aren't lazy & always recreates all
> > symlinks..?
> ...
> 
> This is what I'm talking about. If the sym links are chained, then it is
> not possible for a new install to fail to update all of the links,
> because only 1 link matters. When all links point at the hard file, all
> of them must be updated...failure to do so can break things. It isn't
> possible to update the sym links wrong if you only need to update the
> one link in a chain; updating all links requires trusting the packager
> to know what all of the links are, and to deal with them properly. Those
> version numbers lose all meaning when you just point them all at the
> hard file. Some people will disagree, but add in compatibility libs and
> software that depends on old versions, and things change.

True, but I don't think that rpm is directly resposible for updating
the links--that should be done by ldconfig.  The post-install script
for the RPM is responsible for running ldconfig.  ldconfig is the
command that should know how to (re)create the symbolic links.

Michael



More information about the LUG mailing list