From aeab684c948ae194c7b9bb425fba0517d7954bc2 Mon Sep 17 00:00:00 2001 From: Marcelo Leitner Date: Wed, 4 Jul 2007 12:26:24 +0000 Subject: - added some comments. --- lib/Iurt/Chroot.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm index 8509124..82840a1 100644 --- a/lib/Iurt/Chroot.pm +++ b/lib/Iurt/Chroot.pm @@ -375,7 +375,12 @@ sub clean_chroot_tmp { foreach my $m ('proc', 'dev/pts', 'urpmi_medias', 'var/cache/icecream') { if (system("$sudo umount $d/$m &>/dev/null") && $run->{verbose} > 1) { - plog("ERROR: could not umount /$m in $d/"); + plog("ERROR: could not umount /$m in $d/"); + # FIXME: We can't go on, otherelse we will remove something + # that we shouldn't. But for that, we should: + # a) Check for all mount-points inside the chroot + # b) Try to unmount only the needed ones, otherelse the errors + # can be misleading. } } @@ -523,6 +528,7 @@ sub build_chroot { @{$opt->{packages}} ); + # FIXME: A proper warn could be given here, instead of aborting silently. if (-f "$tmp_chroot/bin/rpm") { system($sudo, 'sh', '-c', "chroot $tmp_chroot rpm -qa --qf '\%{NAME}-\%{VERSION}-\%{RELEASE}.\%{ARCH}.rpm\n' > $tmp_chroot/var/log/qa"); # @@ -535,6 +541,7 @@ sub build_chroot { sudo($run, $config, "--mkdir", "$tmp_chroot/home/builder/rpm/$p"); } system($sudo, 'chown', '-R', 499, "$tmp_chroot/home/builder"); + # FIXME: Be careful! Damn ugly hack right below! sudo($run, $config, "--rm", "$tmp_chroot/var/lib/rpm/__db*"); system("$sudo umount $tmp_chroot/proc &> /dev/null"); system("$sudo umount $tmp_chroot/dev/pts &> /dev/null"); -- cgit v1.2.1