File tree 1 file changed +14
-10
lines changed
1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,20 @@ _discover_distro_repo() {
113
113
;;
114
114
* )
115
115
# If there's no dedicated repository for the distro, try to figure out
116
- # if the distro is apt or rpm based and use a default repository.
117
- _discover_distro_type
116
+ # if the distro is apt, dnf or rpm based and use a default repository.
117
+ _discover_package_manager
118
118
119
- case " $DISTRO_TYPE " in
120
- deb )
119
+ case " $PACKAGE_MANAGER " in
120
+ apt )
121
121
DISTRO_REPO=" Debian_Unstable"
122
122
;;
123
- rpm)
123
+ dnf)
124
+ DISTRO_REPO=" Fedora_Rawhide"
125
+ ;;
126
+ yum)
124
127
DISTRO_REPO=" RHEL_7"
125
128
;;
126
- * )
129
+ unsupported_package_manager )
127
130
_error " Unable to identify distribution type ($ID ). You may specify a repository with the environment variable DISTRO_REPO"
128
131
_error " Please, report to https://forum.crystal-lang.org/c/help-support/11"
129
132
exit 1
@@ -132,10 +135,11 @@ _discover_distro_repo() {
132
135
esac
133
136
}
134
137
135
- _discover_distro_type () {
136
- DISTRO_TYPE=" "
137
- [[ $( command -v apt-get) ]] && DISTRO_TYPE=" deb" && return
138
- [[ $( command -v yum) ]] && DISTRO_TYPE=" rpm" && return
138
+ _discover_package_manager () {
139
+ [[ $( command -v apt-get) ]] && PACKAGE_MANAGER=" apt" && return
140
+ [[ $( command -v dnf) ]] && PACKAGE_MANAGER=" dnf" && return
141
+ [[ $( command -v yum) ]] && PACKAGE_MANAGER=" yum" && return
142
+ PACKAGE_MANAGER=" unsupported_package_manager"
139
143
}
140
144
141
145
if [[ $EUID -ne 0 ]]; then
You can’t perform that action at this time.
0 commit comments