Yet another LPM

Jan Dvořák mordae at
Thu Mar 29 03:47:05 PDT 2007


	one of bullets on Robert's TODO list was:

 > It'd be nice to catalog new files as each package is installed, with
 > a find(1) script or something similar, and maybe toss in md5sum too.
 > So if two packages install the same file we know about it.. so we know
 > whether /usr/share/man/man1/su.1 is from Coreutils, Util-linux,
 > Shadow, or something else. It'd also be usefull for tripwire-like
 > setups, and a foundation for package management (automated or
 > otherwise).

	IF it is acceptable, that the main dependencies are UnionFS and FUSE, 
then may help. It is somewhat similar to 
Slackware's package management. The script `lpmb' uses tiny FUSE wrapper 
`monofs' to make whole system look like one file system (no need to care 
about /usr not being in place anymore) and then overlays the view 
(real-only) with UnionFS, creates temporary work directory in /tmp 
(after `mount --bind /tmp` for speedup) and chroots into overlay.

	Once exited chroot successfully, overlay is umounted as well as monofs 
and snapshot is moved into given location (tarball in the example below).

	Idealized example:

~# lpmb ed-0.2-1.tar.bz2
/tmp/tmp.X/work# tar xvf /usr/src/ed/ed-0.2.tar.bz2
/tmp/tmp.X/work# cd ed-0.2
/tmp/tmp.X/work/ed-0.2# patch -Np1 -i /usr/src/ed/ed-0.2-dirent-1.patch
/tmp/tmp.X/work/ed-0.2# ./configure --prefix=/usr && make all install

~# ls ed-*

~# lpm -i ed-0.2-1.tar.bz2
Files backed up:
	/usr/share/man/man1/ed.1 (1)

~# lpm -q /usr/share/man/man1/ed.1

~# mv /usr/share/man/man1/{.__lpm_1.,}ed.1

~# lpm --force --remove ed-0.2-1
Packages removed...
~# ls /usr/share/man/man1/ed.1
~# lpm -q /usr/share/man/man1/ed.1

	And so on... Just download newest tarball and try it out.

More information about the hlfs-dev mailing list