From e853abede711eff32b901caae2c38c725fd68ca4 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 2 Apr 2008 17:48:39 +0000 Subject: send mail to admins when a DKMS module wrongly build for current kernel --- lib/Iurt/DKMS.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Iurt/DKMS.pm') diff --git a/lib/Iurt/DKMS.pm b/lib/Iurt/DKMS.pm index ca3fd78..637aeea 100644 --- a/lib/Iurt/DKMS.pm +++ b/lib/Iurt/DKMS.pm @@ -5,6 +5,7 @@ use base qw(Exporter); use MDV::Distribconf::Build; use Iurt::Chroot qw(clean_chroot add_local_user dump_rpmmacros); use Iurt::Config qw(get_maint get_prefix dump_cache init_cache); +use Iurt::Mail qw(sendmail); use File::NCopy qw(copy); use Iurt::Process qw(sudo); use Iurt::Util qw(plog); @@ -263,6 +264,13 @@ sub dkms_compile { # now need to move dkms build if it wrongly assume a build for the running kernel plog("search module in /var/lib/dkms/$realname/$realversion/$kerver/"); if ($kerver ne $modulesdir && -d "$chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver/") { + require Text::Wrap; + sendmail("Iurt admins <$config->{admin}>", '' , "Iurt failure for $name", + Text::Wrap::wrap("", "", join('', map { "$_\n" } + "Modules for $name have been built for the current kernel ($kerver) while they should have been build for $modulesdir.", + "Please report to the maintainer of $name", + )), + "Iurt the rebuild bot <$config->{admin}>", 0); system("sudo mv $chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver/ $chroot_tmp/var/lib/dkms/$realname/$realversion/$modulesdir/"); } $cache->{dkms}{"$realname-kernel-$modulesdir-$realversion"} = 1; -- cgit v1.2.1