@@ -67,6 +67,11 @@ while getopts "r:l:vh-" opt; do
67
67
done
68
68
shift $(( OPTIND- 1 ))
69
69
70
+ # TODO: We need to reason better around the wget installation code. When root,
71
+ # we are able to install the relevant packages, so we should kickstat
72
+ # installation of curl/wget if none can be found.
73
+
74
+
70
75
_logline () {
71
76
printf ' [%s] [%s] %s\n' " $( basename " $0 " ) " " ${2:- NFO} " " $1 " >&2
72
77
}
@@ -108,12 +113,13 @@ _rpm() {
108
113
rpm --import " ${PWSH_ROOT%/ } /keys/microsoft.asc"
109
114
_verbose " Register YUM repository"
110
115
_download " $1 " > " ${PWSH_YUMROOT%/ } /microsoft.repo"
111
- # dnf check-update || true
116
+ dnf check-update || true
112
117
_verbose " Install dependencies and powershell"
113
118
yum install -y compat-openssl10
114
119
yum install -y powershell
115
120
}
116
121
122
+ # Guess latest stable release version of powershell made at GitHub.
117
123
_version () {
118
124
if [ -z " $PWSH_VERSION " ]; then
119
125
PWSH_VERSION=$( _download " ${PWSH_GHAPI%/ } /releases" |
@@ -124,13 +130,16 @@ _version() {
124
130
fi
125
131
}
126
132
133
+ # Install from YUM package pointed at URL passed as an argument
127
134
_yum () {
128
135
_verbose " Trying optional dependencies"
129
136
yum install -y compat-openssl10 || true
130
137
_verbose " Installing package from: $1 "
131
138
yum install -y " $1 "
132
139
}
133
140
141
+ # Install from DEB package pointed at URL passed as an argument. This will
142
+ # ensure that there is a wget to download stuff.
134
143
_deb () {
135
144
# shellcheck disable=SC3043 # local implemented almost everywhere
136
145
local _rm || true
@@ -191,6 +200,8 @@ install_asroot() {
191
200
esac
192
201
}
193
202
203
+ # Guess machine architecture in a way that is compatible with the PowerShell
204
+ # release URLs at GitHub.
194
205
_arch () {
195
206
case " $( uname -m) " in
196
207
x86_64) echo " x64" ;;
0 commit comments