[opensuse-buildservice] build: improve local debian builds
Hi, currently the build script doesn't maintain a "clean" chroot for local debian builds because it never removes unused packages from old builds. So I wrote a small patch which should fix it. The code is similar to the existing rpm implementation except that it is a bit more difficult to get a "unique" id from a package (for rpm the buildtime is used but debian doesn't provide something like that (or at least I didn't find anything:) )). In order to get the id from a *.deb package we do the following: * untar the control.tar.gz * calculate md5 from the sorted control file (using perl's default sort()) * sort all filenames from the control.tar.gz (except the control file) and calculate the md5 for each file * id == md5 of all concatenated md5 sums To get the id from an installed package we do the same (all relevant data is stored in /var/lib/dpkg/status and /var/lib/dpkg/info/*). Feedback, objections etc. are always welcome:) Marcus
On 2010-09-14 01:16:09 +0200, Marcus Hüwe wrote:
currently the build script doesn't maintain a "clean" chroot for local debian builds because it never removes unused packages from old builds. So I wrote a small patch which should fix it. The code is similar to the existing rpm implementation except that it is a bit more difficult to get a "unique" id from a package (for rpm the buildtime is used but debian doesn't provide something like that (or at least I didn't find anything:) )). I just realized that we could also use the mtime of the "md5sums" file (for an installed package we can use /var/lib/dpkg/info/<pkg>.md5sums) as a buildtime indicator. If we use this approach it would really simplify the code - the only "problem" is that this check will fail if a package has no files (so an already installed package might be installed again).
Any opinions?:) Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2010-09-14 11:25:39 +0200, Marcus Hüwe wrote:
On 2010-09-14 01:16:09 +0200, Marcus Hüwe wrote:
currently the build script doesn't maintain a "clean" chroot for local debian builds because it never removes unused packages from old builds. So I wrote a small patch which should fix it. The code is similar to the existing rpm implementation except that it is a bit more difficult to get a "unique" id from a package (for rpm the buildtime is used but debian doesn't provide something like that (or at least I didn't find anything:) )). I just realized that we could also use the mtime of the "md5sums" file (for an installed package we can use /var/lib/dpkg/info/<pkg>.md5sums) as a buildtime indicator. If we use this approach it would really simplify the code - the only "problem" is that this check will fail if a package has no files (so an already installed package might be installed again).
I just implemented this approach but it doesn't seem to be "practible" because there's quite a number of packages which don't ship a "md5sums" file (in my test chroot 28 out of 127 packages were reinstalled due to the missing md5sums file (but I don't know if these numbers are representable)). So if we want to do it "correctly" we probably need to do something like my first patch does (I know it's ugly but it works:) ). Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (1)
-
Marcus Hüwe