Control: severity -1 normal Control: tag -1 + patch Hi,
On Fri, 18 Dec 2015 12:39:00 +0100 Ansgar Burchardt <ans...@debian.org> wrote: > sbuild-update throws an unfriendly error message when called with an > unknown chroot: > > # sbuild-update -ugd unknown > Can't locate object method "throw" via package "Sbuild::Exception::Build" > (perhaps you forgot to load "Sbuild::Exception::Build"?) at > /usr/share/perl5/Sbuild/ChrootInfo.pm line 140. whoops! Thanks for noticing this! The following patch fixes the problem: diff --git a/lib/Sbuild/ChrootInfo.pm b/lib/Sbuild/ChrootInfo.pm index 4b219f4..4c1ee90 100644 --- a/lib/Sbuild/ChrootInfo.pm +++ b/lib/Sbuild/ChrootInfo.pm @@ -104,8 +104,8 @@ sub find { if ($namespace ne 'chroot') { $chroot = $self->find('chroot', $distribution, $chroot, $arch); } else { - Sbuild::Exception::Build->throw(error => "Chroot namespace $namespace not found\n", - failstage => "find-chroot"); + $self->log_error("Chroot namespace $namespace not found\n"); + return undef; } } @@ -137,8 +137,8 @@ sub find { if ($namespace ne 'chroot') { $chroot = $self->find('chroot', $distribution, $chroot, $arch); } else { - Sbuild::Exception::Build->throw(error => "Chroot for distribution $distribution, architecture $arch not found\n", - failstage => "find-chroot"); + $self->log_error("Chroot for distribution $distribution, architecture $arch not found\n"); + return undef; } } diff --git a/lib/Sbuild/Utility.pm b/lib/Sbuild/Utility.pm index 5ebd004..3137bd6 100644 --- a/lib/Sbuild/Utility.pm +++ b/lib/Sbuild/Utility.pm @@ -99,6 +99,11 @@ sub setup ($$$) { undef, # TODO: Add --chroot option $conf->get('BUILD_ARCH')); + if (!defined $session) { + print STDERR "Error creating chroot info\n"; + return undef; + } + $session->set('Log Stream', \*STDOUT); my $chroot_defaults = $session->get('Defaults'); Thanks! cheers, josch
signature.asc
Description: signature