Onward branch

Mordae mordae at anilinux.org
Sat Sep 20 01:08:06 PDT 2008


On Saturday 20 September 2008 08:33:42 Mordae wrote:
> Ah, I've got an idea. Do you know checkinstall or fakeroot? It's about
> LD_PRELOAD. So, what about creating divert.so, that would intercept any
> file system operation and divert it to another directory if applicable.
> And, of course, make a simple union of the directory contents for `ls` to
> work. Except for link count this would be perfect, just `divert
> /tmp/pkg-x.y make install`.

Oh man, checkinstall people already did it. Newest installwatch can divert 
installation to another directory. And if the script is modified a bit, it 
can even work with fakeroot (LD_PRELOAD=...:$LD_PRELOAD). Observe:

mordae$ tar xf grep-2.5.3.tar.gz
mordae$ cd grep-2.5.3
mordae$ ./configure --prefix=/usr
mordae$ make -j3
mordae$ fakeroot
mordae$ installwatch --root=$PWD --transl=yes --backup=no make install
mordae$ tar czf grep-2.5.3.tgz -C TRANSL .
mordae$ ls *.tgz
grep-2.5.3.tgz
mordae$ exit
mordae$ tar tvf grep-2.5.3.tgz | tail -n 2
-rwxr-xr-x root/root    260309 2008-09-20 09:37 ./usr/bin/egrep
-rwxr-xr-x root/root    152974 2008-09-20 09:37 ./usr/bin/fgrep
mordae$ sudo tar xkf grep-2.5.3.tgz -C /

# This can be wrapped to scripts, so user types:

mordae$ divert -o grep-2.5.3.tgz make install
mordae$ sudo merge -n grep-2.5.3.tgz
...
Not overwriting /usr/bin/egrep
Not overwriting /usr/bin/fgrep

# Or even more:

mordae$ package make install



You will have package database, tarballs to deploy elsewhere and it won't be a 
bother. Merge script can convert root-owned files to bin-owned, but preserve 
device nodes and such.

So, opinions?



More information about the hlfs-dev mailing list