Skip to content
Snippets Groups Projects
Commit 60ab089b authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

improve the debian.erb template

parent 5763c5ce
No related branches found
No related tags found
No related merge requests found
# /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. # include_stanford_repos tells us if we want to include the Stanford
OTHERMIRROR="deb http://debian.stanford.edu/debian-stanford <%= @distribution %> main contrib non-free" # repositories. Currently, we want to include them if, and only if,
OTHERMIRROR="$OTHERMIRROR |deb http://debian.stanford.edu/debian-local <%= @distribution %> main contrib non-free" # @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 if (@include_backports) then
backports_comment_character = "" othermirrors.push(repos['bp'])
backports_message = "# We want backports." othermirrors.push(repos['stan-bp'])
else
backports_comment = "# "
backports_message = "# Backports distribution either no longer available or not yet\n"
+ "# available so omitting"
end 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 %> # /etc/pbuilder/<%= @distribution %> -- Debian override configuration file for pbuilder.
<%= 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" 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 -%> <%- if (@include_stanford_keyring) then -%>
EXTRAPACKAGES="aptitude debconf-utils debhelper gnupg stanford-keyring" EXTRAPACKAGES="aptitude debconf-utils debhelper gnupg stanford-keyring"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment