[buildd-tools-devel] [PATCH] Remove double if statements in Sbuild/Build.pm

Max Thoursie max at spotify.com
Wed Jan 25 10:00:57 UTC 2012


I'm gussing this was some kind of silly cut'n'paste error.
---
 lib/Sbuild/Build.pm |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 88e3c9e..8209389 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -575,25 +575,21 @@ sub run_chroot_update {
     # Upgrade using APT.
     $self->check_abort();
     if ($self->get_conf('APT_DISTUPGRADE')) {
-	if ($self->get_conf('APT_DISTUPGRADE')) {
-	    if ($resolver->distupgrade()) {
-		# Since apt-distupgrade was requested specifically, fail on
-		# error when not in buildd mode.
-		if ($self->get_conf('SBUILD_MODE') ne 'buildd') {
-		    Sbuild::Exception::Build->throw(error => "apt-get dist-upgrade failed",
-						    failstage => "apt-get-dist-upgrade");
-		}
+	if ($resolver->distupgrade()) {
+	    # Since apt-distupgrade was requested specifically, fail on
+	    # error when not in buildd mode.
+	    if ($self->get_conf('SBUILD_MODE') ne 'buildd') {
+		Sbuild::Exception::Build->throw(error => "apt-get dist-upgrade failed",
+						failstage => "apt-get-dist-upgrade");
 	    }
 	}
     } elsif ($self->get_conf('APT_UPGRADE')) {
-	if ($self->get_conf('APT_UPGRADE')) {
-	    if ($resolver->upgrade()) {
-		# Since apt-upgrade was requested specifically, fail on
-		# error when not in buildd mode.
-		if ($self->get_conf('SBUILD_MODE') ne 'buildd') {
-		    Sbuild::Exception::Build->throw(error => "apt-get upgrade failed",
-						    failstage => "apt-get-upgrade");
-		}
+	if ($resolver->upgrade()) {
+	    # Since apt-upgrade was requested specifically, fail on
+	    # error when not in buildd mode.
+	    if ($self->get_conf('SBUILD_MODE') ne 'buildd') {
+		Sbuild::Exception::Build->throw(error => "apt-get upgrade failed",
+						failstage => "apt-get-upgrade");
 	    }
 	}
     }
-- 
1.7.5.4




More information about the Buildd-tools-devel mailing list