diff --git a/templates/etc/pbuilder/debian.erb b/templates/etc/pbuilder/debian.erb
index 60e2f7d36723c9d872da27f21b0d4f322feb998f..5a30b205af5ca3dbb745e4a85fe92cd3cc9f1506 100644
--- a/templates/etc/pbuilder/debian.erb
+++ b/templates/etc/pbuilder/debian.erb
@@ -1,24 +1,55 @@
-# /etc/pbuilder/<%= @distribution %> -- Debian override configuration file for pbuilder.
+<%-
+  othermirrors = []
 
-MIRRORSITE=http://debian.stanford.edu/debian
+  repo_base = 'http://debian.stanford.edu'
+  sections  = 'main contrib non-free'
+  repos = {
+    'stan'    => "deb #{repo_base}/debian-stanford #{@distribution} #{sections}",
+    'local'   => "deb #{repo_base}/debian-local #{@distribution} #{sections}",
+    'bp'      => "deb #{repo_base}/debian #{@distribution}-backports #{sections}",
+    'stan-bp' => "deb #{repo_base}/debian-stanford #{@distribution}-backports #{sections}",
+  }
 
-# We always want the "stanford" and "local" Stanford-specific Debian repository.
-OTHERMIRROR="deb http://debian.stanford.edu/debian-stanford <%= @distribution %> main contrib non-free"
-OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian-local <%= @distribution %> main contrib non-free"
+  # include_stanford_repos tells us if we want to include the Stanford
+  # repositories. Currently, we want to include them if, and only if,
+  # @include_stanford_keyring is true. So we simply set
+  # include_stanford_repos equal to @include_stanford_keyring. Why have a
+  # separate variable that is exactlye the same as another variable?
+  # Because we may want to de-couple the two variables in the future,
+  # that's why.
+  include_stanford_repos = @include_stanford_keyring
+
+  if (include_stanford_repos) then
+    othermirrors.push(repos['stan'])
+    othermirrors.push(repos['local'])
+  end
 
-<%-
   if (@include_backports) then
-    backports_comment_character = ""
-    backports_message = "# We want backports."
-  else
-    backports_comment = "# "
-    backports_message = "# Backports distribution either no longer available or not yet\n"
-                      + "# available so omitting"
+    othermirrors.push(repos['bp'])
+    othermirrors.push(repos['stan-bp'])
   end
+
+  # Join all the other mirros
+  othermirrors_fmt = []
+  othermirrors.each do |othermirror|
+    if (othermirrors_joined == "")
+      # This is the first one
+      othermirrors_fmt.push(%Q[OTHERMIRROR="#{othermirror}"])
+    else
+      # This is not the first one
+      othermirrors_fmt.push(%Q[OTHERMIRROR="$OTHERMIRROR |#{othermirror}"])
+    end
+  end
+
+  # Now we join them
+  othermirrors_joined = othermirrors_fmt.join("\n")
 -%>
-<%= backports_message %>
-<%= backports_comment %>OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian <%= @distribution %>-backports main contrib non-free"
-<%= backports_comment %>OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian-stanford <%= @distribution %>-backports main contrib non-free"
+# /etc/pbuilder/<%= @distribution %> -- Debian override configuration file for pbuilder.
+
+MIRRORSITE=http://debian.stanford.edu/debian
+
+# These are all the extra repos that get added to /etc/apt/sources.list
+<%= othermirrors_joined %>
 
 <%- if (@include_stanford_keyring) then -%>
 EXTRAPACKAGES="aptitude debconf-utils debhelper gnupg stanford-keyring"