Friday, June 27, 2008

portage-2.2 preserve-libs FEATURES explained

Maybe I am not the right person to write about it. But I felt the necessity to write about it. So I will just write something about preserve-libs, leaving other FEATURES to more competent people.

Portage-2.2 has already entered unstable tree. Many people has started using it. It has many new features, like preserve-libs, sets, license filter and so on. Please check README and RELEASE-NOTES for a complete list. I will only talk about preserve-libs.

To understand why we need it, we have to know some background information.
First of all, applications are not built from scratch. Any non trivial apps use lot of libraries.
In GNU/Linux, most of them are shared libraries, i.e. .so files.
You can use `ldd /usr/bin/mplayer` to check what shared libraries an app has been linked to, replace mplayer to whatever program you'd like to check.
Shared libraries have versions.
E.g. /usr/lib/, here 51 denotes its version.
After upgrading, the version number may change.
E.g. /usr/lib/

Previously in Gentoo Linux, after upgrading, old version of so file will be deleted.
As a consequence, all the apps which have previously been linked to the old so file will cease to work.
The most well known case may be "XML::Parser perl module not found".
At that time, to solve this problem, you would have to use revdep-rebuild to rebuild all such apps.
Before they are rebuilt, you can't use them.
I myself have experienced this a lot, especially on mplayer.
Sometimes, a soccer match is about to kick off, suddenly I found my mplayer not working because of a missing old so file.

Now, the nightmare is all over.
With preserve-libs, your apps will continue to work, because old so files are preserved.
And they will not stay on your hard disk forever.
After `emerge @preserved-rebuild` they will be all gone and your apps will be linked to the new version of so file.

Such a wonderful world~~~

The following is from the output of a recent system upgrade:
!!! existing preserved libs:
>>> package: sys-libs/glibc-2.8_p20080602
* - /lib/
>>> package: www-client/mozilla-firefox-3.0-r1
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
* - /usr/lib/mozilla-firefox/
>>> package: sys-devel/libtool-2.2.4
* - /usr/lib/
* - /usr/lib/
>>> package: media-video/ffmpeg-0.4.9_p20080326
* - /usr/lib/
* - /usr/lib/
Use emerge @preserved-rebuild to rebuild packages using these libraries

Now I have both old and new versions of
$ ls /usr/lib/*
/usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/

And my mplayer is still working.

Labels: ,

Friday, June 06, 2008

Some updates (docs, loongson, as-needed)

1. Documentation get updates regularly as usual.;a=summary

2. Our table now can distinguish between file owner and file last updater when the file in question need to be updated. If the last updater is the owner, there will be an email link on the name; otherwise, there will be no link, but the name will be in red. The name is in the last column.

3. I will get my loongson 2f box soon, :-D

4. Just fixed an as-needed problem:

Labels: , ,