Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bash #5

Open
wants to merge 2 commits into
base: default
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions add_sources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
successes = sources.select do |src|
puts "-------------------\nAdding #{src.inspect}\n"
if src['key_url']
system("curl -sSL #{src['key_url'].untaint.inspect} | sudo -E env LANG=C.UTF-8 apt-key add -") && system("sudo -E env LANG=C.UTF-8 apt-add-repository -y #{src['sourceline'].untaint.inspect}")
else
system("sudo -E env LANG=C.UTF-8 apt-add-repository -y #{src['sourceline'].untaint.inspect}")
next unless system("curl -sSL #{src['key_url'].untaint.inspect} | sudo -E env LANG=C.UTF-8 apt-key add -")
end
system("sudo -E env LANG=C.UTF-8 apt-add-repository -ys #{src['sourceline'].untaint.inspect}")
end
17 changes: 12 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ source `dirname $0`/common.sh

PKG=$1

fold_start ruby19 "Installing Ruby 1.9.1"

This comment was marked as spam.

This comment was marked as spam.

sudo apt-get install ruby1.9.1 -qq
fold_end ruby19

export DEBIAN_FRONTEND=noninteractive
fold_start apt_src "Add APT sources"
cd
wget https://raw.githubusercontent.com/travis-ci/apt-source-whitelist/master/ubuntu.json
ruby1.9.1 -rjson add_sources.rb
old_IFS=$IFS
IFS=$'\t'
jq -r '.[]|[.alias,.sourceline,.key_url]|@tsv' ubuntu.json | \
while read -r Alias SourceLine KeyURL; do
echo "------------------------------"
echo "Adding ${Alias}"
if [[ "${KeyURL}" != "" ]]; then
curl -sSL ${KeyURL} | sudo -E env LANG=C.UTF-8 apt-key add - || continue;
fi
sudo -E env LANG=C.UTF-8 apt-add-repository -ys ${SourceLine}
done
IFS=${old_IFS}
mkdir -p /var/tmp/deb-sources
cd /var/tmp/deb-sources
sudo apt-get update -qq &>/dev/null
Expand Down