-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
ubuntu
125 lines (108 loc) · 3.26 KB
/
ubuntu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env bash
# AMD64, i386, ARM.
requirements_debian_arch()
{
__architecture="$(dpkg --print-architecture)"
}
# Queries the dpkg system for packages that are installed only asking about
# the package name and it's arch. This package will fall back to :all for
# cases where we cannot get an arch specific package (such is the case
# for a few packages.)
requirements_debian_lib_installed()
{
dpkg-query -s "${1}:${__architecture}" >/dev/null 2>&1 ||
dpkg-query -s "${1}:all" >/dev/null 2>&1 ||
dpkg-query -s "$1" 2>/dev/null | __rvm_grep "Architecture: ${__architecture}" >/dev/null ||
dpkg-query -s "$1" 2>/dev/null | __rvm_grep "Architecture: all" >/dev/null ||
return $?
}
# Informs us if a package is even available on the distro we are working
# with, this is more of a transitional method kind of like Ubuntu
# has a transitional git-core package right now. This will allow us
# to continue to support older versions of Ubuntu while enforcing newer
# packages on newer Ubuntu.
requirements_debian_lib_available()
{
apt-cache show "$1" >/dev/null 2>&1 || return $?
}
requirements_debian_libs_install()
{
__rvm_try_sudo apt-get --no-install-recommends --yes install "$@" || return $?
}
requirements_debian_update_system()
{
__rvm_try_sudo apt-get --quiet --yes update ||
{
typeset __ret=$?
case ${__ret} in
(100)
rvm_error "There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
/etc/apt/sources.list.d/*.list
"
;;
esac
return ${__ret}
}
}
requirements_debian_define_java()
{
update-alternatives --list ${1:-java} >/dev/null 2>&1 ||
requirements_check_fallback \
openjdk-7-jre-headless openjdk-7-jdk oracle-j2sdk1.7 \
openjdk-6-jre-headless opendjk-6-jdk oracle-j2sdk1.6
}
requirements_debian_define()
{
typeset __architecture
requirements_debian_arch
case "$1" in
(rvm)
requirements_check bash curl patch bzip2 ca-certificates gawk
;;
(jruby*)
requirements_check g++
if
is_head_or_disable_binary "$1"
then
requirements_debian_define_java javac
requirements_check_fallback git git-core
if is_jruby_post17 "$1"
then __rvm_which mvn >/dev/null || requirements_check_fallback maven maven2
else __rvm_which ant >/dev/null || requirements_check ant
fi
else
requirements_debian_define_java java
fi
;;
(ir*)
requirements_check curl mono-2.0-devel
;;
(opal)
requirements_check nodejs npm
;;
(*-head)
requirements_check_fallback git git-core
requirements_debian_define "${1%-head}"
;;
(*)
# Also ran by *-head.
requirements_check \
g++ gcc make libc6-dev patch openssl ca-certificates libreadline6 \
libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev \
libsqlite3-dev sqlite3 autoconf \
libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
;;
esac
}
requirements_ubuntu_define()
{
__lib_type=debian
requirements_debian_define "$@"
}
requirements_mint_define()
{
__lib_type=debian
requirements_debian_define "$@"
}